阅读:2918回复:2
【求助】DriverEntry调用,但Dispatch Routine不调用的原因
坛里的兄弟,我在驱动编程入门时遇到了问题,寻求帮助!
WDK: D:\WinDDK\7600.16385.1 写了一个入门的驱动程序HelloDDK,然后利用DriverMonitor加载该驱动,显示该驱动已经正常加载 Monitor A new entry in the service database has been created for the driver. Monitor Select File | Start Driver to start the driver. Monitor Driver started successfully. 6614.859 Default Enter DriverEntry 6614.859 Default Leave DriverEntry Monitor -- end -- 在DrvierMonitor的加载过程中,DriverEntry的KdPrint信息在DebugView中显示 00000010 6720.64306641 Enter DriverEntry 00000011 6720.64501953 Leave DriverEntry 但是在运行一段用户程序时, int _cdecl main(void) { HANDLE hFile; DWORD dwReturn; hFile = CreateFile("\\\\.\\HelloDDK", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); if(hFile) { WriteFile(hFile, "Hello from user mode!", sizeof("Hello from user mode!"), &dwReturn, NULL); CloseHandle(hFile); } return 0; } 发现派遣例程的KdPrint信息不出现,这是为什么呢? |
|
沙发#
发布于:2010-09-09 23:45
|
|
板凳#
发布于:2010-11-24 13:10
看看CreateFile和WriteFile的返回值,HelloDDK看着真眼熟啊。
------------------------------------------------------------------ 帆子内核驱动网 bbs.kerneldev.com |
|
|