-
-
[旧帖] [求助]WDM驱动如何调试 0.00雪花
-
发表于: 2007-12-25 10:16 4017
-
WDM驱动开发:
环境:DriverStudio
它有两个文件:一个应用程序工程 Test_Timer 调试显示无法打开驱动
HANDLE OpenByInterface(
GUID* pClassGuid, // points to the GUID that identifies the interface class
DWORD instance, // specifies which instance of the enumerated devices to open
PDWORD pError // address of variable to receive error status
)
{
HANDLE hDev;
CDeviceInterfaceClass DevClass(pClassGuid, pError);
if (*pError != ERROR_SUCCESS)
return INVALID_HANDLE_VALUE;
CDeviceInterface DevInterface(&DevClass, instance, pError);
if (*pError != ERROR_SUCCESS)
return INVALID_HANDLE_VALUE;
hDev = CreateFile(
DevInterface.DevicePath(),
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL
);
if (hDev == INVALID_HANDLE_VALUE)
*pError = GetLastError();
return hDev;
}
还有就是这个应用程序工程可以直接加到C++程序中吗
环境:DriverStudio
它有两个文件:一个应用程序工程 Test_Timer 调试显示无法打开驱动
HANDLE OpenByInterface(
GUID* pClassGuid, // points to the GUID that identifies the interface class
DWORD instance, // specifies which instance of the enumerated devices to open
PDWORD pError // address of variable to receive error status
)
{
HANDLE hDev;
CDeviceInterfaceClass DevClass(pClassGuid, pError);
if (*pError != ERROR_SUCCESS)
return INVALID_HANDLE_VALUE;
CDeviceInterface DevInterface(&DevClass, instance, pError);
if (*pError != ERROR_SUCCESS)
return INVALID_HANDLE_VALUE;
hDev = CreateFile(
DevInterface.DevicePath(),
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL
);
if (hDev == INVALID_HANDLE_VALUE)
*pError = GetLastError();
return hDev;
}
还有就是这个应用程序工程可以直接加到C++程序中吗
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课
赞赏
他的文章
- [求助]WDM驱动如何与应用程序周期通信 4444
- [求助]WDM驱动如何调试 4018
- [求助]孙鑫多线程聊天程序 6236
- [求助]孙鑫视频多线程聊天程序 3885
看原图
赞赏
雪币:
留言: