Professional Documents
Culture Documents
PCI
PCI
if (! SetupDiGetDeviceInterfaceDetail (
hardwareDeviceInfo,
&deviceInfoData,
functionClassDeviceData,
predictedLength,
&requiredLength,
NULL)) {
free( functionClassDeviceData );
}
else{
hFile = CreateFile (
functionClassDeviceData->DevicePath,
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL, // no SECURITY_ATTRIBUTES structure
OPEN_EXISTING, // No special create flags
0, // No special attributes
NULL); // No template file
if(hFile != INVALID_HANDLE_VALUE){
WriteFile(hFile,outString,7,NULL,NULL);
ReadFile(hFile,inString,10,NULL,NULL);
}
}
} else {
cout << GetLastError() << endl;
}
system("PAUSE");
SetupDiDestroyDeviceInfoList (hardwareDeviceInfo);
return EXIT_SUCCESS;
}