首页
社区
课程
招聘
[旧帖] [求助]WDM驱动如何调试 0.00雪花
发表于: 2007-12-25 10:16 4017

[旧帖] [求助]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++程序中吗

[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

收藏
免费 0
支持
分享
最新回复 (0)
游客
登录 | 注册 方可回帖
返回
//