├── CodePub.Com说明.txt ├── README.md ├── chapter01 ├── NT_Driver │ ├── 1 │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ ├── Sources │ │ ├── makefile │ │ └── 说明.txt │ └── 2 │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ ├── DriverDev.dsp │ │ ├── DriverDev.dsw │ │ └── 说明.txt └── WDM_Driver │ ├── 1 │ ├── HelloWDM.cpp │ ├── HelloWDM.h │ ├── HelloWDM.inf │ ├── Sources │ ├── makefile │ └── 说明.txt │ └── 2 │ ├── DriverDev.dsp │ ├── DriverDev.dsw │ ├── HelloWDM.cpp │ ├── HelloWDM.h │ ├── HelloWDM.inf │ └── 说明.txt ├── chapter03 └── LoadNTDriver │ ├── DriverDev.dsw │ ├── MyDriver │ ├── Driver.cpp │ ├── Driver.h │ └── MyDriver.dsp │ └── Test │ ├── Test.dsp │ └── main.cpp ├── chapter04 ├── NT_Driver │ └── 2 │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ ├── DriverDev.dsp │ │ ├── DriverDev.dsw │ │ └── 说明.txt └── WDM_Driver │ └── 2 │ ├── DriverDev.dsp │ ├── DriverDev.dsw │ ├── HelloWDM.cpp │ ├── HelloWDM.h │ ├── HelloWDM.inf │ └── 说明.txt ├── chapter05 ├── FileTest │ └── NT_Driver │ │ └── 2 │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ ├── DriverDev.dsp │ │ └── DriverDev.dsw ├── LinkList │ └── NT_Driver │ │ └── 2 │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ ├── DriverDev.dsp │ │ └── DriverDev.dsw ├── Lookaside │ └── NT_Driver │ │ └── 2 │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ ├── DriverDev.dsp │ │ └── DriverDev.dsw ├── RegTest │ └── NT_Driver │ │ └── 2 │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ ├── DriverDev.dsp │ │ └── DriverDev.dsw ├── RtlTest │ └── NT_Driver │ │ └── 2 │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ ├── DriverDev.dsp │ │ └── DriverDev.dsw ├── SEHTest │ └── NT_Driver │ │ └── 2 │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ ├── DriverDev.dsp │ │ └── DriverDev.dsw ├── StringTest │ └── NT_Driver │ │ └── 2 │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ ├── DriverDev.dsp │ │ └── DriverDev.dsw └── new │ └── NT_Driver │ └── 2 │ ├── Driver.cpp │ ├── Driver.h │ ├── DriverDev.dsp │ └── DriverDev.dsw ├── chapter07 ├── DispatchTest │ ├── NT_Driver.dsw │ ├── NT_Driver │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ └── DriverDev.dsp │ └── Test │ │ ├── Test.dsp │ │ ├── function.cpp │ │ ├── function.h │ │ └── main.cpp ├── IOCTL_Test │ ├── NT_Driver.dsw │ ├── NT_Driver │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ ├── DriverDev.dsp │ │ └── Ioctls.h │ └── Test │ │ ├── Test.dsp │ │ ├── function.cpp │ │ ├── function.h │ │ └── main.cpp ├── MDL_Test │ ├── NT_Driver.dsw │ ├── NT_Driver │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ └── DriverDev.dsp │ └── Test │ │ ├── Test.dsp │ │ ├── function.cpp │ │ ├── function.h │ │ └── main.cpp ├── Neither_Device_Test │ ├── NT_Driver.dsw │ ├── NT_Driver │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ └── DriverDev.dsp │ └── Test │ │ ├── Test.dsp │ │ ├── function.cpp │ │ ├── function.h │ │ └── main.cpp ├── ReadTest │ ├── NT_Driver.dsw │ ├── NT_Driver │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ └── DriverDev.dsp │ └── Test │ │ ├── Test.dsp │ │ ├── function.cpp │ │ ├── function.h │ │ └── main.cpp └── SimulateFile │ ├── NT_Driver.dsw │ ├── NT_Driver │ ├── Driver.cpp │ ├── Driver.h │ └── DriverDev.dsp │ └── Test │ ├── Test.dsp │ ├── function.cpp │ ├── function.h │ └── main.cpp ├── chapter09 ├── AsyncOperate1 │ └── Test │ │ ├── Test.dsp │ │ ├── Test.dsw │ │ └── main.cpp ├── AsyncOperate2 │ └── Test │ │ ├── Debug │ │ └── test.dat │ │ ├── Test.dsp │ │ ├── Test.dsw │ │ ├── main.cpp │ │ └── test.dat ├── CancelIRPTest │ ├── NT_Driver.dsw │ ├── NT_Driver │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ └── DriverDev.dsp │ └── Test │ │ ├── Test.dsp │ │ ├── function.cpp │ │ ├── function.h │ │ └── main.cpp ├── PendingIRPTest │ ├── NT_Driver.dsw │ ├── NT_Driver │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ └── DriverDev.dsp │ └── Test │ │ ├── Test.dsp │ │ ├── function.cpp │ │ ├── function.h │ │ └── main.cpp ├── SpecialStartIOTest │ ├── NT_Driver.dsw │ ├── NT_Driver │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ └── DriverDev.dsp │ └── Test │ │ ├── Test.dsp │ │ └── main.cpp ├── StartIOTest │ ├── NT_Driver.dsw │ ├── NT_Driver │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ └── DriverDev.dsp │ └── Test │ │ ├── Test.dsp │ │ └── main.cpp └── SyncOperate │ └── Test │ ├── Test.dsp │ ├── Test.dsw │ └── main.cpp ├── chapter10 ├── DPCTimer_Test │ ├── NT_Driver.dsw │ ├── NT_Driver │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ ├── DriverDev.dsp │ │ └── Ioctls.h │ └── Test │ │ ├── Test.dsp │ │ └── main.cpp ├── IRPTimeout_Test │ ├── NT_Driver.dsw │ ├── NT_Driver │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ └── DriverDev.dsp │ └── Test │ │ ├── Test.dsp │ │ └── main.cpp ├── IoTimer_Test │ ├── NT_Driver.dsw │ ├── NT_Driver │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ ├── DriverDev.dsp │ │ └── Ioctls.h │ └── Test │ │ ├── Test.dsp │ │ └── main.cpp ├── Time_Test │ ├── NT_Driver.dsw │ ├── NT_Driver │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ ├── DriverDev.dsp │ │ └── Ioctls.h │ └── Test │ │ ├── Test.dsp │ │ └── main.cpp └── Waiting_Test │ ├── NT_Driver.dsw │ ├── NT_Driver │ ├── Driver.cpp │ ├── Driver.h │ ├── DriverDev.dsp │ └── Ioctls.h │ └── Test │ ├── Test.dsp │ └── main.cpp ├── chapter11 ├── Test1 │ ├── DriverDevA │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ └── DriverDevA.dsp │ ├── DriverDevB │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ └── DriverDevB.dsp │ ├── NT_Driver.dsw │ └── Test │ │ ├── ConsoleTest.dsp │ │ └── main.cpp ├── Test2 │ ├── DriverDevA │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ └── DriverDevA.dsp │ ├── DriverDevB │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ └── DriverDevB.dsp │ ├── NT_Driver.dsw │ └── Test │ │ ├── ConsoleTest.dsp │ │ └── main.cpp ├── Test3 │ ├── DriverDevA │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ └── DriverDevA.dsp │ ├── DriverDevB │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ └── DriverDevB.dsp │ ├── NT_Driver.dsw │ └── Test │ │ ├── ConsoleTest.dsp │ │ └── main.cpp ├── Test4 │ ├── DriverDevA │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ └── DriverDevA.dsp │ ├── DriverDevB │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ └── DriverDevB.dsp │ ├── NT_Driver.dsw │ └── Test │ │ ├── ConsoleTest.dsp │ │ └── main.cpp ├── Test5 │ ├── DriverDevA │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ └── DriverDevA.dsp │ ├── DriverDevB │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ └── DriverDevB.dsp │ ├── NT_Driver.dsw │ └── Test │ │ ├── ConsoleTest.dsp │ │ └── main.cpp ├── Test6 │ ├── DriverDevA │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ └── DriverDevA.dsp │ ├── DriverDevB │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ └── DriverDevB.dsp │ ├── NT_Driver.dsw │ └── Test │ │ ├── ConsoleTest.dsp │ │ └── main.cpp ├── Test7 │ ├── DriverDevA │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ └── DriverDevA.dsp │ ├── DriverDevB │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ └── DriverDevB.dsp │ ├── NT_Driver.dsw │ └── Test │ │ ├── ConsoleTest.dsp │ │ └── main.cpp └── Test8 │ ├── DriverDevA │ ├── Driver.cpp │ ├── Driver.h │ └── DriverDevA.dsp │ ├── DriverDevB │ ├── Driver.cpp │ ├── Driver.h │ └── DriverDevB.dsp │ ├── NT_Driver.dsw │ └── Test │ ├── ConsoleTest.dsp │ └── main.cpp ├── chapter12 ├── Test1 │ ├── DriverDevA │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ └── DriverDevA.dsp │ ├── DriverDevB │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ └── DriverDevB.dsp │ ├── NT_Driver.dsw │ └── Test │ │ ├── ConsoleTest.dsp │ │ └── main.cpp ├── Test2 │ ├── NT_Driver.dsw │ ├── NT_Driver │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ ├── DriverDev.dsp │ │ └── Ioctls.h │ └── Test │ │ ├── Test.dsp │ │ └── main.cpp ├── Test3 │ ├── DriverDevA │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ └── DriverDevA.dsp │ ├── DriverDevB │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ └── DriverDevB.dsp │ ├── NT_Driver.dsw │ └── Test │ │ ├── ConsoleTest.dsp │ │ └── main.cpp ├── Test4 │ ├── DriverDevA │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ └── DriverDevA.dsp │ ├── DriverDevB │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ └── DriverDevB.dsp │ ├── NT_Driver.dsw │ └── Test │ │ ├── ConsoleTest.dsp │ │ └── main.cpp └── Test5 │ ├── DriverDevA │ ├── Driver.cpp │ ├── Driver.h │ └── DriverDevA.dsp │ ├── DriverDevB │ ├── Driver.cpp │ ├── Driver.h │ └── DriverDevB.dsp │ ├── NT_Driver.dsw │ └── Test │ ├── ConsoleTest.dsp │ └── main.cpp ├── chapter13 ├── Test1 │ ├── DriverDev.dsw │ ├── MyDriver │ │ ├── HelloWDM.cpp │ │ ├── HelloWDM.h │ │ ├── HelloWDM.inf │ │ ├── Ioctls.h │ │ ├── MyDriver.dsp │ │ ├── MyDriver_Check │ │ │ └── HelloWDM.sbr │ │ └── guid.h │ └── Test │ │ ├── Test.dsp │ │ ├── function.cpp │ │ ├── function.h │ │ └── main.cpp ├── Test2 │ ├── DriverDev.dsw │ ├── MyDriver │ │ ├── HelloWDM.cpp │ │ ├── HelloWDM.h │ │ ├── HelloWDM.inf │ │ ├── Ioctls.h │ │ ├── MyDriver.dsp │ │ ├── MyDriver_Check │ │ │ └── HelloWDM.sbr │ │ └── guid.h │ └── Test │ │ ├── Test.dsp │ │ ├── function.cpp │ │ ├── function.h │ │ └── main.cpp └── Test3 │ ├── DriverDev.dsw │ ├── MyDriver │ ├── HelloWDM.cpp │ ├── HelloWDM.h │ ├── HelloWDM.inf │ ├── Ioctls.h │ ├── MyDriver.dsp │ ├── MyDriver_Check │ │ └── HelloWDM.sbr │ └── guid.h │ └── Test │ ├── Test.dsp │ ├── function.cpp │ ├── function.h │ └── main.cpp ├── chapter14 └── Test1 │ ├── DriverDev.dsw │ ├── MyDriver │ ├── HelloWDM.cpp │ ├── HelloWDM.h │ ├── HelloWDM.inf │ ├── Ioctls.h │ ├── MyDriver.dsp │ ├── MyDriver_Check │ │ └── HelloWDM.sbr │ └── guid.h │ └── Test │ ├── Test.dsp │ ├── function.cpp │ ├── function.h │ └── main.cpp ├── chapter15 ├── Test1 │ ├── ConsoleTest.dsp │ ├── ConsoleTest.dsw │ └── main.cpp ├── Test2 │ ├── ConsoleTest.dsp │ ├── ConsoleTest.dsw │ ├── Debug │ │ ├── WinIo.dll │ │ └── WinIo.sys │ ├── WinIoLib │ │ ├── WINIO.VXD │ │ ├── WinIo.dll │ │ ├── WinIo.h │ │ ├── WinIo.lib │ │ └── WinIo.sys │ └── main.cpp ├── Test3 │ ├── NT_Driver.dsw │ ├── NT_Driver │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ ├── DriverDev.dsp │ │ └── Ioctls.h │ └── Test │ │ ├── Test.dsp │ │ ├── function.cpp │ │ ├── function.h │ │ └── main.cpp ├── Test4 │ ├── NT_Driver.dsw │ ├── NT_Driver │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ ├── DriverDev.dsp │ │ └── Ioctls.h │ └── Test │ │ ├── Test.dsp │ │ ├── function.cpp │ │ ├── function.h │ │ └── main.cpp ├── Test5 │ ├── NT_Driver.dsw │ ├── NT_Driver │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ ├── DriverDev.dsp │ │ └── Ioctls.h │ └── Test │ │ ├── Debug │ │ ├── Test.bsc │ │ ├── function.sbr │ │ └── main.sbr │ │ ├── Test.dsp │ │ ├── function.cpp │ │ ├── function.h │ │ └── main.cpp ├── Test6 │ ├── NT_Driver.dsw │ ├── NT_Driver │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ ├── DriverDev.dsp │ │ └── Ioctls.h │ └── Test │ │ ├── Debug │ │ ├── Test.bsc │ │ ├── function.sbr │ │ └── main.sbr │ │ ├── Test.dsp │ │ ├── function.cpp │ │ ├── function.h │ │ └── main.cpp ├── Test7 │ ├── NT_Driver.dsw │ ├── NT_Driver │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ ├── DriverDev.dsp │ │ └── Ioctls.h │ └── Test │ │ ├── Test.dsp │ │ ├── function.cpp │ │ ├── function.h │ │ └── main.cpp └── Test8 │ ├── NT_Driver.dsw │ ├── NT_Driver │ ├── Driver.cpp │ ├── Driver.h │ ├── DriverDev.dsp │ └── Ioctls.h │ └── Test │ ├── Test.dsp │ ├── function.cpp │ ├── function.h │ └── main.cpp ├── chapter16 ├── Test1 │ └── NT_Driver │ │ ├── NT_Driver.dsw │ │ ├── NT_Driver │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ ├── DriverDev.dsp │ │ └── Ioctls.h │ │ └── Test │ │ ├── PCI00000.bin │ │ ├── PCI00010.bin │ │ ├── PCI00020.bin │ │ ├── PCI00021.bin │ │ ├── PCI001B0.bin │ │ ├── PCI001C0.bin │ │ ├── PCI001D0.bin │ │ ├── PCI001D1.bin │ │ ├── PCI001D2.bin │ │ ├── PCI001D3.bin │ │ ├── PCI001D7.bin │ │ ├── PCI001E0.bin │ │ ├── PCI001F0.bin │ │ ├── PCI001F1.bin │ │ ├── PCI001F2.bin │ │ ├── PCI001F3.bin │ │ ├── PCI02000.bin │ │ ├── Test.dsp │ │ ├── function.cpp │ │ ├── function.h │ │ └── main.cpp ├── Test2 │ └── NT_Driver │ │ ├── NT_Driver.dsw │ │ ├── NT_Driver │ │ ├── Driver.cpp │ │ ├── Driver.h │ │ ├── DriverDev.dsp │ │ └── Ioctls.h │ │ └── Test │ │ ├── PCI00000.bin │ │ ├── PCI00010.bin │ │ ├── PCI00020.bin │ │ ├── PCI00021.bin │ │ ├── PCI001B0.bin │ │ ├── PCI001C0.bin │ │ ├── PCI001D0.bin │ │ ├── PCI001D1.bin │ │ ├── PCI001D2.bin │ │ ├── PCI001D3.bin │ │ ├── PCI001D7.bin │ │ ├── PCI001E0.bin │ │ ├── PCI001F0.bin │ │ ├── PCI001F1.bin │ │ ├── PCI001F2.bin │ │ ├── PCI001F3.bin │ │ ├── PCI02000.bin │ │ ├── Test.dsp │ │ ├── function.cpp │ │ ├── function.h │ │ └── main.cpp ├── Test3 │ └── WDM_Driver │ │ ├── DriverDev.dsw │ │ ├── MyDriver │ │ ├── HelloWDM.cpp │ │ ├── HelloWDM.h │ │ ├── HelloWDM.inf │ │ ├── Ioctls.h │ │ ├── MyDriver.dsp │ │ ├── MyDriver_Check │ │ │ └── HelloWDM.sbr │ │ └── guid.h │ │ └── Test │ │ ├── Test.dsp │ │ ├── function.cpp │ │ ├── function.h │ │ └── main.cpp ├── Test4 │ ├── DriverDev.dsw │ ├── MyDriver │ │ ├── HelloWDM.cpp │ │ ├── HelloWDM.h │ │ ├── HelloWDM.inf │ │ ├── Ioctls.h │ │ ├── MyDriver.dsp │ │ ├── MyDriver_Check │ │ │ └── HelloWDM.sbr │ │ └── guid.h │ └── Test │ │ ├── Test.dsp │ │ ├── function.cpp │ │ ├── function.h │ │ └── main.cpp └── Test5 │ └── WDM_Driver │ ├── DriverDev.dsw │ ├── MyDriver │ ├── HelloWDM.cpp │ ├── HelloWDM.h │ ├── HelloWDM.inf │ ├── Ioctls.h │ ├── MyDriver.dsp │ ├── MyDriver_Check │ │ └── HelloWDM.sbr │ └── guid.h │ └── Test │ ├── Test.dsp │ ├── function.cpp │ ├── function.h │ └── main.cpp ├── chapter17 ├── exe │ ├── makefile │ ├── rwbulk.c │ ├── rwbulk.rc │ └── sources └── sys │ ├── bulkdev.c │ ├── bulkdev.h │ ├── bulkpnp.c │ ├── bulkpnp.h │ ├── bulkpwr.c │ ├── bulkpwr.h │ ├── bulkrwr.c │ ├── bulkrwr.h │ ├── bulkusb.c │ ├── bulkusb.h │ ├── bulkusb.inf │ ├── bulkusb.mof │ ├── bulkusb.rc │ ├── bulkusr.h │ ├── bulkwmi.c │ ├── bulkwmi.h │ ├── makefile │ ├── makefile.inc │ └── sources ├── chapter18 ├── SDIO_Driver │ ├── HelloWDM.inf │ ├── Ioctls.h │ ├── SdioDev.h │ ├── Sdiomain.h │ ├── Sdiousb.cpp │ ├── Sources │ ├── buildchk_wnet_x86.log │ ├── buildchk_wnet_x86.wrn │ ├── buildchk_wxp_x86.log │ ├── guid.h │ ├── makefile │ └── objchk_wxp_x86 │ │ └── i386 │ │ └── _objects.mac ├── Test │ ├── Test.dsp │ ├── Test.dsw │ ├── function.cpp │ ├── function.h │ └── main.cpp └── 说明.txt ├── chapter19 └── Virtual_COM │ ├── DriverDev.dsp │ ├── DriverDev.dsw │ ├── HelloWDM.cpp │ ├── HelloWDM.h │ ├── HelloWDM.inf │ └── 说明.txt ├── chapter20 └── testcap │ ├── buildchk_wxp_x86.log │ ├── capdebug.h │ ├── capirq.c │ ├── capmain.c │ ├── capmain.h │ ├── capprop.c │ ├── capprop.h │ ├── capstrm.h │ ├── capvideo.c │ ├── capxfer.c │ ├── capxfer.h │ ├── ddraw.c │ ├── makefile │ ├── mediums.h │ ├── objchk_wxp_x86 │ ├── _objects.mac │ └── i386 │ │ └── testcap.res │ ├── sources │ ├── testcap.htm │ ├── testcap.inf │ └── testcap.rc ├── chapter22 ├── FileFilter │ ├── Driver.h │ ├── DriverEntry.cpp │ ├── MyFilter.dsp │ ├── MyFilter.dsw │ ├── filter.inf │ ├── stddcls.cpp │ └── stddcls.h └── KeyFilter │ ├── CTRL2CAP.H │ ├── MAKEFILE │ ├── SOURCES │ ├── buildchk_wxp_x86.log │ ├── ctrl2cap.c │ ├── ctrl2cap.rc │ └── objchk_wxp_x86 │ ├── _objects.mac │ └── i386 │ └── ctrl2cap.res ├── chapter23 ├── ErrorTest │ ├── DriverDev.dsp │ ├── DriverDev.dsw │ ├── HelloWDM.cpp │ ├── HelloWDM.h │ ├── HelloWDM.inf │ └── 说明.txt └── ErrorTest2 │ ├── DriverDev.dsp │ ├── DriverDev.dsw │ ├── HelloWDM.cpp │ ├── HelloWDM.h │ ├── HelloWDM.inf │ └── 说明.txt ├── readme.doc └── 笔记 └── 第1课.pps /CodePub.Com说明.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/CodePub.Com说明.txt -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Windows-Driver-Development-Internals 2 | Windows 驱动开发技术详解 张帆 史彩成 3 | -------------------------------------------------------------------------------- /chapter01/NT_Driver/1/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter01/NT_Driver/1/Driver.cpp -------------------------------------------------------------------------------- /chapter01/NT_Driver/1/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter01/NT_Driver/1/Driver.h -------------------------------------------------------------------------------- /chapter01/NT_Driver/1/Sources: -------------------------------------------------------------------------------- 1 | TARGETNAME=HelloDDK 2 | TARGETTYPE=DRIVER 3 | TARGETPATH=OBJ 4 | 5 | INCLUDES=$(BASEDIR)\inc;\ 6 | $(BASEDIR)\inc\ddk;\ 7 | 8 | SOURCES=Driver.cpp\ -------------------------------------------------------------------------------- /chapter01/NT_Driver/1/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # DO NOT EDIT THIS FILE!!! Edit .\sources. If you want to add a new source 3 | # file to this component. This file merely indirects to the real make file 4 | # that is shared by all the driver components of the Windows NT DDK 5 | # 6 | 7 | !INCLUDE $(NTMAKEENV)\makefile.def -------------------------------------------------------------------------------- /chapter01/NT_Driver/1/说明.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter01/NT_Driver/1/说明.txt -------------------------------------------------------------------------------- /chapter01/NT_Driver/2/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter01/NT_Driver/2/Driver.cpp -------------------------------------------------------------------------------- /chapter01/NT_Driver/2/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter01/NT_Driver/2/Driver.h -------------------------------------------------------------------------------- /chapter01/NT_Driver/2/DriverDev.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=.\DriverDev.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /chapter01/NT_Driver/2/说明.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter01/NT_Driver/2/说明.txt -------------------------------------------------------------------------------- /chapter01/WDM_Driver/1/HelloWDM.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter01/WDM_Driver/1/HelloWDM.cpp -------------------------------------------------------------------------------- /chapter01/WDM_Driver/1/HelloWDM.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter01/WDM_Driver/1/HelloWDM.h -------------------------------------------------------------------------------- /chapter01/WDM_Driver/1/HelloWDM.inf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter01/WDM_Driver/1/HelloWDM.inf -------------------------------------------------------------------------------- /chapter01/WDM_Driver/1/Sources: -------------------------------------------------------------------------------- 1 | TARGETNAME=HelloWDM 2 | TARGETTYPE=DRIVER 3 | DRIVERTYPE=WDM 4 | TARGETPATH=OBJ 5 | 6 | INCLUDES=$(BASEDIR)\inc;\ 7 | $(BASEDIR)\inc\ddk;\ 8 | 9 | SOURCES=HelloWDM.cpp\ -------------------------------------------------------------------------------- /chapter01/WDM_Driver/1/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # DO NOT EDIT THIS FILE!!! Edit .\sources. If you want to add a new source 3 | # file to this component. This file merely indirects to the real make file 4 | # that is shared by all the driver components of the Windows NT DDK 5 | # 6 | 7 | !INCLUDE $(NTMAKEENV)\makefile.def -------------------------------------------------------------------------------- /chapter01/WDM_Driver/1/说明.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter01/WDM_Driver/1/说明.txt -------------------------------------------------------------------------------- /chapter01/WDM_Driver/2/DriverDev.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=.\DriverDev.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /chapter01/WDM_Driver/2/HelloWDM.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter01/WDM_Driver/2/HelloWDM.cpp -------------------------------------------------------------------------------- /chapter01/WDM_Driver/2/HelloWDM.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter01/WDM_Driver/2/HelloWDM.h -------------------------------------------------------------------------------- /chapter01/WDM_Driver/2/HelloWDM.inf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter01/WDM_Driver/2/HelloWDM.inf -------------------------------------------------------------------------------- /chapter01/WDM_Driver/2/说明.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter01/WDM_Driver/2/说明.txt -------------------------------------------------------------------------------- /chapter03/LoadNTDriver/DriverDev.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "MyDriver"=".\MyDriver\MyDriver.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "Test"=".\Test\Test.dsp" - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | Begin Project Dependency 27 | Project_Dep_Name MyDriver 28 | End Project Dependency 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /chapter03/LoadNTDriver/MyDriver/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter03/LoadNTDriver/MyDriver/Driver.cpp -------------------------------------------------------------------------------- /chapter03/LoadNTDriver/MyDriver/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter03/LoadNTDriver/MyDriver/Driver.h -------------------------------------------------------------------------------- /chapter03/LoadNTDriver/Test/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter03/LoadNTDriver/Test/main.cpp -------------------------------------------------------------------------------- /chapter04/NT_Driver/2/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter04/NT_Driver/2/Driver.cpp -------------------------------------------------------------------------------- /chapter04/NT_Driver/2/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter04/NT_Driver/2/Driver.h -------------------------------------------------------------------------------- /chapter04/NT_Driver/2/DriverDev.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=.\DriverDev.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /chapter04/NT_Driver/2/说明.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter04/NT_Driver/2/说明.txt -------------------------------------------------------------------------------- /chapter04/WDM_Driver/2/DriverDev.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=.\DriverDev.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /chapter04/WDM_Driver/2/HelloWDM.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter04/WDM_Driver/2/HelloWDM.cpp -------------------------------------------------------------------------------- /chapter04/WDM_Driver/2/HelloWDM.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter04/WDM_Driver/2/HelloWDM.h -------------------------------------------------------------------------------- /chapter04/WDM_Driver/2/HelloWDM.inf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter04/WDM_Driver/2/HelloWDM.inf -------------------------------------------------------------------------------- /chapter04/WDM_Driver/2/说明.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter04/WDM_Driver/2/说明.txt -------------------------------------------------------------------------------- /chapter05/FileTest/NT_Driver/2/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter05/FileTest/NT_Driver/2/Driver.cpp -------------------------------------------------------------------------------- /chapter05/FileTest/NT_Driver/2/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter05/FileTest/NT_Driver/2/Driver.h -------------------------------------------------------------------------------- /chapter05/FileTest/NT_Driver/2/DriverDev.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=.\DriverDev.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /chapter05/LinkList/NT_Driver/2/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter05/LinkList/NT_Driver/2/Driver.cpp -------------------------------------------------------------------------------- /chapter05/LinkList/NT_Driver/2/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter05/LinkList/NT_Driver/2/Driver.h -------------------------------------------------------------------------------- /chapter05/LinkList/NT_Driver/2/DriverDev.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=.\DriverDev.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /chapter05/Lookaside/NT_Driver/2/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter05/Lookaside/NT_Driver/2/Driver.cpp -------------------------------------------------------------------------------- /chapter05/Lookaside/NT_Driver/2/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter05/Lookaside/NT_Driver/2/Driver.h -------------------------------------------------------------------------------- /chapter05/Lookaside/NT_Driver/2/DriverDev.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=.\DriverDev.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /chapter05/RegTest/NT_Driver/2/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter05/RegTest/NT_Driver/2/Driver.cpp -------------------------------------------------------------------------------- /chapter05/RegTest/NT_Driver/2/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter05/RegTest/NT_Driver/2/Driver.h -------------------------------------------------------------------------------- /chapter05/RegTest/NT_Driver/2/DriverDev.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=.\DriverDev.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /chapter05/RtlTest/NT_Driver/2/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter05/RtlTest/NT_Driver/2/Driver.cpp -------------------------------------------------------------------------------- /chapter05/RtlTest/NT_Driver/2/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter05/RtlTest/NT_Driver/2/Driver.h -------------------------------------------------------------------------------- /chapter05/RtlTest/NT_Driver/2/DriverDev.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=.\DriverDev.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /chapter05/SEHTest/NT_Driver/2/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter05/SEHTest/NT_Driver/2/Driver.cpp -------------------------------------------------------------------------------- /chapter05/SEHTest/NT_Driver/2/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter05/SEHTest/NT_Driver/2/Driver.h -------------------------------------------------------------------------------- /chapter05/SEHTest/NT_Driver/2/DriverDev.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=.\DriverDev.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /chapter05/StringTest/NT_Driver/2/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter05/StringTest/NT_Driver/2/Driver.cpp -------------------------------------------------------------------------------- /chapter05/StringTest/NT_Driver/2/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter05/StringTest/NT_Driver/2/Driver.h -------------------------------------------------------------------------------- /chapter05/StringTest/NT_Driver/2/DriverDev.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=.\DriverDev.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /chapter05/new/NT_Driver/2/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter05/new/NT_Driver/2/Driver.cpp -------------------------------------------------------------------------------- /chapter05/new/NT_Driver/2/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter05/new/NT_Driver/2/Driver.h -------------------------------------------------------------------------------- /chapter05/new/NT_Driver/2/DriverDev.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=.\DriverDev.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /chapter07/DispatchTest/NT_Driver.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=".\NT_Driver\DriverDev.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "Test"=".\Test\Test.dsp" - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | Begin Project Dependency 27 | Project_Dep_Name DriverDev 28 | End Project Dependency 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /chapter07/DispatchTest/NT_Driver/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter07/DispatchTest/NT_Driver/Driver.cpp -------------------------------------------------------------------------------- /chapter07/DispatchTest/NT_Driver/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter07/DispatchTest/NT_Driver/Driver.h -------------------------------------------------------------------------------- /chapter07/DispatchTest/Test/function.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "function.h" 5 | 6 | // DWORD ReadPort(HANDLE hDevice,DWORD port) 7 | // { 8 | // DWORD dwOutput; 9 | // DWORD dwRead; 10 | // DeviceIoControl(hDevice, IOCTL_READ_PORT_ULONG, &port, 4, &dwOutput, 4, &dwRead, NULL); 11 | // return dwOutput; 12 | // } 13 | // VOID WritePort(HANDLE hDevice,DWORD port,DWORD value) 14 | // { 15 | // PVOID buffer[2]; 16 | // buffer[0] = (PVOID)port; 17 | // buffer[1] = (PVOID)value; 18 | // DWORD dwWrite; 19 | // DeviceIoControl(hDevice, IOCTL_WRITE_PORT_ULONG, &port, 8, NULL, 0, &dwWrite, NULL); 20 | // } 21 | // VOID TestDriver(HANDLE hDevice) 22 | // { 23 | // DWORD dwOutput; 24 | // DeviceIoControl(hDevice, IOCTL_TEST, NULL, 0, NULL, 0, &dwOutput, NULL); 25 | // } 26 | 27 | -------------------------------------------------------------------------------- /chapter07/DispatchTest/Test/function.h: -------------------------------------------------------------------------------- 1 | #ifndef FUNCTION_H 2 | #define FUNCTION_H 3 | 4 | //#include "../MyDriver/Ioctls.h" 5 | 6 | DWORD ReadPort(HANDLE hDevice,DWORD port); 7 | VOID WritePort(HANDLE hDevice,DWORD port,DWORD value); 8 | VOID TestDriver(HANDLE hDevice); 9 | #endif -------------------------------------------------------------------------------- /chapter07/DispatchTest/Test/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | HANDLE hDevice = 7 | CreateFile("\\\\.\\HelloDDK", 8 | GENERIC_READ | GENERIC_WRITE, 9 | 0, // share mode none 10 | NULL, // no security 11 | OPEN_EXISTING, 12 | FILE_ATTRIBUTE_NORMAL, 13 | NULL ); // no template 14 | 15 | if (hDevice == INVALID_HANDLE_VALUE) 16 | { 17 | printf("Failed to obtain file handle to device: " 18 | "%s with Win32 error code: %d\n", 19 | "MyWDMDevice", GetLastError() ); 20 | return 1; 21 | } 22 | 23 | CloseHandle(hDevice); 24 | return 0; 25 | } -------------------------------------------------------------------------------- /chapter07/IOCTL_Test/NT_Driver.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=".\NT_Driver\DriverDev.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "Test"=".\Test\Test.dsp" - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | Begin Project Dependency 27 | Project_Dep_Name DriverDev 28 | End Project Dependency 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /chapter07/IOCTL_Test/NT_Driver/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter07/IOCTL_Test/NT_Driver/Driver.cpp -------------------------------------------------------------------------------- /chapter07/IOCTL_Test/NT_Driver/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter07/IOCTL_Test/NT_Driver/Driver.h -------------------------------------------------------------------------------- /chapter07/IOCTL_Test/NT_Driver/Ioctls.h: -------------------------------------------------------------------------------- 1 | // IOCTLS.H -- IOCTL code definitions for fileio driver 2 | // Copyright (C) 1999 by Walter Oney 3 | // All rights reserved 4 | 5 | #ifndef IOCTLS_H 6 | #define IOCTLS_H 7 | 8 | #ifndef CTL_CODE 9 | #pragma message("CTL_CODE undefined. Include winioctl.h or wdm.h") 10 | #endif 11 | 12 | #define IOCTL_TEST1 CTL_CODE(\ 13 | FILE_DEVICE_UNKNOWN, \ 14 | 0x800, \ 15 | METHOD_BUFFERED, \ 16 | FILE_ANY_ACCESS) 17 | 18 | #define IOCTL_TEST2 CTL_CODE(\ 19 | FILE_DEVICE_UNKNOWN, \ 20 | 0x801, \ 21 | METHOD_IN_DIRECT, \ 22 | FILE_ANY_ACCESS) 23 | 24 | #define IOCTL_TEST3 CTL_CODE(\ 25 | FILE_DEVICE_UNKNOWN, \ 26 | 0x802, \ 27 | METHOD_NEITHER, \ 28 | FILE_ANY_ACCESS) 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /chapter07/IOCTL_Test/Test/function.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "function.h" 5 | 6 | // DWORD ReadPort(HANDLE hDevice,DWORD port) 7 | // { 8 | // DWORD dwOutput; 9 | // DWORD dwRead; 10 | // DeviceIoControl(hDevice, IOCTL_READ_PORT_ULONG, &port, 4, &dwOutput, 4, &dwRead, NULL); 11 | // return dwOutput; 12 | // } 13 | // VOID WritePort(HANDLE hDevice,DWORD port,DWORD value) 14 | // { 15 | // PVOID buffer[2]; 16 | // buffer[0] = (PVOID)port; 17 | // buffer[1] = (PVOID)value; 18 | // DWORD dwWrite; 19 | // DeviceIoControl(hDevice, IOCTL_WRITE_PORT_ULONG, &port, 8, NULL, 0, &dwWrite, NULL); 20 | // } 21 | // VOID TestDriver(HANDLE hDevice) 22 | // { 23 | // DWORD dwOutput; 24 | // DeviceIoControl(hDevice, IOCTL_TEST, NULL, 0, NULL, 0, &dwOutput, NULL); 25 | // } 26 | 27 | -------------------------------------------------------------------------------- /chapter07/IOCTL_Test/Test/function.h: -------------------------------------------------------------------------------- 1 | #ifndef FUNCTION_H 2 | #define FUNCTION_H 3 | 4 | //#include "../MyDriver/Ioctls.h" 5 | 6 | DWORD ReadPort(HANDLE hDevice,DWORD port); 7 | VOID WritePort(HANDLE hDevice,DWORD port,DWORD value); 8 | VOID TestDriver(HANDLE hDevice); 9 | #endif -------------------------------------------------------------------------------- /chapter07/IOCTL_Test/Test/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter07/IOCTL_Test/Test/main.cpp -------------------------------------------------------------------------------- /chapter07/MDL_Test/NT_Driver.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=".\NT_Driver\DriverDev.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "Test"=".\Test\Test.dsp" - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | Begin Project Dependency 27 | Project_Dep_Name DriverDev 28 | End Project Dependency 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /chapter07/MDL_Test/NT_Driver/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter07/MDL_Test/NT_Driver/Driver.cpp -------------------------------------------------------------------------------- /chapter07/MDL_Test/NT_Driver/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter07/MDL_Test/NT_Driver/Driver.h -------------------------------------------------------------------------------- /chapter07/MDL_Test/Test/function.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "function.h" 5 | 6 | // DWORD ReadPort(HANDLE hDevice,DWORD port) 7 | // { 8 | // DWORD dwOutput; 9 | // DWORD dwRead; 10 | // DeviceIoControl(hDevice, IOCTL_READ_PORT_ULONG, &port, 4, &dwOutput, 4, &dwRead, NULL); 11 | // return dwOutput; 12 | // } 13 | // VOID WritePort(HANDLE hDevice,DWORD port,DWORD value) 14 | // { 15 | // PVOID buffer[2]; 16 | // buffer[0] = (PVOID)port; 17 | // buffer[1] = (PVOID)value; 18 | // DWORD dwWrite; 19 | // DeviceIoControl(hDevice, IOCTL_WRITE_PORT_ULONG, &port, 8, NULL, 0, &dwWrite, NULL); 20 | // } 21 | // VOID TestDriver(HANDLE hDevice) 22 | // { 23 | // DWORD dwOutput; 24 | // DeviceIoControl(hDevice, IOCTL_TEST, NULL, 0, NULL, 0, &dwOutput, NULL); 25 | // } 26 | 27 | -------------------------------------------------------------------------------- /chapter07/MDL_Test/Test/function.h: -------------------------------------------------------------------------------- 1 | #ifndef FUNCTION_H 2 | #define FUNCTION_H 3 | 4 | //#include "../MyDriver/Ioctls.h" 5 | 6 | DWORD ReadPort(HANDLE hDevice,DWORD port); 7 | VOID WritePort(HANDLE hDevice,DWORD port,DWORD value); 8 | VOID TestDriver(HANDLE hDevice); 9 | #endif -------------------------------------------------------------------------------- /chapter07/MDL_Test/Test/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #define GetFilePointer(hFile) SetFilePointer(hFile, 0, NULL, FILE_CURRENT) 5 | 6 | int main() 7 | { 8 | HANDLE hDevice = 9 | CreateFile("\\\\.\\HelloDDK", 10 | GENERIC_READ | GENERIC_WRITE, 11 | 0, // share mode none 12 | NULL, // no security 13 | OPEN_EXISTING, 14 | FILE_ATTRIBUTE_NORMAL, 15 | NULL ); // no template 16 | 17 | if (hDevice == INVALID_HANDLE_VALUE) 18 | { 19 | printf("Failed to obtain file handle to device: " 20 | "%s with Win32 error code: %d\n", 21 | "MyWDMDevice", GetLastError() ); 22 | return 1; 23 | } 24 | 25 | UCHAR buffer[10]; 26 | memset(buffer,0xBB,10); 27 | ULONG ulRead; 28 | BOOL bRet; 29 | bRet = ReadFile(hDevice,buffer,10,&ulRead,NULL); 30 | if (bRet) 31 | { 32 | printf("Address 0X%08X\n",buffer); 33 | printf("(Read %d bytes):",ulRead); 34 | for (int i=0;i<(int)ulRead;i++) 35 | { 36 | printf("%02X ",buffer[i]); 37 | } 38 | 39 | printf("\n"); 40 | } 41 | 42 | CloseHandle(hDevice); 43 | 44 | return 0; 45 | } -------------------------------------------------------------------------------- /chapter07/Neither_Device_Test/NT_Driver.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=".\NT_Driver\DriverDev.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "Test"=".\Test\Test.dsp" - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | Begin Project Dependency 27 | Project_Dep_Name DriverDev 28 | End Project Dependency 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /chapter07/Neither_Device_Test/NT_Driver/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter07/Neither_Device_Test/NT_Driver/Driver.cpp -------------------------------------------------------------------------------- /chapter07/Neither_Device_Test/NT_Driver/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter07/Neither_Device_Test/NT_Driver/Driver.h -------------------------------------------------------------------------------- /chapter07/Neither_Device_Test/Test/function.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "function.h" 5 | 6 | // DWORD ReadPort(HANDLE hDevice,DWORD port) 7 | // { 8 | // DWORD dwOutput; 9 | // DWORD dwRead; 10 | // DeviceIoControl(hDevice, IOCTL_READ_PORT_ULONG, &port, 4, &dwOutput, 4, &dwRead, NULL); 11 | // return dwOutput; 12 | // } 13 | // VOID WritePort(HANDLE hDevice,DWORD port,DWORD value) 14 | // { 15 | // PVOID buffer[2]; 16 | // buffer[0] = (PVOID)port; 17 | // buffer[1] = (PVOID)value; 18 | // DWORD dwWrite; 19 | // DeviceIoControl(hDevice, IOCTL_WRITE_PORT_ULONG, &port, 8, NULL, 0, &dwWrite, NULL); 20 | // } 21 | // VOID TestDriver(HANDLE hDevice) 22 | // { 23 | // DWORD dwOutput; 24 | // DeviceIoControl(hDevice, IOCTL_TEST, NULL, 0, NULL, 0, &dwOutput, NULL); 25 | // } 26 | 27 | -------------------------------------------------------------------------------- /chapter07/Neither_Device_Test/Test/function.h: -------------------------------------------------------------------------------- 1 | #ifndef FUNCTION_H 2 | #define FUNCTION_H 3 | 4 | //#include "../MyDriver/Ioctls.h" 5 | 6 | DWORD ReadPort(HANDLE hDevice,DWORD port); 7 | VOID WritePort(HANDLE hDevice,DWORD port,DWORD value); 8 | VOID TestDriver(HANDLE hDevice); 9 | #endif -------------------------------------------------------------------------------- /chapter07/Neither_Device_Test/Test/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #define GetFilePointer(hFile) SetFilePointer(hFile, 0, NULL, FILE_CURRENT) 5 | 6 | int main() 7 | { 8 | HANDLE hDevice = 9 | CreateFile("\\\\.\\HelloDDK", 10 | GENERIC_READ | GENERIC_WRITE, 11 | 0, // share mode none 12 | NULL, // no security 13 | OPEN_EXISTING, 14 | FILE_ATTRIBUTE_NORMAL, 15 | NULL ); // no template 16 | 17 | if (hDevice == INVALID_HANDLE_VALUE) 18 | { 19 | printf("Failed to obtain file handle to device: " 20 | "%s with Win32 error code: %d\n", 21 | "MyWDMDevice", GetLastError() ); 22 | return 1; 23 | } 24 | 25 | UCHAR buffer[10]; 26 | ULONG ulRead; 27 | BOOL bRet; 28 | 29 | bRet = ReadFile(hDevice,buffer,10,&ulRead,NULL); 30 | if (bRet) 31 | { 32 | printf("Read %d bytes:",ulRead); 33 | for (int i=0;i<(int)ulRead;i++) 34 | { 35 | printf("%02X ",buffer[i]); 36 | } 37 | 38 | printf("\n"); 39 | } 40 | 41 | CloseHandle(hDevice); 42 | 43 | return 0; 44 | } -------------------------------------------------------------------------------- /chapter07/ReadTest/NT_Driver.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=".\NT_Driver\DriverDev.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "Test"=".\Test\Test.dsp" - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | Begin Project Dependency 27 | Project_Dep_Name DriverDev 28 | End Project Dependency 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /chapter07/ReadTest/NT_Driver/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter07/ReadTest/NT_Driver/Driver.cpp -------------------------------------------------------------------------------- /chapter07/ReadTest/NT_Driver/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter07/ReadTest/NT_Driver/Driver.h -------------------------------------------------------------------------------- /chapter07/ReadTest/Test/function.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "function.h" 5 | 6 | // DWORD ReadPort(HANDLE hDevice,DWORD port) 7 | // { 8 | // DWORD dwOutput; 9 | // DWORD dwRead; 10 | // DeviceIoControl(hDevice, IOCTL_READ_PORT_ULONG, &port, 4, &dwOutput, 4, &dwRead, NULL); 11 | // return dwOutput; 12 | // } 13 | // VOID WritePort(HANDLE hDevice,DWORD port,DWORD value) 14 | // { 15 | // PVOID buffer[2]; 16 | // buffer[0] = (PVOID)port; 17 | // buffer[1] = (PVOID)value; 18 | // DWORD dwWrite; 19 | // DeviceIoControl(hDevice, IOCTL_WRITE_PORT_ULONG, &port, 8, NULL, 0, &dwWrite, NULL); 20 | // } 21 | // VOID TestDriver(HANDLE hDevice) 22 | // { 23 | // DWORD dwOutput; 24 | // DeviceIoControl(hDevice, IOCTL_TEST, NULL, 0, NULL, 0, &dwOutput, NULL); 25 | // } 26 | 27 | -------------------------------------------------------------------------------- /chapter07/ReadTest/Test/function.h: -------------------------------------------------------------------------------- 1 | #ifndef FUNCTION_H 2 | #define FUNCTION_H 3 | 4 | //#include "../MyDriver/Ioctls.h" 5 | 6 | DWORD ReadPort(HANDLE hDevice,DWORD port); 7 | VOID WritePort(HANDLE hDevice,DWORD port,DWORD value); 8 | VOID TestDriver(HANDLE hDevice); 9 | #endif -------------------------------------------------------------------------------- /chapter07/ReadTest/Test/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | HANDLE hDevice = 7 | CreateFile("\\\\.\\HelloDDK", 8 | GENERIC_READ | GENERIC_WRITE, 9 | 0, // share mode none 10 | NULL, // no security 11 | OPEN_EXISTING, 12 | FILE_ATTRIBUTE_NORMAL, 13 | NULL ); // no template 14 | 15 | if (hDevice == INVALID_HANDLE_VALUE) 16 | { 17 | printf("Failed to obtain file handle to device: " 18 | "%s with Win32 error code: %d\n", 19 | "MyWDMDevice", GetLastError() ); 20 | return 1; 21 | } 22 | 23 | UCHAR buffer[10]; 24 | ULONG ulRead; 25 | BOOL bRet = ReadFile(hDevice,buffer,10,&ulRead,NULL); 26 | if (bRet) 27 | { 28 | printf("Read %d bytes:",ulRead); 29 | for (int i=0;i<(int)ulRead;i++) 30 | { 31 | printf("%02X ",buffer[i]); 32 | } 33 | 34 | printf("\n"); 35 | } 36 | 37 | CloseHandle(hDevice); 38 | return 0; 39 | } -------------------------------------------------------------------------------- /chapter07/SimulateFile/NT_Driver.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=".\NT_Driver\DriverDev.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "Test"=".\Test\Test.dsp" - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | Begin Project Dependency 27 | Project_Dep_Name DriverDev 28 | End Project Dependency 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /chapter07/SimulateFile/NT_Driver/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter07/SimulateFile/NT_Driver/Driver.cpp -------------------------------------------------------------------------------- /chapter07/SimulateFile/NT_Driver/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter07/SimulateFile/NT_Driver/Driver.h -------------------------------------------------------------------------------- /chapter07/SimulateFile/Test/function.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "function.h" 5 | 6 | // DWORD ReadPort(HANDLE hDevice,DWORD port) 7 | // { 8 | // DWORD dwOutput; 9 | // DWORD dwRead; 10 | // DeviceIoControl(hDevice, IOCTL_READ_PORT_ULONG, &port, 4, &dwOutput, 4, &dwRead, NULL); 11 | // return dwOutput; 12 | // } 13 | // VOID WritePort(HANDLE hDevice,DWORD port,DWORD value) 14 | // { 15 | // PVOID buffer[2]; 16 | // buffer[0] = (PVOID)port; 17 | // buffer[1] = (PVOID)value; 18 | // DWORD dwWrite; 19 | // DeviceIoControl(hDevice, IOCTL_WRITE_PORT_ULONG, &port, 8, NULL, 0, &dwWrite, NULL); 20 | // } 21 | // VOID TestDriver(HANDLE hDevice) 22 | // { 23 | // DWORD dwOutput; 24 | // DeviceIoControl(hDevice, IOCTL_TEST, NULL, 0, NULL, 0, &dwOutput, NULL); 25 | // } 26 | 27 | -------------------------------------------------------------------------------- /chapter07/SimulateFile/Test/function.h: -------------------------------------------------------------------------------- 1 | #ifndef FUNCTION_H 2 | #define FUNCTION_H 3 | 4 | //#include "../MyDriver/Ioctls.h" 5 | 6 | DWORD ReadPort(HANDLE hDevice,DWORD port); 7 | VOID WritePort(HANDLE hDevice,DWORD port,DWORD value); 8 | VOID TestDriver(HANDLE hDevice); 9 | #endif -------------------------------------------------------------------------------- /chapter07/SimulateFile/Test/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #define GetFilePointer(hFile) SetFilePointer(hFile, 0, NULL, FILE_CURRENT) 5 | 6 | int main() 7 | { 8 | HANDLE hDevice = 9 | CreateFile("\\\\.\\HelloDDK", 10 | GENERIC_READ | GENERIC_WRITE, 11 | 0, // share mode none 12 | NULL, // no security 13 | OPEN_EXISTING, 14 | FILE_ATTRIBUTE_NORMAL, 15 | NULL ); // no template 16 | 17 | if (hDevice == INVALID_HANDLE_VALUE) 18 | { 19 | printf("Failed to obtain file handle to device: " 20 | "%s with Win32 error code: %d\n", 21 | "MyWDMDevice", GetLastError() ); 22 | return 1; 23 | } 24 | 25 | UCHAR buffer[10]; 26 | memset(buffer,0xBB,10); 27 | ULONG ulRead; 28 | ULONG ulWrite; 29 | BOOL bRet; 30 | bRet = WriteFile(hDevice,buffer,10,&ulWrite,NULL); 31 | if (bRet) 32 | { 33 | printf("Write %d bytes\n",ulWrite); 34 | } 35 | 36 | bRet = ReadFile(hDevice,buffer,10,&ulRead,NULL); 37 | if (bRet) 38 | { 39 | printf("Read %d bytes:",ulRead); 40 | for (int i=0;i<(int)ulRead;i++) 41 | { 42 | printf("%02X ",buffer[i]); 43 | } 44 | 45 | printf("\n"); 46 | } 47 | 48 | printf("file length:%d\n",GetFileSize(hDevice,NULL)); 49 | 50 | CloseHandle(hDevice); 51 | 52 | return 0; 53 | } -------------------------------------------------------------------------------- /chapter09/AsyncOperate1/Test/Test.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "Test"=".\Test.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /chapter09/AsyncOperate1/Test/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter09/AsyncOperate1/Test/main.cpp -------------------------------------------------------------------------------- /chapter09/AsyncOperate2/Test/Debug/test.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter09/AsyncOperate2/Test/Debug/test.dat -------------------------------------------------------------------------------- /chapter09/AsyncOperate2/Test/Test.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "Test"=".\Test.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /chapter09/AsyncOperate2/Test/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter09/AsyncOperate2/Test/main.cpp -------------------------------------------------------------------------------- /chapter09/AsyncOperate2/Test/test.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter09/AsyncOperate2/Test/test.dat -------------------------------------------------------------------------------- /chapter09/CancelIRPTest/NT_Driver.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=".\NT_Driver\DriverDev.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "Test"=".\Test\Test.dsp" - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | Begin Project Dependency 27 | Project_Dep_Name DriverDev 28 | End Project Dependency 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /chapter09/CancelIRPTest/NT_Driver/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter09/CancelIRPTest/NT_Driver/Driver.cpp -------------------------------------------------------------------------------- /chapter09/CancelIRPTest/NT_Driver/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter09/CancelIRPTest/NT_Driver/Driver.h -------------------------------------------------------------------------------- /chapter09/CancelIRPTest/Test/function.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "function.h" 5 | 6 | // DWORD ReadPort(HANDLE hDevice,DWORD port) 7 | // { 8 | // DWORD dwOutput; 9 | // DWORD dwRead; 10 | // DeviceIoControl(hDevice, IOCTL_READ_PORT_ULONG, &port, 4, &dwOutput, 4, &dwRead, NULL); 11 | // return dwOutput; 12 | // } 13 | // VOID WritePort(HANDLE hDevice,DWORD port,DWORD value) 14 | // { 15 | // PVOID buffer[2]; 16 | // buffer[0] = (PVOID)port; 17 | // buffer[1] = (PVOID)value; 18 | // DWORD dwWrite; 19 | // DeviceIoControl(hDevice, IOCTL_WRITE_PORT_ULONG, &port, 8, NULL, 0, &dwWrite, NULL); 20 | // } 21 | // VOID TestDriver(HANDLE hDevice) 22 | // { 23 | // DWORD dwOutput; 24 | // DeviceIoControl(hDevice, IOCTL_TEST, NULL, 0, NULL, 0, &dwOutput, NULL); 25 | // } 26 | 27 | -------------------------------------------------------------------------------- /chapter09/CancelIRPTest/Test/function.h: -------------------------------------------------------------------------------- 1 | #ifndef FUNCTION_H 2 | #define FUNCTION_H 3 | 4 | //#include "../MyDriver/Ioctls.h" 5 | 6 | DWORD ReadPort(HANDLE hDevice,DWORD port); 7 | VOID WritePort(HANDLE hDevice,DWORD port,DWORD value); 8 | VOID TestDriver(HANDLE hDevice); 9 | #endif -------------------------------------------------------------------------------- /chapter09/CancelIRPTest/Test/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter09/CancelIRPTest/Test/main.cpp -------------------------------------------------------------------------------- /chapter09/PendingIRPTest/NT_Driver.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=".\NT_Driver\DriverDev.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "Test"=".\Test\Test.dsp" - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | Begin Project Dependency 27 | Project_Dep_Name DriverDev 28 | End Project Dependency 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /chapter09/PendingIRPTest/NT_Driver/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter09/PendingIRPTest/NT_Driver/Driver.cpp -------------------------------------------------------------------------------- /chapter09/PendingIRPTest/NT_Driver/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter09/PendingIRPTest/NT_Driver/Driver.h -------------------------------------------------------------------------------- /chapter09/PendingIRPTest/Test/function.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "function.h" 5 | 6 | // DWORD ReadPort(HANDLE hDevice,DWORD port) 7 | // { 8 | // DWORD dwOutput; 9 | // DWORD dwRead; 10 | // DeviceIoControl(hDevice, IOCTL_READ_PORT_ULONG, &port, 4, &dwOutput, 4, &dwRead, NULL); 11 | // return dwOutput; 12 | // } 13 | // VOID WritePort(HANDLE hDevice,DWORD port,DWORD value) 14 | // { 15 | // PVOID buffer[2]; 16 | // buffer[0] = (PVOID)port; 17 | // buffer[1] = (PVOID)value; 18 | // DWORD dwWrite; 19 | // DeviceIoControl(hDevice, IOCTL_WRITE_PORT_ULONG, &port, 8, NULL, 0, &dwWrite, NULL); 20 | // } 21 | // VOID TestDriver(HANDLE hDevice) 22 | // { 23 | // DWORD dwOutput; 24 | // DeviceIoControl(hDevice, IOCTL_TEST, NULL, 0, NULL, 0, &dwOutput, NULL); 25 | // } 26 | 27 | -------------------------------------------------------------------------------- /chapter09/PendingIRPTest/Test/function.h: -------------------------------------------------------------------------------- 1 | #ifndef FUNCTION_H 2 | #define FUNCTION_H 3 | 4 | //#include "../MyDriver/Ioctls.h" 5 | 6 | DWORD ReadPort(HANDLE hDevice,DWORD port); 7 | VOID WritePort(HANDLE hDevice,DWORD port,DWORD value); 8 | VOID TestDriver(HANDLE hDevice); 9 | #endif -------------------------------------------------------------------------------- /chapter09/PendingIRPTest/Test/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter09/PendingIRPTest/Test/main.cpp -------------------------------------------------------------------------------- /chapter09/SpecialStartIOTest/NT_Driver.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=".\NT_Driver\DriverDev.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "Test"=".\Test\Test.dsp" - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | Begin Project Dependency 27 | Project_Dep_Name DriverDev 28 | End Project Dependency 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /chapter09/SpecialStartIOTest/NT_Driver/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter09/SpecialStartIOTest/NT_Driver/Driver.cpp -------------------------------------------------------------------------------- /chapter09/SpecialStartIOTest/NT_Driver/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter09/SpecialStartIOTest/NT_Driver/Driver.h -------------------------------------------------------------------------------- /chapter09/SpecialStartIOTest/Test/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter09/SpecialStartIOTest/Test/main.cpp -------------------------------------------------------------------------------- /chapter09/StartIOTest/NT_Driver.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=".\NT_Driver\DriverDev.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "Test"=".\Test\Test.dsp" - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | Begin Project Dependency 27 | Project_Dep_Name DriverDev 28 | End Project Dependency 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /chapter09/StartIOTest/NT_Driver/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter09/StartIOTest/NT_Driver/Driver.cpp -------------------------------------------------------------------------------- /chapter09/StartIOTest/NT_Driver/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter09/StartIOTest/NT_Driver/Driver.h -------------------------------------------------------------------------------- /chapter09/StartIOTest/Test/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter09/StartIOTest/Test/main.cpp -------------------------------------------------------------------------------- /chapter09/SyncOperate/Test/Test.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "Test"=".\Test.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /chapter09/SyncOperate/Test/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter09/SyncOperate/Test/main.cpp -------------------------------------------------------------------------------- /chapter10/DPCTimer_Test/NT_Driver.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=".\NT_Driver\DriverDev.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "Test"=".\Test\Test.dsp" - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | Begin Project Dependency 27 | Project_Dep_Name DriverDev 28 | End Project Dependency 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /chapter10/DPCTimer_Test/NT_Driver/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter10/DPCTimer_Test/NT_Driver/Driver.cpp -------------------------------------------------------------------------------- /chapter10/DPCTimer_Test/NT_Driver/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter10/DPCTimer_Test/NT_Driver/Driver.h -------------------------------------------------------------------------------- /chapter10/DPCTimer_Test/NT_Driver/Ioctls.h: -------------------------------------------------------------------------------- 1 | // IOCTLS.H -- IOCTL code definitions for fileio driver 2 | // Copyright (C) 1999 by Walter Oney 3 | // All rights reserved 4 | 5 | #ifndef IOCTLS_H 6 | #define IOCTLS_H 7 | 8 | #ifndef CTL_CODE 9 | #pragma message("CTL_CODE undefined. Include winioctl.h or wdm.h") 10 | #endif 11 | 12 | #define IOCTL_START_TIMER CTL_CODE(\ 13 | FILE_DEVICE_UNKNOWN, \ 14 | 0x800, \ 15 | METHOD_BUFFERED, \ 16 | FILE_ANY_ACCESS) 17 | 18 | #define IOCTL_STOP_TIMER CTL_CODE(\ 19 | FILE_DEVICE_UNKNOWN, \ 20 | 0x801, \ 21 | METHOD_IN_DIRECT, \ 22 | FILE_ANY_ACCESS) 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /chapter10/DPCTimer_Test/Test/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter10/DPCTimer_Test/Test/main.cpp -------------------------------------------------------------------------------- /chapter10/IRPTimeout_Test/NT_Driver.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=".\NT_Driver\DriverDev.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "Test"=".\Test\Test.dsp" - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | Begin Project Dependency 27 | Project_Dep_Name DriverDev 28 | End Project Dependency 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /chapter10/IRPTimeout_Test/NT_Driver/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter10/IRPTimeout_Test/NT_Driver/Driver.cpp -------------------------------------------------------------------------------- /chapter10/IRPTimeout_Test/NT_Driver/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter10/IRPTimeout_Test/NT_Driver/Driver.h -------------------------------------------------------------------------------- /chapter10/IRPTimeout_Test/Test/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter10/IRPTimeout_Test/Test/main.cpp -------------------------------------------------------------------------------- /chapter10/IoTimer_Test/NT_Driver.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=".\NT_Driver\DriverDev.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "Test"=".\Test\Test.dsp" - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | Begin Project Dependency 27 | Project_Dep_Name DriverDev 28 | End Project Dependency 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /chapter10/IoTimer_Test/NT_Driver/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter10/IoTimer_Test/NT_Driver/Driver.cpp -------------------------------------------------------------------------------- /chapter10/IoTimer_Test/NT_Driver/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter10/IoTimer_Test/NT_Driver/Driver.h -------------------------------------------------------------------------------- /chapter10/IoTimer_Test/NT_Driver/Ioctls.h: -------------------------------------------------------------------------------- 1 | // IOCTLS.H -- IOCTL code definitions for fileio driver 2 | // Copyright (C) 1999 by Walter Oney 3 | // All rights reserved 4 | 5 | #ifndef IOCTLS_H 6 | #define IOCTLS_H 7 | 8 | #ifndef CTL_CODE 9 | #pragma message("CTL_CODE undefined. Include winioctl.h or wdm.h") 10 | #endif 11 | 12 | #define IOCTL_START_TIMER CTL_CODE(\ 13 | FILE_DEVICE_UNKNOWN, \ 14 | 0x800, \ 15 | METHOD_BUFFERED, \ 16 | FILE_ANY_ACCESS) 17 | 18 | #define IOCTL_STOP CTL_CODE(\ 19 | FILE_DEVICE_UNKNOWN, \ 20 | 0x801, \ 21 | METHOD_IN_DIRECT, \ 22 | FILE_ANY_ACCESS) 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /chapter10/IoTimer_Test/Test/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter10/IoTimer_Test/Test/main.cpp -------------------------------------------------------------------------------- /chapter10/Time_Test/NT_Driver.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=".\NT_Driver\DriverDev.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "Test"=".\Test\Test.dsp" - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | Begin Project Dependency 27 | Project_Dep_Name DriverDev 28 | End Project Dependency 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /chapter10/Time_Test/NT_Driver/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter10/Time_Test/NT_Driver/Driver.cpp -------------------------------------------------------------------------------- /chapter10/Time_Test/NT_Driver/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter10/Time_Test/NT_Driver/Driver.h -------------------------------------------------------------------------------- /chapter10/Time_Test/NT_Driver/Ioctls.h: -------------------------------------------------------------------------------- 1 | // IOCTLS.H -- IOCTL code definitions for fileio driver 2 | // Copyright (C) 1999 by Walter Oney 3 | // All rights reserved 4 | 5 | #ifndef IOCTLS_H 6 | #define IOCTLS_H 7 | 8 | #ifndef CTL_CODE 9 | #pragma message("CTL_CODE undefined. Include winioctl.h or wdm.h") 10 | #endif 11 | 12 | #define IOCTL_TIME_TEST CTL_CODE(\ 13 | FILE_DEVICE_UNKNOWN, \ 14 | 0x800, \ 15 | METHOD_BUFFERED, \ 16 | FILE_ANY_ACCESS) 17 | #endif 18 | -------------------------------------------------------------------------------- /chapter10/Time_Test/Test/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter10/Time_Test/Test/main.cpp -------------------------------------------------------------------------------- /chapter10/Waiting_Test/NT_Driver.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=".\NT_Driver\DriverDev.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "Test"=".\Test\Test.dsp" - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | Begin Project Dependency 27 | Project_Dep_Name DriverDev 28 | End Project Dependency 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /chapter10/Waiting_Test/NT_Driver/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter10/Waiting_Test/NT_Driver/Driver.cpp -------------------------------------------------------------------------------- /chapter10/Waiting_Test/NT_Driver/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter10/Waiting_Test/NT_Driver/Driver.h -------------------------------------------------------------------------------- /chapter10/Waiting_Test/NT_Driver/Ioctls.h: -------------------------------------------------------------------------------- 1 | // IOCTLS.H -- IOCTL code definitions for fileio driver 2 | // Copyright (C) 1999 by Walter Oney 3 | // All rights reserved 4 | 5 | #ifndef IOCTLS_H 6 | #define IOCTLS_H 7 | 8 | #ifndef CTL_CODE 9 | #pragma message("CTL_CODE undefined. Include winioctl.h or wdm.h") 10 | #endif 11 | 12 | #define IOCTL_WAIT_METHOD1 CTL_CODE(\ 13 | FILE_DEVICE_UNKNOWN, \ 14 | 0x800, \ 15 | METHOD_BUFFERED, \ 16 | FILE_ANY_ACCESS) 17 | 18 | #define IOCTL_WAIT_METHOD2 CTL_CODE(\ 19 | FILE_DEVICE_UNKNOWN, \ 20 | 0x801, \ 21 | METHOD_BUFFERED, \ 22 | FILE_ANY_ACCESS) 23 | 24 | #define IOCTL_WAIT_METHOD3 CTL_CODE(\ 25 | FILE_DEVICE_UNKNOWN, \ 26 | 0x802, \ 27 | METHOD_BUFFERED, \ 28 | FILE_ANY_ACCESS) 29 | 30 | #define IOCTL_WAIT_METHOD4 CTL_CODE(\ 31 | FILE_DEVICE_UNKNOWN, \ 32 | 0x803, \ 33 | METHOD_BUFFERED, \ 34 | FILE_ANY_ACCESS) 35 | #endif 36 | -------------------------------------------------------------------------------- /chapter10/Waiting_Test/Test/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter10/Waiting_Test/Test/main.cpp -------------------------------------------------------------------------------- /chapter11/Test1/DriverDevA/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter11/Test1/DriverDevA/Driver.cpp -------------------------------------------------------------------------------- /chapter11/Test1/DriverDevA/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter11/Test1/DriverDevA/Driver.h -------------------------------------------------------------------------------- /chapter11/Test1/DriverDevB/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter11/Test1/DriverDevB/Driver.cpp -------------------------------------------------------------------------------- /chapter11/Test1/DriverDevB/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter11/Test1/DriverDevB/Driver.h -------------------------------------------------------------------------------- /chapter11/Test1/Test/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | 7 | HANDLE hDevice = 8 | CreateFile("\\\\.\\HelloDDKB", 9 | GENERIC_READ | GENERIC_WRITE, 10 | 0, // share mode none 11 | NULL, // no security 12 | OPEN_EXISTING, 13 | FILE_ATTRIBUTE_NORMAL, 14 | NULL ); // no template 15 | 16 | if (hDevice == INVALID_HANDLE_VALUE) 17 | { 18 | printf("Failed to obtain file handle to device " 19 | "with Win32 error code: %d\n", 20 | GetLastError() ); 21 | return 1; 22 | } 23 | 24 | DWORD dRet; 25 | ReadFile(hDevice,NULL,0,&dRet,NULL); 26 | 27 | CloseHandle(hDevice); 28 | 29 | return 0; 30 | } -------------------------------------------------------------------------------- /chapter11/Test2/DriverDevA/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter11/Test2/DriverDevA/Driver.cpp -------------------------------------------------------------------------------- /chapter11/Test2/DriverDevA/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter11/Test2/DriverDevA/Driver.h -------------------------------------------------------------------------------- /chapter11/Test2/DriverDevB/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter11/Test2/DriverDevB/Driver.cpp -------------------------------------------------------------------------------- /chapter11/Test2/DriverDevB/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter11/Test2/DriverDevB/Driver.h -------------------------------------------------------------------------------- /chapter11/Test2/Test/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | 7 | HANDLE hDevice = 8 | CreateFile("\\\\.\\HelloDDKB", 9 | GENERIC_READ | GENERIC_WRITE, 10 | 0, // share mode none 11 | NULL, // no security 12 | OPEN_EXISTING, 13 | FILE_ATTRIBUTE_NORMAL, 14 | NULL ); // no template 15 | 16 | if (hDevice == INVALID_HANDLE_VALUE) 17 | { 18 | printf("Failed to obtain file handle to device " 19 | "with Win32 error code: %d\n", 20 | GetLastError() ); 21 | return 1; 22 | } 23 | 24 | DWORD dRet; 25 | ReadFile(hDevice,NULL,0,&dRet,NULL); 26 | 27 | CloseHandle(hDevice); 28 | 29 | return 0; 30 | } -------------------------------------------------------------------------------- /chapter11/Test3/DriverDevA/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter11/Test3/DriverDevA/Driver.cpp -------------------------------------------------------------------------------- /chapter11/Test3/DriverDevA/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter11/Test3/DriverDevA/Driver.h -------------------------------------------------------------------------------- /chapter11/Test3/DriverDevB/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter11/Test3/DriverDevB/Driver.cpp -------------------------------------------------------------------------------- /chapter11/Test3/DriverDevB/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter11/Test3/DriverDevB/Driver.h -------------------------------------------------------------------------------- /chapter11/Test3/Test/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | 7 | HANDLE hDevice = 8 | CreateFile("\\\\.\\HelloDDKB", 9 | GENERIC_READ | GENERIC_WRITE, 10 | 0, // share mode none 11 | NULL, // no security 12 | OPEN_EXISTING, 13 | FILE_ATTRIBUTE_NORMAL, 14 | NULL ); // no template 15 | 16 | if (hDevice == INVALID_HANDLE_VALUE) 17 | { 18 | printf("Failed to obtain file handle to device " 19 | "with Win32 error code: %d\n", 20 | GetLastError() ); 21 | return 1; 22 | } 23 | 24 | DWORD dRet; 25 | ReadFile(hDevice,NULL,0,&dRet,NULL); 26 | 27 | CloseHandle(hDevice); 28 | 29 | return 0; 30 | } -------------------------------------------------------------------------------- /chapter11/Test4/DriverDevA/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter11/Test4/DriverDevA/Driver.cpp -------------------------------------------------------------------------------- /chapter11/Test4/DriverDevA/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter11/Test4/DriverDevA/Driver.h -------------------------------------------------------------------------------- /chapter11/Test4/DriverDevB/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter11/Test4/DriverDevB/Driver.cpp -------------------------------------------------------------------------------- /chapter11/Test4/DriverDevB/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter11/Test4/DriverDevB/Driver.h -------------------------------------------------------------------------------- /chapter11/Test4/Test/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | 7 | HANDLE hDevice = 8 | CreateFile("\\\\.\\HelloDDKB", 9 | GENERIC_READ | GENERIC_WRITE, 10 | 0, // share mode none 11 | NULL, // no security 12 | OPEN_EXISTING, 13 | FILE_ATTRIBUTE_NORMAL, 14 | NULL ); // no template 15 | 16 | if (hDevice == INVALID_HANDLE_VALUE) 17 | { 18 | printf("Failed to obtain file handle to device " 19 | "with Win32 error code: %d\n", 20 | GetLastError() ); 21 | return 1; 22 | } 23 | 24 | DWORD dRet; 25 | ReadFile(hDevice,NULL,0,&dRet,NULL); 26 | 27 | CloseHandle(hDevice); 28 | 29 | return 0; 30 | } -------------------------------------------------------------------------------- /chapter11/Test5/DriverDevA/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter11/Test5/DriverDevA/Driver.cpp -------------------------------------------------------------------------------- /chapter11/Test5/DriverDevA/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter11/Test5/DriverDevA/Driver.h -------------------------------------------------------------------------------- /chapter11/Test5/DriverDevB/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter11/Test5/DriverDevB/Driver.cpp -------------------------------------------------------------------------------- /chapter11/Test5/DriverDevB/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter11/Test5/DriverDevB/Driver.h -------------------------------------------------------------------------------- /chapter11/Test5/Test/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | 7 | HANDLE hDevice = 8 | CreateFile("\\\\.\\HelloDDKB", 9 | GENERIC_READ | GENERIC_WRITE, 10 | 0, // share mode none 11 | NULL, // no security 12 | OPEN_EXISTING, 13 | FILE_ATTRIBUTE_NORMAL, 14 | NULL ); // no template 15 | 16 | if (hDevice == INVALID_HANDLE_VALUE) 17 | { 18 | printf("Failed to obtain file handle to device " 19 | "with Win32 error code: %d\n", 20 | GetLastError() ); 21 | return 1; 22 | } 23 | 24 | DWORD dRet; 25 | ReadFile(hDevice,NULL,0,&dRet,NULL); 26 | 27 | CloseHandle(hDevice); 28 | 29 | return 0; 30 | } -------------------------------------------------------------------------------- /chapter11/Test6/DriverDevA/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter11/Test6/DriverDevA/Driver.cpp -------------------------------------------------------------------------------- /chapter11/Test6/DriverDevA/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter11/Test6/DriverDevA/Driver.h -------------------------------------------------------------------------------- /chapter11/Test6/DriverDevB/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter11/Test6/DriverDevB/Driver.cpp -------------------------------------------------------------------------------- /chapter11/Test6/DriverDevB/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter11/Test6/DriverDevB/Driver.h -------------------------------------------------------------------------------- /chapter11/Test6/Test/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | 7 | HANDLE hDevice = 8 | CreateFile("\\\\.\\HelloDDKB", 9 | GENERIC_READ | GENERIC_WRITE, 10 | 0, // share mode none 11 | NULL, // no security 12 | OPEN_EXISTING, 13 | FILE_ATTRIBUTE_NORMAL, 14 | NULL ); // no template 15 | 16 | if (hDevice == INVALID_HANDLE_VALUE) 17 | { 18 | printf("Failed to obtain file handle to device " 19 | "with Win32 error code: %d\n", 20 | GetLastError() ); 21 | return 1; 22 | } 23 | 24 | DWORD dRet; 25 | ReadFile(hDevice,NULL,0,&dRet,NULL); 26 | 27 | CloseHandle(hDevice); 28 | 29 | return 0; 30 | } -------------------------------------------------------------------------------- /chapter11/Test7/DriverDevA/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter11/Test7/DriverDevA/Driver.cpp -------------------------------------------------------------------------------- /chapter11/Test7/DriverDevA/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter11/Test7/DriverDevA/Driver.h -------------------------------------------------------------------------------- /chapter11/Test7/DriverDevB/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter11/Test7/DriverDevB/Driver.cpp -------------------------------------------------------------------------------- /chapter11/Test7/DriverDevB/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter11/Test7/DriverDevB/Driver.h -------------------------------------------------------------------------------- /chapter11/Test7/Test/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | 7 | HANDLE hDevice = 8 | CreateFile("\\\\.\\HelloDDKB", 9 | GENERIC_READ | GENERIC_WRITE, 10 | 0, // share mode none 11 | NULL, // no security 12 | OPEN_EXISTING, 13 | FILE_ATTRIBUTE_NORMAL, 14 | NULL ); // no template 15 | 16 | if (hDevice == INVALID_HANDLE_VALUE) 17 | { 18 | printf("Failed to obtain file handle to device " 19 | "with Win32 error code: %d\n", 20 | GetLastError() ); 21 | return 1; 22 | } 23 | 24 | DWORD dRet; 25 | ReadFile(hDevice,NULL,0,&dRet,NULL); 26 | 27 | CloseHandle(hDevice); 28 | 29 | return 0; 30 | } -------------------------------------------------------------------------------- /chapter11/Test8/DriverDevA/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter11/Test8/DriverDevA/Driver.cpp -------------------------------------------------------------------------------- /chapter11/Test8/DriverDevA/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter11/Test8/DriverDevA/Driver.h -------------------------------------------------------------------------------- /chapter11/Test8/DriverDevB/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter11/Test8/DriverDevB/Driver.cpp -------------------------------------------------------------------------------- /chapter11/Test8/DriverDevB/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter11/Test8/DriverDevB/Driver.h -------------------------------------------------------------------------------- /chapter11/Test8/Test/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | 7 | HANDLE hDevice = 8 | CreateFile("\\\\.\\HelloDDKB", 9 | GENERIC_READ | GENERIC_WRITE, 10 | 0, // share mode none 11 | NULL, // no security 12 | OPEN_EXISTING, 13 | FILE_ATTRIBUTE_NORMAL, 14 | NULL ); // no template 15 | 16 | if (hDevice == INVALID_HANDLE_VALUE) 17 | { 18 | printf("Failed to obtain file handle to device " 19 | "with Win32 error code: %d\n", 20 | GetLastError() ); 21 | return 1; 22 | } 23 | 24 | DWORD dRet; 25 | ReadFile(hDevice,NULL,0,&dRet,NULL); 26 | 27 | CloseHandle(hDevice); 28 | 29 | return 0; 30 | } -------------------------------------------------------------------------------- /chapter12/Test1/DriverDevA/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter12/Test1/DriverDevA/Driver.cpp -------------------------------------------------------------------------------- /chapter12/Test1/DriverDevA/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter12/Test1/DriverDevA/Driver.h -------------------------------------------------------------------------------- /chapter12/Test1/DriverDevB/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter12/Test1/DriverDevB/Driver.cpp -------------------------------------------------------------------------------- /chapter12/Test1/DriverDevB/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter12/Test1/DriverDevB/Driver.h -------------------------------------------------------------------------------- /chapter12/Test1/Test/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | 7 | HANDLE hDevice = 8 | CreateFile("\\\\.\\HelloDDKA", 9 | GENERIC_READ | GENERIC_WRITE, 10 | 0, // share mode none 11 | NULL, // no security 12 | OPEN_EXISTING, 13 | FILE_ATTRIBUTE_NORMAL, 14 | NULL ); // no template 15 | 16 | if (hDevice == INVALID_HANDLE_VALUE) 17 | { 18 | printf("Failed to obtain file handle to device " 19 | "with Win32 error code: %d\n", 20 | GetLastError() ); 21 | return 1; 22 | } 23 | 24 | DWORD dRet; 25 | ReadFile(hDevice,NULL,0,&dRet,NULL); 26 | 27 | CloseHandle(hDevice); 28 | 29 | return 0; 30 | } -------------------------------------------------------------------------------- /chapter12/Test2/NT_Driver.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=".\NT_Driver\DriverDev.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "Test"=".\Test\Test.dsp" - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | Begin Project Dependency 27 | Project_Dep_Name DriverDev 28 | End Project Dependency 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /chapter12/Test2/NT_Driver/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter12/Test2/NT_Driver/Driver.cpp -------------------------------------------------------------------------------- /chapter12/Test2/NT_Driver/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter12/Test2/NT_Driver/Driver.h -------------------------------------------------------------------------------- /chapter12/Test2/NT_Driver/Ioctls.h: -------------------------------------------------------------------------------- 1 | // IOCTLS.H -- IOCTL code definitions for fileio driver 2 | // Copyright (C) 1999 by Walter Oney 3 | // All rights reserved 4 | 5 | #ifndef IOCTLS_H 6 | #define IOCTLS_H 7 | 8 | #ifndef CTL_CODE 9 | #pragma message("CTL_CODE undefined. Include winioctl.h or wdm.h") 10 | #endif 11 | 12 | #define IOCTL_DUMP_DEVICE_STACK CTL_CODE(\ 13 | FILE_DEVICE_UNKNOWN, \ 14 | 0x800, \ 15 | METHOD_BUFFERED, \ 16 | FILE_ANY_ACCESS) 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /chapter12/Test2/Test/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter12/Test2/Test/main.cpp -------------------------------------------------------------------------------- /chapter12/Test3/DriverDevA/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter12/Test3/DriverDevA/Driver.cpp -------------------------------------------------------------------------------- /chapter12/Test3/DriverDevA/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter12/Test3/DriverDevA/Driver.h -------------------------------------------------------------------------------- /chapter12/Test3/DriverDevB/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter12/Test3/DriverDevB/Driver.cpp -------------------------------------------------------------------------------- /chapter12/Test3/DriverDevB/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter12/Test3/DriverDevB/Driver.h -------------------------------------------------------------------------------- /chapter12/Test3/Test/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | 7 | HANDLE hDevice = 8 | CreateFile("\\\\.\\HelloDDKA", 9 | GENERIC_READ | GENERIC_WRITE, 10 | 0, // share mode none 11 | NULL, // no security 12 | OPEN_EXISTING, 13 | FILE_ATTRIBUTE_NORMAL, 14 | NULL ); // no template 15 | 16 | if (hDevice == INVALID_HANDLE_VALUE) 17 | { 18 | printf("Failed to obtain file handle to device " 19 | "with Win32 error code: %d\n", 20 | GetLastError() ); 21 | return 1; 22 | } 23 | 24 | DWORD dRet; 25 | ReadFile(hDevice,NULL,0,&dRet,NULL); 26 | 27 | CloseHandle(hDevice); 28 | 29 | return 0; 30 | } -------------------------------------------------------------------------------- /chapter12/Test4/DriverDevA/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter12/Test4/DriverDevA/Driver.cpp -------------------------------------------------------------------------------- /chapter12/Test4/DriverDevA/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter12/Test4/DriverDevA/Driver.h -------------------------------------------------------------------------------- /chapter12/Test4/DriverDevB/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter12/Test4/DriverDevB/Driver.cpp -------------------------------------------------------------------------------- /chapter12/Test4/DriverDevB/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter12/Test4/DriverDevB/Driver.h -------------------------------------------------------------------------------- /chapter12/Test4/Test/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | 7 | HANDLE hDevice = 8 | CreateFile("\\\\.\\HelloDDKA", 9 | GENERIC_READ | GENERIC_WRITE, 10 | 0, // share mode none 11 | NULL, // no security 12 | OPEN_EXISTING, 13 | FILE_ATTRIBUTE_NORMAL, 14 | NULL ); // no template 15 | 16 | if (hDevice == INVALID_HANDLE_VALUE) 17 | { 18 | printf("Failed to obtain file handle to device " 19 | "with Win32 error code: %d\n", 20 | GetLastError() ); 21 | return 1; 22 | } 23 | 24 | DWORD dRet; 25 | ReadFile(hDevice,NULL,0,&dRet,NULL); 26 | 27 | CloseHandle(hDevice); 28 | 29 | return 0; 30 | } -------------------------------------------------------------------------------- /chapter12/Test5/DriverDevA/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter12/Test5/DriverDevA/Driver.cpp -------------------------------------------------------------------------------- /chapter12/Test5/DriverDevA/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter12/Test5/DriverDevA/Driver.h -------------------------------------------------------------------------------- /chapter12/Test5/DriverDevB/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter12/Test5/DriverDevB/Driver.cpp -------------------------------------------------------------------------------- /chapter12/Test5/DriverDevB/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter12/Test5/DriverDevB/Driver.h -------------------------------------------------------------------------------- /chapter12/Test5/Test/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | 7 | HANDLE hDevice = 8 | CreateFile("\\\\.\\HelloDDKA", 9 | GENERIC_READ | GENERIC_WRITE, 10 | 0, // share mode none 11 | NULL, // no security 12 | OPEN_EXISTING, 13 | FILE_ATTRIBUTE_NORMAL, 14 | NULL ); // no template 15 | 16 | if (hDevice == INVALID_HANDLE_VALUE) 17 | { 18 | printf("Failed to obtain file handle to device " 19 | "with Win32 error code: %d\n", 20 | GetLastError() ); 21 | return 1; 22 | } 23 | 24 | const int BUFFER_LENGTH = 1024*4; 25 | UCHAR buffer[BUFFER_LENGTH];//4k 26 | DWORD dRead; 27 | 28 | ReadFile(hDevice,buffer,BUFFER_LENGTH,&dRead,NULL); 29 | 30 | CloseHandle(hDevice); 31 | 32 | return 0; 33 | } -------------------------------------------------------------------------------- /chapter13/Test1/DriverDev.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "MyDriver"=".\MyDriver\MyDriver.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "Test"=".\Test\Test.dsp" - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | Begin Project Dependency 27 | Project_Dep_Name MyDriver 28 | End Project Dependency 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /chapter13/Test1/MyDriver/HelloWDM.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter13/Test1/MyDriver/HelloWDM.cpp -------------------------------------------------------------------------------- /chapter13/Test1/MyDriver/HelloWDM.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter13/Test1/MyDriver/HelloWDM.h -------------------------------------------------------------------------------- /chapter13/Test1/MyDriver/HelloWDM.inf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter13/Test1/MyDriver/HelloWDM.inf -------------------------------------------------------------------------------- /chapter13/Test1/MyDriver/Ioctls.h: -------------------------------------------------------------------------------- 1 | // IOCTLS.H -- IOCTL code definitions for fileio driver 2 | // Copyright (C) 1999 by Walter Oney 3 | // All rights reserved 4 | 5 | #ifndef IOCTLS_H 6 | #define IOCTLS_H 7 | 8 | #ifndef CTL_CODE 9 | #pragma message("CTL_CODE undefined. Include winioctl.h or wdm.h") 10 | #endif 11 | 12 | #define IOCTL_READ_PORT_ULONG CTL_CODE(\ 13 | FILE_DEVICE_UNKNOWN, \ 14 | 0x800, \ 15 | METHOD_BUFFERED, \ 16 | FILE_ANY_ACCESS) 17 | 18 | #define IOCTL_WRITE_PORT_ULONG CTL_CODE(\ 19 | FILE_DEVICE_UNKNOWN, \ 20 | 0x801, \ 21 | METHOD_BUFFERED, \ 22 | FILE_ANY_ACCESS) 23 | 24 | #define IOCTL_TEST CTL_CODE(\ 25 | FILE_DEVICE_UNKNOWN, \ 26 | 0x802, \ 27 | METHOD_BUFFERED, \ 28 | FILE_ANY_ACCESS) 29 | 30 | #define IOCTL_TRANSMIT CTL_CODE(\ 31 | FILE_DEVICE_UNKNOWN, \ 32 | 0x803, \ 33 | METHOD_OUT_DIRECT, \ 34 | FILE_ANY_ACCESS) 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /chapter13/Test1/MyDriver/MyDriver_Check/HelloWDM.sbr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter13/Test1/MyDriver/MyDriver_Check/HelloWDM.sbr -------------------------------------------------------------------------------- /chapter13/Test1/MyDriver/guid.h: -------------------------------------------------------------------------------- 1 | // {0E57C50F-0CCC-4ad2-A895-93C5ED119860} 2 | DEFINE_GUID(MY_WDM_DEVICE, 0xe57c50f, 0xccc, 0x4ad2, 0xa8, 0x95, 0x93, 0xc5, 0xed, 0x11, 0x98, 0x60); 3 | 4 | -------------------------------------------------------------------------------- /chapter13/Test1/Test/function.h: -------------------------------------------------------------------------------- 1 | #ifndef FUNCTION_H 2 | #define FUNCTION_H 3 | 4 | #include 5 | #include 6 | #include "../MyDriver/Ioctls.h" 7 | 8 | HANDLE GetDeviceViaInterface( GUID* pGuid, DWORD instance); 9 | 10 | DWORD ReadPort(HANDLE hDevice,DWORD port); 11 | VOID WritePort(HANDLE hDevice,DWORD port,DWORD value); 12 | VOID TestDriver(HANDLE hDevice); 13 | #endif -------------------------------------------------------------------------------- /chapter13/Test1/Test/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "function.h" 6 | 7 | #include "../MyDriver/guid.h" 8 | 9 | int main() 10 | { 11 | HANDLE hDevice = GetDeviceViaInterface((LPGUID)&MY_WDM_DEVICE,0); 12 | 13 | if (hDevice == INVALID_HANDLE_VALUE) 14 | { 15 | printf("Failed to obtain file handle to device: " 16 | "%s with Win32 error code: %d\n", 17 | "MyWDMDevice", GetLastError() ); 18 | return 1; 19 | } 20 | 21 | CloseHandle(hDevice); 22 | return 0; 23 | } -------------------------------------------------------------------------------- /chapter13/Test2/DriverDev.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "MyDriver"=".\MyDriver\MyDriver.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "Test"=".\Test\Test.dsp" - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | Begin Project Dependency 27 | Project_Dep_Name MyDriver 28 | End Project Dependency 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /chapter13/Test2/MyDriver/HelloWDM.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter13/Test2/MyDriver/HelloWDM.cpp -------------------------------------------------------------------------------- /chapter13/Test2/MyDriver/HelloWDM.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter13/Test2/MyDriver/HelloWDM.h -------------------------------------------------------------------------------- /chapter13/Test2/MyDriver/Ioctls.h: -------------------------------------------------------------------------------- 1 | // IOCTLS.H -- IOCTL code definitions for fileio driver 2 | // Copyright (C) 1999 by Walter Oney 3 | // All rights reserved 4 | 5 | #ifndef IOCTLS_H 6 | #define IOCTLS_H 7 | 8 | #ifndef CTL_CODE 9 | #pragma message("CTL_CODE undefined. Include winioctl.h or wdm.h") 10 | #endif 11 | 12 | #define IOCTL_READ_PORT_ULONG CTL_CODE(\ 13 | FILE_DEVICE_UNKNOWN, \ 14 | 0x800, \ 15 | METHOD_BUFFERED, \ 16 | FILE_ANY_ACCESS) 17 | 18 | #define IOCTL_WRITE_PORT_ULONG CTL_CODE(\ 19 | FILE_DEVICE_UNKNOWN, \ 20 | 0x801, \ 21 | METHOD_BUFFERED, \ 22 | FILE_ANY_ACCESS) 23 | 24 | #define IOCTL_TEST CTL_CODE(\ 25 | FILE_DEVICE_UNKNOWN, \ 26 | 0x802, \ 27 | METHOD_BUFFERED, \ 28 | FILE_ANY_ACCESS) 29 | 30 | #define IOCTL_TRANSMIT CTL_CODE(\ 31 | FILE_DEVICE_UNKNOWN, \ 32 | 0x803, \ 33 | METHOD_OUT_DIRECT, \ 34 | FILE_ANY_ACCESS) 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /chapter13/Test2/MyDriver/MyDriver_Check/HelloWDM.sbr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter13/Test2/MyDriver/MyDriver_Check/HelloWDM.sbr -------------------------------------------------------------------------------- /chapter13/Test2/MyDriver/guid.h: -------------------------------------------------------------------------------- 1 | // {0E57C50F-0CCC-4ad2-A895-93C5ED119860} 2 | DEFINE_GUID(MY_WDM_DEVICE, 0xe57c50f, 0xccc, 0x4ad2, 0xa8, 0x95, 0x93, 0xc5, 0xed, 0x11, 0x98, 0x60); 3 | 4 | -------------------------------------------------------------------------------- /chapter13/Test2/Test/function.h: -------------------------------------------------------------------------------- 1 | #ifndef FUNCTION_H 2 | #define FUNCTION_H 3 | 4 | #include 5 | #include 6 | #include "../MyDriver/Ioctls.h" 7 | 8 | HANDLE GetDeviceViaInterface( GUID* pGuid, DWORD instance); 9 | 10 | DWORD ReadPort(HANDLE hDevice,DWORD port); 11 | VOID WritePort(HANDLE hDevice,DWORD port,DWORD value); 12 | VOID TestDriver(HANDLE hDevice); 13 | #endif -------------------------------------------------------------------------------- /chapter13/Test2/Test/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "function.h" 6 | 7 | #include "../MyDriver/guid.h" 8 | 9 | int main() 10 | { 11 | HANDLE hDevice = GetDeviceViaInterface((LPGUID)&MY_WDM_DEVICE,0); 12 | 13 | if (hDevice == INVALID_HANDLE_VALUE) 14 | { 15 | printf("Failed to obtain file handle to device: " 16 | "%s with Win32 error code: %d\n", 17 | "MyWDMDevice", GetLastError() ); 18 | return 1; 19 | } 20 | 21 | CloseHandle(hDevice); 22 | return 0; 23 | } -------------------------------------------------------------------------------- /chapter13/Test3/DriverDev.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "MyDriver"=".\MyDriver\MyDriver.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "Test"=".\Test\Test.dsp" - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | Begin Project Dependency 27 | Project_Dep_Name MyDriver 28 | End Project Dependency 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /chapter13/Test3/MyDriver/HelloWDM.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter13/Test3/MyDriver/HelloWDM.cpp -------------------------------------------------------------------------------- /chapter13/Test3/MyDriver/HelloWDM.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter13/Test3/MyDriver/HelloWDM.h -------------------------------------------------------------------------------- /chapter13/Test3/MyDriver/Ioctls.h: -------------------------------------------------------------------------------- 1 | // IOCTLS.H -- IOCTL code definitions for fileio driver 2 | // Copyright (C) 1999 by Walter Oney 3 | // All rights reserved 4 | 5 | #ifndef IOCTLS_H 6 | #define IOCTLS_H 7 | 8 | #ifndef CTL_CODE 9 | #pragma message("CTL_CODE undefined. Include winioctl.h or wdm.h") 10 | #endif 11 | 12 | #define IOCTL_READ_PORT_ULONG CTL_CODE(\ 13 | FILE_DEVICE_UNKNOWN, \ 14 | 0x800, \ 15 | METHOD_BUFFERED, \ 16 | FILE_ANY_ACCESS) 17 | 18 | #define IOCTL_WRITE_PORT_ULONG CTL_CODE(\ 19 | FILE_DEVICE_UNKNOWN, \ 20 | 0x801, \ 21 | METHOD_BUFFERED, \ 22 | FILE_ANY_ACCESS) 23 | 24 | #define IOCTL_TEST CTL_CODE(\ 25 | FILE_DEVICE_UNKNOWN, \ 26 | 0x802, \ 27 | METHOD_BUFFERED, \ 28 | FILE_ANY_ACCESS) 29 | 30 | #define IOCTL_TRANSMIT CTL_CODE(\ 31 | FILE_DEVICE_UNKNOWN, \ 32 | 0x803, \ 33 | METHOD_OUT_DIRECT, \ 34 | FILE_ANY_ACCESS) 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /chapter13/Test3/MyDriver/MyDriver_Check/HelloWDM.sbr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter13/Test3/MyDriver/MyDriver_Check/HelloWDM.sbr -------------------------------------------------------------------------------- /chapter13/Test3/MyDriver/guid.h: -------------------------------------------------------------------------------- 1 | // {0E57C50F-0CCC-4ad2-A895-93C5ED119860} 2 | DEFINE_GUID(MY_WDM_DEVICE, 0xe57c50f, 0xccc, 0x4ad2, 0xa8, 0x95, 0x93, 0xc5, 0xed, 0x11, 0x98, 0x60); 3 | 4 | -------------------------------------------------------------------------------- /chapter13/Test3/Test/function.h: -------------------------------------------------------------------------------- 1 | #ifndef FUNCTION_H 2 | #define FUNCTION_H 3 | 4 | #include 5 | #include 6 | #include "../MyDriver/Ioctls.h" 7 | 8 | HANDLE GetDeviceViaInterface( GUID* pGuid, DWORD instance); 9 | 10 | DWORD ReadPort(HANDLE hDevice,DWORD port); 11 | VOID WritePort(HANDLE hDevice,DWORD port,DWORD value); 12 | VOID TestDriver(HANDLE hDevice); 13 | #endif -------------------------------------------------------------------------------- /chapter13/Test3/Test/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "function.h" 6 | 7 | #include "../MyDriver/guid.h" 8 | 9 | int main() 10 | { 11 | HANDLE hDevice = GetDeviceViaInterface((LPGUID)&MY_WDM_DEVICE,0); 12 | 13 | if (hDevice == INVALID_HANDLE_VALUE) 14 | { 15 | printf("Failed to obtain file handle to device: " 16 | "%s with Win32 error code: %d\n", 17 | "MyWDMDevice", GetLastError() ); 18 | return 1; 19 | } 20 | 21 | CloseHandle(hDevice); 22 | return 0; 23 | } -------------------------------------------------------------------------------- /chapter14/Test1/DriverDev.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "MyDriver"=".\MyDriver\MyDriver.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "Test"=".\Test\Test.dsp" - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | Begin Project Dependency 27 | Project_Dep_Name MyDriver 28 | End Project Dependency 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /chapter14/Test1/MyDriver/HelloWDM.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter14/Test1/MyDriver/HelloWDM.cpp -------------------------------------------------------------------------------- /chapter14/Test1/MyDriver/HelloWDM.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter14/Test1/MyDriver/HelloWDM.h -------------------------------------------------------------------------------- /chapter14/Test1/MyDriver/HelloWDM.inf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter14/Test1/MyDriver/HelloWDM.inf -------------------------------------------------------------------------------- /chapter14/Test1/MyDriver/Ioctls.h: -------------------------------------------------------------------------------- 1 | // IOCTLS.H -- IOCTL code definitions for fileio driver 2 | // Copyright (C) 1999 by Walter Oney 3 | // All rights reserved 4 | 5 | #ifndef IOCTLS_H 6 | #define IOCTLS_H 7 | 8 | #ifndef CTL_CODE 9 | #pragma message("CTL_CODE undefined. Include winioctl.h or wdm.h") 10 | #endif 11 | 12 | #define IOCTL_READ_PORT_ULONG CTL_CODE(\ 13 | FILE_DEVICE_UNKNOWN, \ 14 | 0x800, \ 15 | METHOD_BUFFERED, \ 16 | FILE_ANY_ACCESS) 17 | 18 | #define IOCTL_WRITE_PORT_ULONG CTL_CODE(\ 19 | FILE_DEVICE_UNKNOWN, \ 20 | 0x801, \ 21 | METHOD_BUFFERED, \ 22 | FILE_ANY_ACCESS) 23 | 24 | #define IOCTL_TEST CTL_CODE(\ 25 | FILE_DEVICE_UNKNOWN, \ 26 | 0x802, \ 27 | METHOD_BUFFERED, \ 28 | FILE_ANY_ACCESS) 29 | 30 | #define IOCTL_TRANSMIT CTL_CODE(\ 31 | FILE_DEVICE_UNKNOWN, \ 32 | 0x803, \ 33 | METHOD_OUT_DIRECT, \ 34 | FILE_ANY_ACCESS) 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /chapter14/Test1/MyDriver/MyDriver_Check/HelloWDM.sbr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter14/Test1/MyDriver/MyDriver_Check/HelloWDM.sbr -------------------------------------------------------------------------------- /chapter14/Test1/MyDriver/guid.h: -------------------------------------------------------------------------------- 1 | // {0E57C50F-0CCC-4ad2-A895-93C5ED119860} 2 | DEFINE_GUID(MY_WDM_DEVICE, 0xe57c50f, 0xccc, 0x4ad2, 0xa8, 0x95, 0x93, 0xc5, 0xed, 0x11, 0x98, 0x60); 3 | 4 | -------------------------------------------------------------------------------- /chapter14/Test1/Test/function.h: -------------------------------------------------------------------------------- 1 | #ifndef FUNCTION_H 2 | #define FUNCTION_H 3 | 4 | #include 5 | #include 6 | #include "../MyDriver/Ioctls.h" 7 | 8 | HANDLE GetDeviceViaInterface( GUID* pGuid, DWORD instance); 9 | 10 | DWORD ReadPort(HANDLE hDevice,DWORD port); 11 | VOID WritePort(HANDLE hDevice,DWORD port,DWORD value); 12 | VOID TestDriver(HANDLE hDevice); 13 | #endif -------------------------------------------------------------------------------- /chapter14/Test1/Test/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "function.h" 6 | 7 | #include "../MyDriver/guid.h" 8 | 9 | int main() 10 | { 11 | HANDLE hDevice = GetDeviceViaInterface((LPGUID)&MY_WDM_DEVICE,0); 12 | 13 | if (hDevice == INVALID_HANDLE_VALUE) 14 | { 15 | printf("Failed to obtain file handle to device: " 16 | "%s with Win32 error code: %d\n", 17 | "MyWDMDevice", GetLastError() ); 18 | return 1; 19 | } 20 | 21 | CloseHandle(hDevice); 22 | return 0; 23 | } -------------------------------------------------------------------------------- /chapter15/Test1/ConsoleTest.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "ConsoleTest"=.\ConsoleTest.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /chapter15/Test1/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter15/Test1/main.cpp -------------------------------------------------------------------------------- /chapter15/Test2/ConsoleTest.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "ConsoleTest"=.\ConsoleTest.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /chapter15/Test2/Debug/WinIo.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter15/Test2/Debug/WinIo.dll -------------------------------------------------------------------------------- /chapter15/Test2/Debug/WinIo.sys: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter15/Test2/Debug/WinIo.sys -------------------------------------------------------------------------------- /chapter15/Test2/WinIoLib/WINIO.VXD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter15/Test2/WinIoLib/WINIO.VXD -------------------------------------------------------------------------------- /chapter15/Test2/WinIoLib/WinIo.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter15/Test2/WinIoLib/WinIo.dll -------------------------------------------------------------------------------- /chapter15/Test2/WinIoLib/WinIo.h: -------------------------------------------------------------------------------- 1 | #ifndef WINIO_H 2 | #define WINIO_H 3 | 4 | //#define WINIO_DLL 5 | 6 | #ifdef WINIO_DLL 7 | #define WINIO_API _declspec(dllexport) 8 | #else 9 | #define WINIO_API _declspec(dllimport) 10 | #endif 11 | 12 | extern "C" 13 | { 14 | WINIO_API bool _stdcall InitializeWinIo(); 15 | WINIO_API void _stdcall ShutdownWinIo(); 16 | WINIO_API PBYTE _stdcall MapPhysToLin(PBYTE pbPhysAddr, DWORD dwPhysSize, HANDLE *pPhysicalMemoryHandle); 17 | WINIO_API bool _stdcall UnmapPhysicalMemory(HANDLE PhysicalMemoryHandle, PBYTE pbLinAddr); 18 | WINIO_API bool _stdcall GetPhysLong(PBYTE pbPhysAddr, PDWORD pdwPhysVal); 19 | WINIO_API bool _stdcall SetPhysLong(PBYTE pbPhysAddr, DWORD dwPhysVal); 20 | WINIO_API bool _stdcall GetPortVal(WORD wPortAddr, PDWORD pdwPortVal, BYTE bSize); 21 | WINIO_API bool _stdcall SetPortVal(WORD wPortAddr, DWORD dwPortVal, BYTE bSize); 22 | WINIO_API bool _stdcall InstallWinIoDriver(PSTR pszWinIoDriverPath, bool IsDemandLoaded = false); 23 | WINIO_API bool _stdcall RemoveWinIoDriver(); 24 | } 25 | 26 | extern bool IsNT; 27 | extern HANDLE hDriver; 28 | extern bool IsWinIoInitialized; 29 | 30 | bool _stdcall StartWinIoDriver(); 31 | bool _stdcall StopWinIoDriver(); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /chapter15/Test2/WinIoLib/WinIo.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter15/Test2/WinIoLib/WinIo.lib -------------------------------------------------------------------------------- /chapter15/Test2/WinIoLib/WinIo.sys: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter15/Test2/WinIoLib/WinIo.sys -------------------------------------------------------------------------------- /chapter15/Test2/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter15/Test2/main.cpp -------------------------------------------------------------------------------- /chapter15/Test3/NT_Driver.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=".\NT_Driver\DriverDev.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "Test"=".\Test\Test.dsp" - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | Begin Project Dependency 27 | Project_Dep_Name DriverDev 28 | End Project Dependency 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /chapter15/Test3/NT_Driver/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter15/Test3/NT_Driver/Driver.cpp -------------------------------------------------------------------------------- /chapter15/Test3/NT_Driver/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter15/Test3/NT_Driver/Driver.h -------------------------------------------------------------------------------- /chapter15/Test3/NT_Driver/Ioctls.h: -------------------------------------------------------------------------------- 1 | // IOCTLS.H -- IOCTL code definitions for fileio driver 2 | // Copyright (C) 1999 by Walter Oney 3 | // All rights reserved 4 | 5 | #ifndef IOCTLS_H 6 | #define IOCTLS_H 7 | 8 | #ifndef CTL_CODE 9 | #pragma message("CTL_CODE undefined. Include winioctl.h or wdm.h") 10 | #endif 11 | 12 | #define READ_PORT CTL_CODE(\ 13 | FILE_DEVICE_UNKNOWN, \ 14 | 0x800, \ 15 | METHOD_BUFFERED, \ 16 | FILE_ANY_ACCESS) 17 | 18 | #define WRITE_PORT CTL_CODE(\ 19 | FILE_DEVICE_UNKNOWN, \ 20 | 0x801, \ 21 | METHOD_BUFFERED, \ 22 | FILE_ANY_ACCESS) 23 | 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /chapter15/Test3/Test/function.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "function.h" 5 | 6 | // DWORD ReadPort(HANDLE hDevice,DWORD port) 7 | // { 8 | // DWORD dwOutput; 9 | // DWORD dwRead; 10 | // DeviceIoControl(hDevice, IOCTL_READ_PORT_ULONG, &port, 4, &dwOutput, 4, &dwRead, NULL); 11 | // return dwOutput; 12 | // } 13 | // VOID WritePort(HANDLE hDevice,DWORD port,DWORD value) 14 | // { 15 | // PVOID buffer[2]; 16 | // buffer[0] = (PVOID)port; 17 | // buffer[1] = (PVOID)value; 18 | // DWORD dwWrite; 19 | // DeviceIoControl(hDevice, IOCTL_WRITE_PORT_ULONG, &port, 8, NULL, 0, &dwWrite, NULL); 20 | // } 21 | // VOID TestDriver(HANDLE hDevice) 22 | // { 23 | // DWORD dwOutput; 24 | // DeviceIoControl(hDevice, IOCTL_TEST, NULL, 0, NULL, 0, &dwOutput, NULL); 25 | // } 26 | 27 | -------------------------------------------------------------------------------- /chapter15/Test3/Test/function.h: -------------------------------------------------------------------------------- 1 | #ifndef FUNCTION_H 2 | #define FUNCTION_H 3 | 4 | //#include "../MyDriver/Ioctls.h" 5 | 6 | DWORD ReadPort(HANDLE hDevice,DWORD port); 7 | VOID WritePort(HANDLE hDevice,DWORD port,DWORD value); 8 | VOID TestDriver(HANDLE hDevice); 9 | #endif -------------------------------------------------------------------------------- /chapter15/Test3/Test/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter15/Test3/Test/main.cpp -------------------------------------------------------------------------------- /chapter15/Test4/NT_Driver.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=".\NT_Driver\DriverDev.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "Test"=".\Test\Test.dsp" - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | Begin Project Dependency 27 | Project_Dep_Name DriverDev 28 | End Project Dependency 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /chapter15/Test4/NT_Driver/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter15/Test4/NT_Driver/Driver.cpp -------------------------------------------------------------------------------- /chapter15/Test4/NT_Driver/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter15/Test4/NT_Driver/Driver.h -------------------------------------------------------------------------------- /chapter15/Test4/NT_Driver/Ioctls.h: -------------------------------------------------------------------------------- 1 | // IOCTLS.H -- IOCTL code definitions for fileio driver 2 | // Copyright (C) 1999 by Walter Oney 3 | // All rights reserved 4 | 5 | #ifndef IOCTLS_H 6 | #define IOCTLS_H 7 | 8 | #ifndef CTL_CODE 9 | #pragma message("CTL_CODE undefined. Include winioctl.h or wdm.h") 10 | #endif 11 | 12 | #define READ_PORT CTL_CODE(\ 13 | FILE_DEVICE_UNKNOWN, \ 14 | 0x800, \ 15 | METHOD_BUFFERED, \ 16 | FILE_ANY_ACCESS) 17 | 18 | #define WRITE_PORT CTL_CODE(\ 19 | FILE_DEVICE_UNKNOWN, \ 20 | 0x801, \ 21 | METHOD_BUFFERED, \ 22 | FILE_ANY_ACCESS) 23 | 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /chapter15/Test4/Test/function.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "function.h" 5 | 6 | // DWORD ReadPort(HANDLE hDevice,DWORD port) 7 | // { 8 | // DWORD dwOutput; 9 | // DWORD dwRead; 10 | // DeviceIoControl(hDevice, IOCTL_READ_PORT_ULONG, &port, 4, &dwOutput, 4, &dwRead, NULL); 11 | // return dwOutput; 12 | // } 13 | // VOID WritePort(HANDLE hDevice,DWORD port,DWORD value) 14 | // { 15 | // PVOID buffer[2]; 16 | // buffer[0] = (PVOID)port; 17 | // buffer[1] = (PVOID)value; 18 | // DWORD dwWrite; 19 | // DeviceIoControl(hDevice, IOCTL_WRITE_PORT_ULONG, &port, 8, NULL, 0, &dwWrite, NULL); 20 | // } 21 | // VOID TestDriver(HANDLE hDevice) 22 | // { 23 | // DWORD dwOutput; 24 | // DeviceIoControl(hDevice, IOCTL_TEST, NULL, 0, NULL, 0, &dwOutput, NULL); 25 | // } 26 | 27 | -------------------------------------------------------------------------------- /chapter15/Test4/Test/function.h: -------------------------------------------------------------------------------- 1 | #ifndef FUNCTION_H 2 | #define FUNCTION_H 3 | 4 | //#include "../MyDriver/Ioctls.h" 5 | 6 | DWORD ReadPort(HANDLE hDevice,DWORD port); 7 | VOID WritePort(HANDLE hDevice,DWORD port,DWORD value); 8 | VOID TestDriver(HANDLE hDevice); 9 | #endif -------------------------------------------------------------------------------- /chapter15/Test4/Test/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter15/Test4/Test/main.cpp -------------------------------------------------------------------------------- /chapter15/Test5/NT_Driver.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=".\NT_Driver\DriverDev.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "Test"=".\Test\Test.dsp" - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | Begin Project Dependency 27 | Project_Dep_Name DriverDev 28 | End Project Dependency 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /chapter15/Test5/NT_Driver/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter15/Test5/NT_Driver/Driver.cpp -------------------------------------------------------------------------------- /chapter15/Test5/NT_Driver/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter15/Test5/NT_Driver/Driver.h -------------------------------------------------------------------------------- /chapter15/Test5/NT_Driver/Ioctls.h: -------------------------------------------------------------------------------- 1 | // IOCTLS.H -- IOCTL code definitions for fileio driver 2 | // Copyright (C) 1999 by Walter Oney 3 | // All rights reserved 4 | 5 | #ifndef IOCTLS_H 6 | #define IOCTLS_H 7 | 8 | #ifndef CTL_CODE 9 | #pragma message("CTL_CODE undefined. Include winioctl.h or wdm.h") 10 | #endif 11 | 12 | #define IOCTL_KERNEL_FUNCTION CTL_CODE(\ 13 | FILE_DEVICE_UNKNOWN, \ 14 | 0x800, \ 15 | METHOD_BUFFERED, \ 16 | FILE_ANY_ACCESS) 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /chapter15/Test5/Test/Debug/Test.bsc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter15/Test5/Test/Debug/Test.bsc -------------------------------------------------------------------------------- /chapter15/Test5/Test/Debug/function.sbr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter15/Test5/Test/Debug/function.sbr -------------------------------------------------------------------------------- /chapter15/Test5/Test/Debug/main.sbr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter15/Test5/Test/Debug/main.sbr -------------------------------------------------------------------------------- /chapter15/Test5/Test/function.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "function.h" 5 | 6 | // DWORD ReadPort(HANDLE hDevice,DWORD port) 7 | // { 8 | // DWORD dwOutput; 9 | // DWORD dwRead; 10 | // DeviceIoControl(hDevice, IOCTL_READ_PORT_ULONG, &port, 4, &dwOutput, 4, &dwRead, NULL); 11 | // return dwOutput; 12 | // } 13 | // VOID WritePort(HANDLE hDevice,DWORD port,DWORD value) 14 | // { 15 | // PVOID buffer[2]; 16 | // buffer[0] = (PVOID)port; 17 | // buffer[1] = (PVOID)value; 18 | // DWORD dwWrite; 19 | // DeviceIoControl(hDevice, IOCTL_WRITE_PORT_ULONG, &port, 8, NULL, 0, &dwWrite, NULL); 20 | // } 21 | // VOID TestDriver(HANDLE hDevice) 22 | // { 23 | // DWORD dwOutput; 24 | // DeviceIoControl(hDevice, IOCTL_TEST, NULL, 0, NULL, 0, &dwOutput, NULL); 25 | // } 26 | 27 | -------------------------------------------------------------------------------- /chapter15/Test5/Test/function.h: -------------------------------------------------------------------------------- 1 | #ifndef FUNCTION_H 2 | #define FUNCTION_H 3 | 4 | //#include "../MyDriver/Ioctls.h" 5 | 6 | DWORD ReadPort(HANDLE hDevice,DWORD port); 7 | VOID WritePort(HANDLE hDevice,DWORD port,DWORD value); 8 | VOID TestDriver(HANDLE hDevice); 9 | #endif -------------------------------------------------------------------------------- /chapter15/Test5/Test/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter15/Test5/Test/main.cpp -------------------------------------------------------------------------------- /chapter15/Test6/NT_Driver.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=".\NT_Driver\DriverDev.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "Test"=".\Test\Test.dsp" - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | Begin Project Dependency 27 | Project_Dep_Name DriverDev 28 | End Project Dependency 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /chapter15/Test6/NT_Driver/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter15/Test6/NT_Driver/Driver.cpp -------------------------------------------------------------------------------- /chapter15/Test6/NT_Driver/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter15/Test6/NT_Driver/Driver.h -------------------------------------------------------------------------------- /chapter15/Test6/NT_Driver/Ioctls.h: -------------------------------------------------------------------------------- 1 | // IOCTLS.H -- IOCTL code definitions for fileio driver 2 | // Copyright (C) 1999 by Walter Oney 3 | // All rights reserved 4 | 5 | #ifndef IOCTLS_H 6 | #define IOCTLS_H 7 | 8 | #ifndef CTL_CODE 9 | #pragma message("CTL_CODE undefined. Include winioctl.h or wdm.h") 10 | #endif 11 | 12 | #define IOCTL_ENABLEDIRECTIO CTL_CODE(\ 13 | FILE_DEVICE_UNKNOWN, \ 14 | 0x800, \ 15 | METHOD_BUFFERED, \ 16 | FILE_ANY_ACCESS) 17 | 18 | #define IOCTL_DISABLEDIRECTIO CTL_CODE(\ 19 | FILE_DEVICE_UNKNOWN, \ 20 | 0x801, \ 21 | METHOD_BUFFERED, \ 22 | FILE_ANY_ACCESS) 23 | #endif 24 | -------------------------------------------------------------------------------- /chapter15/Test6/Test/Debug/Test.bsc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter15/Test6/Test/Debug/Test.bsc -------------------------------------------------------------------------------- /chapter15/Test6/Test/Debug/function.sbr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter15/Test6/Test/Debug/function.sbr -------------------------------------------------------------------------------- /chapter15/Test6/Test/Debug/main.sbr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter15/Test6/Test/Debug/main.sbr -------------------------------------------------------------------------------- /chapter15/Test6/Test/function.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "function.h" 5 | 6 | // DWORD ReadPort(HANDLE hDevice,DWORD port) 7 | // { 8 | // DWORD dwOutput; 9 | // DWORD dwRead; 10 | // DeviceIoControl(hDevice, IOCTL_READ_PORT_ULONG, &port, 4, &dwOutput, 4, &dwRead, NULL); 11 | // return dwOutput; 12 | // } 13 | // VOID WritePort(HANDLE hDevice,DWORD port,DWORD value) 14 | // { 15 | // PVOID buffer[2]; 16 | // buffer[0] = (PVOID)port; 17 | // buffer[1] = (PVOID)value; 18 | // DWORD dwWrite; 19 | // DeviceIoControl(hDevice, IOCTL_WRITE_PORT_ULONG, &port, 8, NULL, 0, &dwWrite, NULL); 20 | // } 21 | // VOID TestDriver(HANDLE hDevice) 22 | // { 23 | // DWORD dwOutput; 24 | // DeviceIoControl(hDevice, IOCTL_TEST, NULL, 0, NULL, 0, &dwOutput, NULL); 25 | // } 26 | 27 | -------------------------------------------------------------------------------- /chapter15/Test6/Test/function.h: -------------------------------------------------------------------------------- 1 | #ifndef FUNCTION_H 2 | #define FUNCTION_H 3 | 4 | //#include "../MyDriver/Ioctls.h" 5 | 6 | DWORD ReadPort(HANDLE hDevice,DWORD port); 7 | VOID WritePort(HANDLE hDevice,DWORD port,DWORD value); 8 | VOID TestDriver(HANDLE hDevice); 9 | #endif -------------------------------------------------------------------------------- /chapter15/Test6/Test/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter15/Test6/Test/main.cpp -------------------------------------------------------------------------------- /chapter15/Test7/NT_Driver.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=".\NT_Driver\DriverDev.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "Test"=".\Test\Test.dsp" - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | Begin Project Dependency 27 | Project_Dep_Name DriverDev 28 | End Project Dependency 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /chapter15/Test7/NT_Driver/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter15/Test7/NT_Driver/Driver.cpp -------------------------------------------------------------------------------- /chapter15/Test7/NT_Driver/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter15/Test7/NT_Driver/Driver.h -------------------------------------------------------------------------------- /chapter15/Test7/NT_Driver/Ioctls.h: -------------------------------------------------------------------------------- 1 | // IOCTLS.H -- IOCTL code definitions for fileio driver 2 | // Copyright (C) 1999 by Walter Oney 3 | // All rights reserved 4 | 5 | #ifndef IOCTLS_H 6 | #define IOCTLS_H 7 | 8 | #ifndef CTL_CODE 9 | #pragma message("CTL_CODE undefined. Include winioctl.h or wdm.h") 10 | #endif 11 | 12 | #define READ_PORT CTL_CODE(\ 13 | FILE_DEVICE_UNKNOWN, \ 14 | 0x800, \ 15 | METHOD_BUFFERED, \ 16 | FILE_ANY_ACCESS) 17 | 18 | #define WRITE_PORT CTL_CODE(\ 19 | FILE_DEVICE_UNKNOWN, \ 20 | 0x801, \ 21 | METHOD_BUFFERED, \ 22 | FILE_ANY_ACCESS) 23 | 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /chapter15/Test7/Test/function.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "function.h" 5 | 6 | // DWORD ReadPort(HANDLE hDevice,DWORD port) 7 | // { 8 | // DWORD dwOutput; 9 | // DWORD dwRead; 10 | // DeviceIoControl(hDevice, IOCTL_READ_PORT_ULONG, &port, 4, &dwOutput, 4, &dwRead, NULL); 11 | // return dwOutput; 12 | // } 13 | // VOID WritePort(HANDLE hDevice,DWORD port,DWORD value) 14 | // { 15 | // PVOID buffer[2]; 16 | // buffer[0] = (PVOID)port; 17 | // buffer[1] = (PVOID)value; 18 | // DWORD dwWrite; 19 | // DeviceIoControl(hDevice, IOCTL_WRITE_PORT_ULONG, &port, 8, NULL, 0, &dwWrite, NULL); 20 | // } 21 | // VOID TestDriver(HANDLE hDevice) 22 | // { 23 | // DWORD dwOutput; 24 | // DeviceIoControl(hDevice, IOCTL_TEST, NULL, 0, NULL, 0, &dwOutput, NULL); 25 | // } 26 | 27 | -------------------------------------------------------------------------------- /chapter15/Test7/Test/function.h: -------------------------------------------------------------------------------- 1 | #ifndef FUNCTION_H 2 | #define FUNCTION_H 3 | 4 | //#include "../MyDriver/Ioctls.h" 5 | 6 | DWORD ReadPort(HANDLE hDevice,DWORD port); 7 | VOID WritePort(HANDLE hDevice,DWORD port,DWORD value); 8 | VOID TestDriver(HANDLE hDevice); 9 | #endif -------------------------------------------------------------------------------- /chapter15/Test7/Test/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter15/Test7/Test/main.cpp -------------------------------------------------------------------------------- /chapter15/Test8/NT_Driver.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=".\NT_Driver\DriverDev.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "Test"=".\Test\Test.dsp" - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | Begin Project Dependency 27 | Project_Dep_Name DriverDev 28 | End Project Dependency 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /chapter15/Test8/NT_Driver/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter15/Test8/NT_Driver/Driver.cpp -------------------------------------------------------------------------------- /chapter15/Test8/NT_Driver/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter15/Test8/NT_Driver/Driver.h -------------------------------------------------------------------------------- /chapter15/Test8/NT_Driver/Ioctls.h: -------------------------------------------------------------------------------- 1 | // IOCTLS.H -- IOCTL code definitions for fileio driver 2 | // Copyright (C) 1999 by Walter Oney 3 | // All rights reserved 4 | 5 | #ifndef IOCTLS_H 6 | #define IOCTLS_H 7 | 8 | #ifndef CTL_CODE 9 | #pragma message("CTL_CODE undefined. Include winioctl.h or wdm.h") 10 | #endif 11 | 12 | #define READ_PORT CTL_CODE(\ 13 | FILE_DEVICE_UNKNOWN, \ 14 | 0x800, \ 15 | METHOD_BUFFERED, \ 16 | FILE_ANY_ACCESS) 17 | 18 | #define WRITE_PORT CTL_CODE(\ 19 | FILE_DEVICE_UNKNOWN, \ 20 | 0x801, \ 21 | METHOD_BUFFERED, \ 22 | FILE_ANY_ACCESS) 23 | 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /chapter15/Test8/Test/function.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "function.h" 5 | 6 | // DWORD ReadPort(HANDLE hDevice,DWORD port) 7 | // { 8 | // DWORD dwOutput; 9 | // DWORD dwRead; 10 | // DeviceIoControl(hDevice, IOCTL_READ_PORT_ULONG, &port, 4, &dwOutput, 4, &dwRead, NULL); 11 | // return dwOutput; 12 | // } 13 | // VOID WritePort(HANDLE hDevice,DWORD port,DWORD value) 14 | // { 15 | // PVOID buffer[2]; 16 | // buffer[0] = (PVOID)port; 17 | // buffer[1] = (PVOID)value; 18 | // DWORD dwWrite; 19 | // DeviceIoControl(hDevice, IOCTL_WRITE_PORT_ULONG, &port, 8, NULL, 0, &dwWrite, NULL); 20 | // } 21 | // VOID TestDriver(HANDLE hDevice) 22 | // { 23 | // DWORD dwOutput; 24 | // DeviceIoControl(hDevice, IOCTL_TEST, NULL, 0, NULL, 0, &dwOutput, NULL); 25 | // } 26 | 27 | -------------------------------------------------------------------------------- /chapter15/Test8/Test/function.h: -------------------------------------------------------------------------------- 1 | #ifndef FUNCTION_H 2 | #define FUNCTION_H 3 | 4 | //#include "../MyDriver/Ioctls.h" 5 | 6 | DWORD ReadPort(HANDLE hDevice,DWORD port); 7 | VOID WritePort(HANDLE hDevice,DWORD port,DWORD value); 8 | VOID TestDriver(HANDLE hDevice); 9 | #endif -------------------------------------------------------------------------------- /chapter15/Test8/Test/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter15/Test8/Test/main.cpp -------------------------------------------------------------------------------- /chapter16/Test1/NT_Driver/NT_Driver.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=".\NT_Driver\DriverDev.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "Test"=".\Test\Test.dsp" - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | Begin Project Dependency 27 | Project_Dep_Name DriverDev 28 | End Project Dependency 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /chapter16/Test1/NT_Driver/NT_Driver/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test1/NT_Driver/NT_Driver/Driver.cpp -------------------------------------------------------------------------------- /chapter16/Test1/NT_Driver/NT_Driver/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test1/NT_Driver/NT_Driver/Driver.h -------------------------------------------------------------------------------- /chapter16/Test1/NT_Driver/NT_Driver/Ioctls.h: -------------------------------------------------------------------------------- 1 | // IOCTLS.H -- IOCTL code definitions for fileio driver 2 | // Copyright (C) 1999 by Walter Oney 3 | // All rights reserved 4 | 5 | #ifndef IOCTLS_H 6 | #define IOCTLS_H 7 | 8 | #ifndef CTL_CODE 9 | #pragma message("CTL_CODE undefined. Include winioctl.h or wdm.h") 10 | #endif 11 | 12 | #define READ_PORT CTL_CODE(\ 13 | FILE_DEVICE_UNKNOWN, \ 14 | 0x800, \ 15 | METHOD_BUFFERED, \ 16 | FILE_ANY_ACCESS) 17 | 18 | #define WRITE_PORT CTL_CODE(\ 19 | FILE_DEVICE_UNKNOWN, \ 20 | 0x801, \ 21 | METHOD_BUFFERED, \ 22 | FILE_ANY_ACCESS) 23 | 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /chapter16/Test1/NT_Driver/Test/PCI00000.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test1/NT_Driver/Test/PCI00000.bin -------------------------------------------------------------------------------- /chapter16/Test1/NT_Driver/Test/PCI00010.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test1/NT_Driver/Test/PCI00010.bin -------------------------------------------------------------------------------- /chapter16/Test1/NT_Driver/Test/PCI00020.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test1/NT_Driver/Test/PCI00020.bin -------------------------------------------------------------------------------- /chapter16/Test1/NT_Driver/Test/PCI00021.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test1/NT_Driver/Test/PCI00021.bin -------------------------------------------------------------------------------- /chapter16/Test1/NT_Driver/Test/PCI001B0.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test1/NT_Driver/Test/PCI001B0.bin -------------------------------------------------------------------------------- /chapter16/Test1/NT_Driver/Test/PCI001C0.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test1/NT_Driver/Test/PCI001C0.bin -------------------------------------------------------------------------------- /chapter16/Test1/NT_Driver/Test/PCI001D0.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test1/NT_Driver/Test/PCI001D0.bin -------------------------------------------------------------------------------- /chapter16/Test1/NT_Driver/Test/PCI001D1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test1/NT_Driver/Test/PCI001D1.bin -------------------------------------------------------------------------------- /chapter16/Test1/NT_Driver/Test/PCI001D2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test1/NT_Driver/Test/PCI001D2.bin -------------------------------------------------------------------------------- /chapter16/Test1/NT_Driver/Test/PCI001D3.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test1/NT_Driver/Test/PCI001D3.bin -------------------------------------------------------------------------------- /chapter16/Test1/NT_Driver/Test/PCI001D7.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test1/NT_Driver/Test/PCI001D7.bin -------------------------------------------------------------------------------- /chapter16/Test1/NT_Driver/Test/PCI001E0.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test1/NT_Driver/Test/PCI001E0.bin -------------------------------------------------------------------------------- /chapter16/Test1/NT_Driver/Test/PCI001F0.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test1/NT_Driver/Test/PCI001F0.bin -------------------------------------------------------------------------------- /chapter16/Test1/NT_Driver/Test/PCI001F1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test1/NT_Driver/Test/PCI001F1.bin -------------------------------------------------------------------------------- /chapter16/Test1/NT_Driver/Test/PCI001F2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test1/NT_Driver/Test/PCI001F2.bin -------------------------------------------------------------------------------- /chapter16/Test1/NT_Driver/Test/PCI001F3.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test1/NT_Driver/Test/PCI001F3.bin -------------------------------------------------------------------------------- /chapter16/Test1/NT_Driver/Test/PCI02000.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test1/NT_Driver/Test/PCI02000.bin -------------------------------------------------------------------------------- /chapter16/Test1/NT_Driver/Test/function.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "function.h" 5 | 6 | // DWORD ReadPort(HANDLE hDevice,DWORD port) 7 | // { 8 | // DWORD dwOutput; 9 | // DWORD dwRead; 10 | // DeviceIoControl(hDevice, IOCTL_READ_PORT_ULONG, &port, 4, &dwOutput, 4, &dwRead, NULL); 11 | // return dwOutput; 12 | // } 13 | // VOID WritePort(HANDLE hDevice,DWORD port,DWORD value) 14 | // { 15 | // PVOID buffer[2]; 16 | // buffer[0] = (PVOID)port; 17 | // buffer[1] = (PVOID)value; 18 | // DWORD dwWrite; 19 | // DeviceIoControl(hDevice, IOCTL_WRITE_PORT_ULONG, &port, 8, NULL, 0, &dwWrite, NULL); 20 | // } 21 | // VOID TestDriver(HANDLE hDevice) 22 | // { 23 | // DWORD dwOutput; 24 | // DeviceIoControl(hDevice, IOCTL_TEST, NULL, 0, NULL, 0, &dwOutput, NULL); 25 | // } 26 | 27 | -------------------------------------------------------------------------------- /chapter16/Test1/NT_Driver/Test/function.h: -------------------------------------------------------------------------------- 1 | #ifndef FUNCTION_H 2 | #define FUNCTION_H 3 | 4 | //#include "../MyDriver/Ioctls.h" 5 | 6 | DWORD ReadPort(HANDLE hDevice,DWORD port); 7 | VOID WritePort(HANDLE hDevice,DWORD port,DWORD value); 8 | VOID TestDriver(HANDLE hDevice); 9 | #endif -------------------------------------------------------------------------------- /chapter16/Test1/NT_Driver/Test/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test1/NT_Driver/Test/main.cpp -------------------------------------------------------------------------------- /chapter16/Test2/NT_Driver/NT_Driver.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=".\NT_Driver\DriverDev.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "Test"=".\Test\Test.dsp" - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | Begin Project Dependency 27 | Project_Dep_Name DriverDev 28 | End Project Dependency 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /chapter16/Test2/NT_Driver/NT_Driver/Driver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test2/NT_Driver/NT_Driver/Driver.cpp -------------------------------------------------------------------------------- /chapter16/Test2/NT_Driver/NT_Driver/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test2/NT_Driver/NT_Driver/Driver.h -------------------------------------------------------------------------------- /chapter16/Test2/NT_Driver/NT_Driver/Ioctls.h: -------------------------------------------------------------------------------- 1 | // IOCTLS.H -- IOCTL code definitions for fileio driver 2 | // Copyright (C) 1999 by Walter Oney 3 | // All rights reserved 4 | 5 | #ifndef IOCTLS_H 6 | #define IOCTLS_H 7 | 8 | #ifndef CTL_CODE 9 | #pragma message("CTL_CODE undefined. Include winioctl.h or wdm.h") 10 | #endif 11 | 12 | #define READ_PORT CTL_CODE(\ 13 | FILE_DEVICE_UNKNOWN, \ 14 | 0x800, \ 15 | METHOD_BUFFERED, \ 16 | FILE_ANY_ACCESS) 17 | 18 | #define WRITE_PORT CTL_CODE(\ 19 | FILE_DEVICE_UNKNOWN, \ 20 | 0x801, \ 21 | METHOD_BUFFERED, \ 22 | FILE_ANY_ACCESS) 23 | 24 | #define ENUM_PCI CTL_CODE(\ 25 | FILE_DEVICE_UNKNOWN, \ 26 | 0x802, \ 27 | METHOD_BUFFERED, \ 28 | FILE_ANY_ACCESS) 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /chapter16/Test2/NT_Driver/Test/PCI00000.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test2/NT_Driver/Test/PCI00000.bin -------------------------------------------------------------------------------- /chapter16/Test2/NT_Driver/Test/PCI00010.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test2/NT_Driver/Test/PCI00010.bin -------------------------------------------------------------------------------- /chapter16/Test2/NT_Driver/Test/PCI00020.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test2/NT_Driver/Test/PCI00020.bin -------------------------------------------------------------------------------- /chapter16/Test2/NT_Driver/Test/PCI00021.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test2/NT_Driver/Test/PCI00021.bin -------------------------------------------------------------------------------- /chapter16/Test2/NT_Driver/Test/PCI001B0.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test2/NT_Driver/Test/PCI001B0.bin -------------------------------------------------------------------------------- /chapter16/Test2/NT_Driver/Test/PCI001C0.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test2/NT_Driver/Test/PCI001C0.bin -------------------------------------------------------------------------------- /chapter16/Test2/NT_Driver/Test/PCI001D0.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test2/NT_Driver/Test/PCI001D0.bin -------------------------------------------------------------------------------- /chapter16/Test2/NT_Driver/Test/PCI001D1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test2/NT_Driver/Test/PCI001D1.bin -------------------------------------------------------------------------------- /chapter16/Test2/NT_Driver/Test/PCI001D2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test2/NT_Driver/Test/PCI001D2.bin -------------------------------------------------------------------------------- /chapter16/Test2/NT_Driver/Test/PCI001D3.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test2/NT_Driver/Test/PCI001D3.bin -------------------------------------------------------------------------------- /chapter16/Test2/NT_Driver/Test/PCI001D7.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test2/NT_Driver/Test/PCI001D7.bin -------------------------------------------------------------------------------- /chapter16/Test2/NT_Driver/Test/PCI001E0.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test2/NT_Driver/Test/PCI001E0.bin -------------------------------------------------------------------------------- /chapter16/Test2/NT_Driver/Test/PCI001F0.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test2/NT_Driver/Test/PCI001F0.bin -------------------------------------------------------------------------------- /chapter16/Test2/NT_Driver/Test/PCI001F1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test2/NT_Driver/Test/PCI001F1.bin -------------------------------------------------------------------------------- /chapter16/Test2/NT_Driver/Test/PCI001F2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test2/NT_Driver/Test/PCI001F2.bin -------------------------------------------------------------------------------- /chapter16/Test2/NT_Driver/Test/PCI001F3.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test2/NT_Driver/Test/PCI001F3.bin -------------------------------------------------------------------------------- /chapter16/Test2/NT_Driver/Test/PCI02000.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test2/NT_Driver/Test/PCI02000.bin -------------------------------------------------------------------------------- /chapter16/Test2/NT_Driver/Test/function.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "function.h" 5 | 6 | // DWORD ReadPort(HANDLE hDevice,DWORD port) 7 | // { 8 | // DWORD dwOutput; 9 | // DWORD dwRead; 10 | // DeviceIoControl(hDevice, IOCTL_READ_PORT_ULONG, &port, 4, &dwOutput, 4, &dwRead, NULL); 11 | // return dwOutput; 12 | // } 13 | // VOID WritePort(HANDLE hDevice,DWORD port,DWORD value) 14 | // { 15 | // PVOID buffer[2]; 16 | // buffer[0] = (PVOID)port; 17 | // buffer[1] = (PVOID)value; 18 | // DWORD dwWrite; 19 | // DeviceIoControl(hDevice, IOCTL_WRITE_PORT_ULONG, &port, 8, NULL, 0, &dwWrite, NULL); 20 | // } 21 | // VOID TestDriver(HANDLE hDevice) 22 | // { 23 | // DWORD dwOutput; 24 | // DeviceIoControl(hDevice, IOCTL_TEST, NULL, 0, NULL, 0, &dwOutput, NULL); 25 | // } 26 | 27 | -------------------------------------------------------------------------------- /chapter16/Test2/NT_Driver/Test/function.h: -------------------------------------------------------------------------------- 1 | #ifndef FUNCTION_H 2 | #define FUNCTION_H 3 | 4 | //#include "../MyDriver/Ioctls.h" 5 | 6 | DWORD ReadPort(HANDLE hDevice,DWORD port); 7 | VOID WritePort(HANDLE hDevice,DWORD port,DWORD value); 8 | VOID TestDriver(HANDLE hDevice); 9 | #endif -------------------------------------------------------------------------------- /chapter16/Test2/NT_Driver/Test/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test2/NT_Driver/Test/main.cpp -------------------------------------------------------------------------------- /chapter16/Test3/WDM_Driver/DriverDev.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "MyDriver"=".\MyDriver\MyDriver.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "Test"=".\Test\Test.dsp" - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | Begin Project Dependency 27 | Project_Dep_Name MyDriver 28 | End Project Dependency 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /chapter16/Test3/WDM_Driver/MyDriver/HelloWDM.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test3/WDM_Driver/MyDriver/HelloWDM.cpp -------------------------------------------------------------------------------- /chapter16/Test3/WDM_Driver/MyDriver/HelloWDM.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test3/WDM_Driver/MyDriver/HelloWDM.h -------------------------------------------------------------------------------- /chapter16/Test3/WDM_Driver/MyDriver/Ioctls.h: -------------------------------------------------------------------------------- 1 | // IOCTLS.H -- IOCTL code definitions for fileio driver 2 | // Copyright (C) 1999 by Walter Oney 3 | // All rights reserved 4 | 5 | #ifndef IOCTLS_H 6 | #define IOCTLS_H 7 | 8 | #ifndef CTL_CODE 9 | #pragma message("CTL_CODE undefined. Include winioctl.h or wdm.h") 10 | #endif 11 | 12 | #define IOCTL_READ_PORT_ULONG CTL_CODE(\ 13 | FILE_DEVICE_UNKNOWN, \ 14 | 0x800, \ 15 | METHOD_BUFFERED, \ 16 | FILE_ANY_ACCESS) 17 | 18 | #define IOCTL_WRITE_PORT_ULONG CTL_CODE(\ 19 | FILE_DEVICE_UNKNOWN, \ 20 | 0x801, \ 21 | METHOD_BUFFERED, \ 22 | FILE_ANY_ACCESS) 23 | 24 | #define IOCTL_TEST CTL_CODE(\ 25 | FILE_DEVICE_UNKNOWN, \ 26 | 0x802, \ 27 | METHOD_BUFFERED, \ 28 | FILE_ANY_ACCESS) 29 | 30 | #define IOCTL_TRANSMIT CTL_CODE(\ 31 | FILE_DEVICE_UNKNOWN, \ 32 | 0x803, \ 33 | METHOD_OUT_DIRECT, \ 34 | FILE_ANY_ACCESS) 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /chapter16/Test3/WDM_Driver/MyDriver/MyDriver_Check/HelloWDM.sbr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test3/WDM_Driver/MyDriver/MyDriver_Check/HelloWDM.sbr -------------------------------------------------------------------------------- /chapter16/Test3/WDM_Driver/MyDriver/guid.h: -------------------------------------------------------------------------------- 1 | // {0E57C50F-0CCC-4ad2-A895-93C5ED119860} 2 | DEFINE_GUID(MY_WDM_DEVICE, 0xe57c50f, 0xccc, 0x4ad2, 0xa8, 0x95, 0x93, 0xc5, 0xed, 0x11, 0x98, 0x60); 3 | 4 | -------------------------------------------------------------------------------- /chapter16/Test3/WDM_Driver/Test/function.h: -------------------------------------------------------------------------------- 1 | #ifndef FUNCTION_H 2 | #define FUNCTION_H 3 | 4 | #include 5 | #include 6 | #include "../MyDriver/Ioctls.h" 7 | 8 | HANDLE GetDeviceViaInterface( GUID* pGuid, DWORD instance); 9 | 10 | DWORD ReadPort(HANDLE hDevice,DWORD port); 11 | VOID WritePort(HANDLE hDevice,DWORD port,DWORD value); 12 | VOID TestDriver(HANDLE hDevice); 13 | #endif -------------------------------------------------------------------------------- /chapter16/Test3/WDM_Driver/Test/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "function.h" 6 | 7 | #include "../MyDriver/guid.h" 8 | 9 | int main() 10 | { 11 | HANDLE hDevice = GetDeviceViaInterface((LPGUID)&MY_WDM_DEVICE,0); 12 | 13 | if (hDevice == INVALID_HANDLE_VALUE) 14 | { 15 | printf("Failed to obtain file handle to device: " 16 | "%s with Win32 error code: %d\n", 17 | "MyWDMDevice", GetLastError() ); 18 | return 1; 19 | } 20 | 21 | CloseHandle(hDevice); 22 | return 0; 23 | } -------------------------------------------------------------------------------- /chapter16/Test4/DriverDev.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "MyDriver"=".\MyDriver\MyDriver.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "Test"=".\Test\Test.dsp" - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | Begin Project Dependency 27 | Project_Dep_Name MyDriver 28 | End Project Dependency 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /chapter16/Test4/MyDriver/HelloWDM.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test4/MyDriver/HelloWDM.cpp -------------------------------------------------------------------------------- /chapter16/Test4/MyDriver/HelloWDM.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test4/MyDriver/HelloWDM.h -------------------------------------------------------------------------------- /chapter16/Test4/MyDriver/Ioctls.h: -------------------------------------------------------------------------------- 1 | // IOCTLS.H -- IOCTL code definitions for fileio driver 2 | // Copyright (C) 1999 by Walter Oney 3 | // All rights reserved 4 | 5 | #ifndef IOCTLS_H 6 | #define IOCTLS_H 7 | 8 | #ifndef CTL_CODE 9 | #pragma message("CTL_CODE undefined. Include winioctl.h or wdm.h") 10 | #endif 11 | 12 | #define GET_PCI_CONFIG CTL_CODE(\ 13 | FILE_DEVICE_UNKNOWN, \ 14 | 0x800, \ 15 | METHOD_BUFFERED, \ 16 | FILE_ANY_ACCESS) 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /chapter16/Test4/MyDriver/MyDriver_Check/HelloWDM.sbr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test4/MyDriver/MyDriver_Check/HelloWDM.sbr -------------------------------------------------------------------------------- /chapter16/Test4/MyDriver/guid.h: -------------------------------------------------------------------------------- 1 | // {0E57C50F-0CCC-4ad2-A895-93C5ED119860} 2 | DEFINE_GUID(MY_WDM_DEVICE, 0xe57c50f, 0xccc, 0x4ad2, 0xa8, 0x95, 0x93, 0xc5, 0xed, 0x11, 0x98, 0x60); 3 | 4 | -------------------------------------------------------------------------------- /chapter16/Test4/Test/function.h: -------------------------------------------------------------------------------- 1 | #ifndef FUNCTION_H 2 | #define FUNCTION_H 3 | 4 | #include 5 | #include 6 | #include "../MyDriver/Ioctls.h" 7 | 8 | HANDLE GetDeviceViaInterface( GUID* pGuid, DWORD instance); 9 | 10 | DWORD ReadPort(HANDLE hDevice,DWORD port); 11 | VOID WritePort(HANDLE hDevice,DWORD port,DWORD value); 12 | VOID TestDriver(HANDLE hDevice); 13 | #endif -------------------------------------------------------------------------------- /chapter16/Test4/Test/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "function.h" 6 | 7 | #include "../MyDriver/guid.h" 8 | #include "../MyDriver/Ioctls.h" 9 | 10 | int main() 11 | { 12 | HANDLE hDevice = GetDeviceViaInterface((LPGUID)&MY_WDM_DEVICE,0); 13 | 14 | if (hDevice == INVALID_HANDLE_VALUE) 15 | { 16 | printf("Failed to obtain file handle to device: " 17 | "%s with Win32 error code: %d\n", 18 | "MyWDMDevice", GetLastError() ); 19 | return 1; 20 | } 21 | 22 | DWORD dRet; 23 | DeviceIoControl(hDevice,GET_PCI_CONFIG,NULL,0,NULL,0,&dRet,NULL); 24 | 25 | CloseHandle(hDevice); 26 | return 0; 27 | } -------------------------------------------------------------------------------- /chapter16/Test5/WDM_Driver/DriverDev.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "MyDriver"=".\MyDriver\MyDriver.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "Test"=".\Test\Test.dsp" - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | Begin Project Dependency 27 | Project_Dep_Name MyDriver 28 | End Project Dependency 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /chapter16/Test5/WDM_Driver/MyDriver/HelloWDM.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test5/WDM_Driver/MyDriver/HelloWDM.cpp -------------------------------------------------------------------------------- /chapter16/Test5/WDM_Driver/MyDriver/HelloWDM.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test5/WDM_Driver/MyDriver/HelloWDM.h -------------------------------------------------------------------------------- /chapter16/Test5/WDM_Driver/MyDriver/Ioctls.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test5/WDM_Driver/MyDriver/Ioctls.h -------------------------------------------------------------------------------- /chapter16/Test5/WDM_Driver/MyDriver/MyDriver_Check/HelloWDM.sbr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test5/WDM_Driver/MyDriver/MyDriver_Check/HelloWDM.sbr -------------------------------------------------------------------------------- /chapter16/Test5/WDM_Driver/MyDriver/guid.h: -------------------------------------------------------------------------------- 1 | // {0E57C50F-0CCC-4ad2-A895-93C5ED119860} 2 | DEFINE_GUID(MY_WDM_DEVICE, 0xe57c50f, 0xccc, 0x4ad2, 0xa8, 0x95, 0x93, 0xc5, 0xed, 0x11, 0x98, 0x60); 3 | 4 | -------------------------------------------------------------------------------- /chapter16/Test5/WDM_Driver/Test/function.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test5/WDM_Driver/Test/function.cpp -------------------------------------------------------------------------------- /chapter16/Test5/WDM_Driver/Test/function.h: -------------------------------------------------------------------------------- 1 | #ifndef FUNCTION_H 2 | #define FUNCTION_H 3 | 4 | #include 5 | #include 6 | #include "../MyDriver/Ioctls.h" 7 | 8 | HANDLE GetDeviceViaInterface( GUID* pGuid, DWORD instance); 9 | 10 | //Read 11 | ULONG ReadFromBase0(HANDLE handle,ULONG Offset,UCHAR *buff,ULONG length); 12 | ULONG ReadFromBase2(HANDLE handle,ULONG Offset,UCHAR *buff,ULONG length); 13 | 14 | UCHAR ReadByteFromBase0(HANDLE handle,ULONG Offset); 15 | UCHAR ReadByteFromBase2(HANDLE handle,ULONG Offset); 16 | 17 | //Write 18 | ULONG WriteToBase0(HANDLE handle,ULONG Offset,UCHAR *buff,ULONG length); 19 | ULONG WriteToBase2(HANDLE handle,ULONG Offset,UCHAR *buff,ULONG length); 20 | 21 | BOOL WriteByteToBase0(HANDLE handle,ULONG Offset,UCHAR input); 22 | BOOL WriteByteToBase2(HANDLE handle,ULONG Offset,UCHAR input); 23 | BOOL WriteDwordToBase0(HANDLE handle,ULONG Offset,DWORD input); 24 | BOOL WriteDwordToBase2(HANDLE handle,ULONG Offset,DWORD input); 25 | 26 | //Other 27 | ULONG ReadImage(HANDLE handle,UCHAR *buff); 28 | ULONG WriteImage(HANDLE handle,UCHAR *buff); 29 | 30 | BOOL EnableInt(HANDLE handle); 31 | BOOL DisableInt(HANDLE handle); 32 | 33 | #endif -------------------------------------------------------------------------------- /chapter16/Test5/WDM_Driver/Test/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter16/Test5/WDM_Driver/Test/main.cpp -------------------------------------------------------------------------------- /chapter17/exe/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source 3 | # file to this component. This file merely indirects to the real make file 4 | # that is shared by all the driver components of the Windows NT DDK 5 | # 6 | 7 | !INCLUDE $(NTMAKEENV)\makefile.def 8 | 9 | -------------------------------------------------------------------------------- /chapter17/exe/rwbulk.rc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | #define VER_FILETYPE VFT_DLL 6 | #define VER_FILESUBTYPE VFT2_UNKNOWN 7 | #define VER_FILEDESCRIPTION_STR "I82930 Bulk Read and Write test App" 8 | #define VER_INTERNALNAME_STR "RwBulk.sys" 9 | #define VER_ORIGINALFILENAME_STR "RwBulk.sys" 10 | 11 | #include 12 | 13 | 14 | -------------------------------------------------------------------------------- /chapter17/exe/sources: -------------------------------------------------------------------------------- 1 | 2 | TARGETNAME=RwBulk 3 | TARGETTYPE=PROGRAM 4 | 5 | UMTYPE=console 6 | UMBASE=0x01000000 7 | 8 | TARGETPATH=obj 9 | 10 | INCLUDES=..\sys 11 | 12 | 13 | TARGETLIBS= $(DDK_LIB_PATH)\usbd.lib \ 14 | $(SDK_LIB_PATH)\setupapi.lib 15 | 16 | SOURCES= \ 17 | RwBulk.c \ 18 | RwBulk.rc 19 | 20 | -------------------------------------------------------------------------------- /chapter17/sys/bulkrwr.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) 2000 Microsoft Corporation 4 | 5 | Module Name: 6 | 7 | bulkrwr.h 8 | 9 | Abstract: 10 | 11 | Environment: 12 | 13 | Kernel mode 14 | 15 | Notes: 16 | 17 | Copyright (c) 2000 Microsoft Corporation. 18 | All Rights Reserved. 19 | 20 | --*/ 21 | #ifndef _BULKUSB_RWR_H 22 | #define _BULKUSB_RWR_H 23 | 24 | typedef struct _BULKUSB_RW_CONTEXT { 25 | 26 | PURB Urb; 27 | PMDL Mdl; 28 | ULONG Length; // remaining to xfer 29 | ULONG Numxfer; // cumulate xfer 30 | ULONG_PTR VirtualAddress; // va for next segment of xfer. 31 | PDEVICE_EXTENSION DeviceExtension; 32 | 33 | } BULKUSB_RW_CONTEXT, * PBULKUSB_RW_CONTEXT; 34 | 35 | PBULKUSB_PIPE_CONTEXT 36 | BulkUsb_PipeWithName( 37 | IN PDEVICE_OBJECT DeviceObject, 38 | IN PUNICODE_STRING FileName 39 | ); 40 | 41 | NTSTATUS 42 | BulkUsb_DispatchReadWrite( 43 | IN PDEVICE_OBJECT DeviceObject, 44 | IN PIRP Irp 45 | ); 46 | 47 | NTSTATUS 48 | BulkUsb_ReadWriteCompletion( 49 | IN PDEVICE_OBJECT DeviceObject, 50 | IN PIRP Irp, 51 | IN PVOID Context 52 | ); 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /chapter17/sys/bulkusb.mof: -------------------------------------------------------------------------------- 1 | [Dynamic, Provider("WMIProv"), 2 | WMI, 3 | Description("Bulk Usb driver for Intel 82930"), 4 | guid("{BBA21300-6DD3-11d2-B844-00C04FAD5171}"), 5 | locale("MS\\0x409")] 6 | class BulkDeviceInformation 7 | { 8 | [key, read] 9 | string InstanceName; 10 | 11 | [read] boolean Active; 12 | 13 | [WmiDataId(1), 14 | read, 15 | write, 16 | Description("The DebugPrintLevel property indicates the debug output level of the generic client driver.") 17 | ] 18 | uint32 DebugPrintLevel; 19 | 20 | [WmiDataId(2), 21 | read, 22 | Description("ModelName") 23 | ] 24 | string ModelName; 25 | 26 | }; 27 | -------------------------------------------------------------------------------- /chapter17/sys/bulkusb.rc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | #define VER_FILETYPE VFT_DRV 6 | #define VER_FILESUBTYPE VFT2_DRV_SYSTEM 7 | #define VER_FILEDESCRIPTION_STR "BulkUsb Driver" 8 | #define VER_INTERNALNAME_STR "bulkusb.sys" 9 | #define VER_ORIGINALFILENAME_STR "bulkusb.sys" 10 | 11 | #include "common.ver" 12 | 13 | MofResourceName MOFDATA bulkusb.bmf 14 | 15 | -------------------------------------------------------------------------------- /chapter17/sys/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source 3 | # file to this component. This file merely indirects to the real make file 4 | # that is shared by all the driver components of the Windows NT DDK 5 | # 6 | 7 | !INCLUDE $(NTMAKEENV)\makefile.def 8 | 9 | -------------------------------------------------------------------------------- /chapter17/sys/makefile.inc: -------------------------------------------------------------------------------- 1 | mofcomp: bulkusb.bmf 2 | 3 | bulkusb.bmf: bulkusb.mof 4 | mofcomp -B:bulkusb.bmf bulkusb.mof 5 | wmimofck bulkusb.bmf 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /chapter17/sys/sources: -------------------------------------------------------------------------------- 1 | TARGETNAME=bulkusb 2 | TARGETTYPE=DRIVER 3 | DDKROOT=$(_NTDRIVE)$(_NTROOT) 4 | 5 | C_DEFINES= $(C_DEFINES) -DWMI_SUPPORT -DUSB2 6 | 7 | TARGETPATH=obj 8 | 9 | INCLUDES=$(DDKROOT)\private\ntos\inc; \ 10 | ..\..\inc 11 | 12 | NTTARGETFILE0=mofcomp 13 | 14 | USE_MAPSYM=1 15 | 16 | TARGETLIBS=$(DDK_LIB_PATH)\hidclass.lib \ 17 | $(DDK_LIB_PATH)\usbd.lib \ 18 | $(DDK_LIB_PATH)\ntoskrnl.lib 19 | 20 | MSC_WARNING_LEVEL=/W3 /WX 21 | 22 | SOURCES=bulkusb.c \ 23 | bulkpnp.c \ 24 | bulkpwr.c \ 25 | bulkdev.c \ 26 | bulkwmi.c \ 27 | bulkrwr.c \ 28 | bulkusb.rc 29 | -------------------------------------------------------------------------------- /chapter18/SDIO_Driver/HelloWDM.inf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter18/SDIO_Driver/HelloWDM.inf -------------------------------------------------------------------------------- /chapter18/SDIO_Driver/Ioctls.h: -------------------------------------------------------------------------------- 1 | // IOCTLS.H -- IOCTL code definitions for fileio driver 2 | // Copyright (C) 1999 by Walter Oney 3 | // All rights reserved 4 | 5 | #ifndef IOCTLS_H 6 | #define IOCTLS_H 7 | 8 | #ifndef CTL_CODE 9 | #pragma message("CTL_CODE undefined. Include winioctl.h or wdm.h") 10 | #endif 11 | 12 | #define IOCTL_ENABLE_INT CTL_CODE(\ 13 | FILE_DEVICE_UNKNOWN, \ 14 | 0x800, \ 15 | METHOD_BUFFERED, \ 16 | FILE_ANY_ACCESS) 17 | 18 | #define IOCTL_DISABLE_INT CTL_CODE(\ 19 | FILE_DEVICE_UNKNOWN, \ 20 | 0x801, \ 21 | METHOD_BUFFERED, \ 22 | FILE_ANY_ACCESS) 23 | 24 | #define IOCTL_READ_FROM_101 CTL_CODE(\ 25 | FILE_DEVICE_UNKNOWN, \ 26 | 0x802, \ 27 | METHOD_DIRECT, \ 28 | FILE_ANY_ACCESS) 29 | #endif 30 | -------------------------------------------------------------------------------- /chapter18/SDIO_Driver/Sdiousb.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter18/SDIO_Driver/Sdiousb.cpp -------------------------------------------------------------------------------- /chapter18/SDIO_Driver/Sources: -------------------------------------------------------------------------------- 1 | TARGETNAME=HelloWDM 2 | TARGETTYPE=DRIVER 3 | DRIVERTYPE=WDM 4 | TARGETPATH=OBJ 5 | 6 | 7 | INCLUDES=$(BASEDIR)\inc\ddk\wnet 8 | 9 | SOURCES=Sdiousb.cpp\ 10 | 11 | TARGETLIBS=$(DDK_LIB_PATH)\sdbus.lib \ -------------------------------------------------------------------------------- /chapter18/SDIO_Driver/buildchk_wnet_x86.wrn: -------------------------------------------------------------------------------- 1 | warnings in directory c:\winddk\6000\sdio_client 2 | c:\winddk\6000\sdio_client\sdiousb.cpp(197) : warning C4996: 'ExAllocatePool' was declared deprecated 3 | -------------------------------------------------------------------------------- /chapter18/SDIO_Driver/buildchk_wxp_x86.log: -------------------------------------------------------------------------------- 1 | BUILD: Computing Include file dependencies: 2 | BUILD: Examining c:\winddk\6000\chapter18\sdio_driver directory for files to compile. 3 | before AssemblyIdentity_AfterReadAllSources 4 | after AssemblyIdentity_AfterReadAllSources 5 | skipping post pass 0 command 6 | Compiling and Linking c:\winddk\6000\chapter18\sdio_driver ************* 7 | 'nmake.exe /nologo BUILDMSG=Stop. -i BUILD_PASS=PASS2 LINKONLY=1 NOPASS0=1 MAKEDIR_RELATIVE_TO_BASEDIR=chapter18\sdio_driver MAKEDIR_LOWERCASE=c:\winddk\6000\chapter18\sdio_driver' 8 | c:\winddk\6000\chapter18\sdio_driver: TARGETPATH is OBJ 9 | BUILDMSG: _NT_TARGET_VERSION SET TO WINXP 10 | -------------------------------------------------------------------------------- /chapter18/SDIO_Driver/guid.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | DEFINE_GUID (GUID_DEVINTERFACE_SDIO_DEVICE, 4 | 0x4d36e97d, 0xe325, 0x11ce, 0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18); 5 | //{4d36e97d-e325-11ce-bfc1-08002be10318} -------------------------------------------------------------------------------- /chapter18/SDIO_Driver/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # DO NOT EDIT THIS FILE!!! Edit .\sources. If you want to add a new source 3 | # file to this component. This file merely indirects to the real make file 4 | # that is shared by all the driver components of the Windows NT DDK 5 | # 6 | 7 | !INCLUDE $(NTMAKEENV)\makefile.def -------------------------------------------------------------------------------- /chapter18/SDIO_Driver/objchk_wxp_x86/i386/_objects.mac: -------------------------------------------------------------------------------- 1 | MUI_386_OBJECTS= 2 | 3 | 386_OBJECTS= \ 4 | $O\sdiousb.obj 5 | 6 | 7 | 8 | 9 | # lowercased 10 | BASEDIR=c:\winddk\6000 11 | OBJECT_ROOT=c:\winddk\6000 12 | MAKEDIR_LOWERCASE=c:\winddk\6000\chapter18\sdio_driver 13 | MAKEDIR_RELATIVE_TO_BASEDIR=chapter18\sdio_driver 14 | OBJ_PATH=c:\winddk\6000\chapter18\sdio_driver 15 | -------------------------------------------------------------------------------- /chapter18/Test/Test.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "Test"=.\Test.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /chapter18/Test/function.h: -------------------------------------------------------------------------------- 1 | #ifndef FUNCTION_H 2 | #define FUNCTION_H 3 | 4 | #include 5 | #include 6 | #include "../SDIO_Driver/Ioctls.h" 7 | 8 | HANDLE GetDeviceViaInterface( GUID* pGuid, DWORD instance); 9 | 10 | VOID EnableInt(HANDLE hDevice); 11 | VOID DisableInt(HANDLE hDevice); 12 | #endif -------------------------------------------------------------------------------- /chapter18/Test/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "function.h" 6 | 7 | #include "../SDIO_Driver/guid.h" 8 | #define BUFFER_SIZE 0x7c00 9 | UCHAR buffer[BUFFER_SIZE]; 10 | 11 | int main() 12 | { 13 | HANDLE hDevice = GetDeviceViaInterface((LPGUID)&GUID_DEVINTERFACE_SDIO_DEVICE,0); 14 | 15 | if (hDevice == INVALID_HANDLE_VALUE) 16 | { 17 | printf("Failed to obtain file handle to device: " 18 | "%s with Win32 error code: %d\n", 19 | "MyWDMDevice", GetLastError() ); 20 | return 1; 21 | } 22 | 23 | EnableInt(hDevice); 24 | 25 | Sleep(2000); 26 | 27 | DWORD dwRead; 28 | ReadFile(hDevice,buffer,BUFFER_SIZE,&dwRead,NULL); 29 | printf("read %x\n",dwRead); 30 | 31 | DisableInt(hDevice); 32 | 33 | CloseHandle(hDevice); 34 | 35 | return 0; 36 | 37 | } -------------------------------------------------------------------------------- /chapter18/说明.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter18/说明.txt -------------------------------------------------------------------------------- /chapter19/Virtual_COM/DriverDev.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=.\DriverDev.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /chapter19/Virtual_COM/HelloWDM.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter19/Virtual_COM/HelloWDM.cpp -------------------------------------------------------------------------------- /chapter19/Virtual_COM/HelloWDM.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter19/Virtual_COM/HelloWDM.h -------------------------------------------------------------------------------- /chapter19/Virtual_COM/HelloWDM.inf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter19/Virtual_COM/HelloWDM.inf -------------------------------------------------------------------------------- /chapter19/Virtual_COM/说明.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter19/Virtual_COM/说明.txt -------------------------------------------------------------------------------- /chapter20/testcap/makefile: -------------------------------------------------------------------------------- 1 | #==========================================================================; 2 | # 3 | # THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY 4 | # KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 5 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR 6 | # PURPOSE. 7 | # 8 | # Copyright (c) 1992 - 1999 Microsoft Corporation. All Rights Reserved. 9 | # 10 | #==========================================================================; 11 | 12 | !IFDEF WIN95_BUILD 13 | 14 | ROOT = ..\..\..\.. 15 | IS_32 = TRUE 16 | IS_OEM = TRUE 17 | DEVICEDIR = testcap 18 | COMMONMKFILE = testcap.mk 19 | DEPENDTARGETS = debug retail 20 | 21 | !include ..\..\..\..\dev\master.mk 22 | 23 | !ELSE 24 | 25 | # 26 | # DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source 27 | # file to this component. This file merely indirects to the real make file 28 | # that is shared by all the driver components of the Windows NT DDK 29 | # 30 | 31 | !INCLUDE $(NTMAKEENV)\makefile.def 32 | 33 | !ENDIF 34 | 35 | 36 | -------------------------------------------------------------------------------- /chapter20/testcap/mediums.h: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /chapter20/testcap/objchk_wxp_x86/_objects.mac: -------------------------------------------------------------------------------- 1 | 386_OBJECTS= \ 2 | $(_OBJ_DIR)\i386\testcap.res \ 3 | $(_OBJ_DIR)\i386\capmain.obj \ 4 | $(_OBJ_DIR)\i386\capirq.obj \ 5 | $(_OBJ_DIR)\i386\capvideo.obj \ 6 | $(_OBJ_DIR)\i386\capxfer.obj \ 7 | $(_OBJ_DIR)\i386\capprop.obj \ 8 | $(_OBJ_DIR)\i386\ddraw.obj 9 | 10 | PASS0_386_OBJECTS= 11 | 12 | IA64_OBJECTS= \ 13 | $(_OBJ_DIR)\ia64\testcap.res \ 14 | $(_OBJ_DIR)\ia64\capmain.obj \ 15 | $(_OBJ_DIR)\ia64\capirq.obj \ 16 | $(_OBJ_DIR)\ia64\capvideo.obj \ 17 | $(_OBJ_DIR)\ia64\capxfer.obj \ 18 | $(_OBJ_DIR)\ia64\capprop.obj \ 19 | $(_OBJ_DIR)\ia64\ddraw.obj 20 | 21 | PASS0_IA64_OBJECTS= 22 | 23 | AMD64_OBJECTS= \ 24 | $(_OBJ_DIR)\amd64\testcap.res \ 25 | $(_OBJ_DIR)\amd64\capmain.obj \ 26 | $(_OBJ_DIR)\amd64\capirq.obj \ 27 | $(_OBJ_DIR)\amd64\capvideo.obj \ 28 | $(_OBJ_DIR)\amd64\capxfer.obj \ 29 | $(_OBJ_DIR)\amd64\capprop.obj \ 30 | $(_OBJ_DIR)\amd64\ddraw.obj 31 | 32 | PASS0_AMD64_OBJECTS= 33 | 34 | ARM_OBJECTS= \ 35 | $(_OBJ_DIR)\arm\testcap.res \ 36 | $(_OBJ_DIR)\arm\capmain.obj \ 37 | $(_OBJ_DIR)\arm\capirq.obj \ 38 | $(_OBJ_DIR)\arm\capvideo.obj \ 39 | $(_OBJ_DIR)\arm\capxfer.obj \ 40 | $(_OBJ_DIR)\arm\capprop.obj \ 41 | $(_OBJ_DIR)\arm\ddraw.obj 42 | 43 | PASS0_ARM_OBJECTS= 44 | 45 | -------------------------------------------------------------------------------- /chapter20/testcap/objchk_wxp_x86/i386/testcap.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter20/testcap/objchk_wxp_x86/i386/testcap.res -------------------------------------------------------------------------------- /chapter20/testcap/sources: -------------------------------------------------------------------------------- 1 | #==========================================================================; 2 | # 3 | # THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY 4 | # KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 5 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR 6 | # PURPOSE. 7 | # 8 | # Copyright (c) 1992 - 1999 Microsoft Corporation. All Rights Reserved. 9 | # 10 | #==========================================================================; 11 | TARGETNAME=TestCap 12 | TARGETTYPE=DRIVER 13 | DRIVERTYPE=WDM 14 | TARGETPATH=obj 15 | 16 | C_DEFINES=-DPNP_POWER 17 | MSC_WARNING_LEVEL=/W3 /WX 18 | 19 | TARGETLIBS=$(DDK_LIB_PATH)\stream.lib \ 20 | $(DDK_LIB_PATH)\ksguid.lib \ 21 | $(DDK_LIB_PATH)\dxapi.lib 22 | 23 | SOURCES= \ 24 | capmain.c \ 25 | capirq.c \ 26 | capvideo.c \ 27 | capxfer.c \ 28 | capprop.c \ 29 | ddraw.c \ 30 | testcap.rc 31 | 32 | -------------------------------------------------------------------------------- /chapter20/testcap/testcap.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter20/testcap/testcap.htm -------------------------------------------------------------------------------- /chapter20/testcap/testcap.rc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | #define VER_FILETYPE VFT_DLL 6 | #define VER_FILESUBTYPE VFT2_UNKNOWN 7 | #define VER_FILEDESCRIPTION_STR "WDM Video Capture Driver" 8 | #define VER_INTERNALNAME_STR "testcap.sys" 9 | #define VER_ORIGINALFILENAME_STR "testcap.sys" 10 | 11 | #include "common.ver" 12 | 13 | -------------------------------------------------------------------------------- /chapter22/FileFilter/Driver.h: -------------------------------------------------------------------------------- 1 | // Declarations for filter driver 2 | 3 | // Copyright (C) 1999 by Walter Oney 4 | 5 | // All rights reserved 6 | 7 | 8 | 9 | #ifndef DRIVER_H 10 | 11 | #define DRIVER_H 12 | 13 | 14 | 15 | #define DRIVERNAME "MyFileFilter(zhangfan!)" // for use in messages 16 | 17 | 18 | 19 | /////////////////////////////////////////////////////////////////////////////// 20 | 21 | // Device extension structure 22 | 23 | 24 | 25 | typedef struct tagDEVICE_EXTENSION { 26 | 27 | PDEVICE_OBJECT DeviceObject; // device object this extension belongs to 28 | 29 | PDEVICE_OBJECT LowerDeviceObject; // next lower driver in same stack 30 | 31 | PDEVICE_OBJECT Pdo; // the PDO 32 | 33 | IO_REMOVE_LOCK RemoveLock; 34 | 35 | } DEVICE_EXTENSION, *PDEVICE_EXTENSION; 36 | 37 | 38 | 39 | /////////////////////////////////////////////////////////////////////////////// 40 | 41 | // Global functions 42 | 43 | 44 | 45 | VOID RemoveDevice(IN PDEVICE_OBJECT fdo); 46 | 47 | NTSTATUS CompleteRequest(IN PIRP Irp, IN NTSTATUS status, IN ULONG_PTR info); 48 | 49 | NTSTATUS DispatchForSCSI(IN PDEVICE_OBJECT fido, IN PIRP Irp); 50 | 51 | #endif // DRIVER_H 52 | 53 | -------------------------------------------------------------------------------- /chapter22/FileFilter/DriverEntry.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter22/FileFilter/DriverEntry.cpp -------------------------------------------------------------------------------- /chapter22/FileFilter/MyFilter.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "MyFilter"=".\MyFilter.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /chapter22/FileFilter/filter.inf: -------------------------------------------------------------------------------- 1 | [Version] 2 | Signature=$CHICAGO$ 3 | Provider=%MFGNAME% 4 | 5 | [DestinationDirs] 6 | DefaultDestDir=10,system32\drivers 7 | FiltJectCopyFiles=11 8 | 9 | [SourceDisksFiles] 10 | MyFilter.sys=1 11 | 12 | [SourceDisksNames] 13 | 1=%INSTDISK%,,,MyFilter_Check 14 | 15 | ;------------------------------------------------------------------------------ 16 | ; Windows 2000 Sections 17 | ;------------------------------------------------------------------------------ 18 | 19 | [DefaultInstall.ntx86] 20 | CopyFiles=DriverCopyFiles,FiltJectCopyFiles 21 | 22 | [DriverCopyFiles] 23 | MyFilter.sys,,,0x60 ; replace newer, suppress dialog 24 | 25 | [DefaultInstall.ntx86.services] 26 | AddService=MyFilter,,FilterService 27 | 28 | [FilterService] 29 | ServiceType=1 30 | StartType=3 31 | ErrorControl=1 32 | ServiceBinary=%10%\system32\drivers\MyFilter.sys 33 | 34 | ;------------------------------------------------------------------------------ 35 | ; String Definitions 36 | ;------------------------------------------------------------------------------ 37 | 38 | [Strings] 39 | MFGNAME="Zhangfan Software" 40 | INSTDISK="Zhangfan Disc" 41 | DESCRIPTION="Sample File Filter Driver" 42 | -------------------------------------------------------------------------------- /chapter22/FileFilter/stddcls.cpp: -------------------------------------------------------------------------------- 1 | // stddcls.cpp -- Precompiled header stub for WDM driver 2 | // Copyright (C) 1999 by Walter Oney 3 | // All rights reserved 4 | 5 | #include "stddcls.h" 6 | -------------------------------------------------------------------------------- /chapter22/FileFilter/stddcls.h: -------------------------------------------------------------------------------- 1 | // stddcls.h -- Precompiled headers for WDM drivers 2 | // Copyright (C) 1999 by Walter Oney 3 | // All rights reserved 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #pragma warning(disable:4201) // nameless struct/union 10 | #define DEPRECATE_DDK_FUNCTIONS 1 11 | 12 | #include 13 | #include 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | 19 | #define PAGEDCODE code_seg("PAGE") 20 | #define LOCKEDCODE code_seg() 21 | #define INITCODE code_seg("INIT") 22 | 23 | #define PAGEDDATA data_seg("PAGEDATA") 24 | #define LOCKEDDATA data_seg() 25 | #define INITDATA data_seg("INITDATA") 26 | 27 | #define arraysize(p) (sizeof(p)/sizeof((p)[0])) 28 | 29 | #if DBG && defined(_X86_) 30 | #undef ASSERT 31 | #define ASSERT(e) if(!(e)){DbgPrint("Assertion failure in "\ 32 | __FILE__ ", line %d: " #e "\n", __LINE__);\ 33 | _asm int 3\ 34 | } 35 | #endif 36 | -------------------------------------------------------------------------------- /chapter22/KeyFilter/MAKEFILE: -------------------------------------------------------------------------------- 1 | # 2 | # DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source 3 | # file to this component. This file merely indirects to the real make file 4 | # that is shared by all the driver components of the Windows NT DDK 5 | # 6 | 7 | !INCLUDE $(NTMAKEENV)\makefile.def 8 | -------------------------------------------------------------------------------- /chapter22/KeyFilter/SOURCES: -------------------------------------------------------------------------------- 1 | C_DEFINES=/DWIN2K=1 2 | TARGETNAME=ctrl2cap 3 | TARGETPATH=obj 4 | TARGETTYPE=DRIVER 5 | 6 | SOURCES=ctrl2cap.c ctrl2cap.rc 7 | -------------------------------------------------------------------------------- /chapter22/KeyFilter/ctrl2cap.rc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define VER_DEBUG 0 4 | #define VER_PRERELEASE 0 5 | #define VER_FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 6 | #define VER_FILEOS VOS_NT_WINDOWS32 7 | #define VER_FILEFLAGS (VER_PRERELEASE|VER_DEBUG) 8 | 9 | #define VER_FILETYPE VFT_DRV 10 | #define VER_FILESUBTYPE VFT2_DRV_SYSTEM 11 | 12 | #define VER_COMPANYNAME_STR "Systems Internals" 13 | #define VER_PRODUCTNAME_STR "Ctrl2cap" 14 | #define VER_LEGALCOPYRIGHT_YEARS "1996-1999" 15 | #define VER_LEGALCOPYRIGHT_STR "Copyright (C) M. Russinovich" VER_LEGALCOPYRIGHT_YEARS 16 | #define VER_LEGALTRADEMARKS_STR "Copyright (C) 1996-1999 Mark Russinovich" 17 | 18 | #define VER_PRODUCTVERSION 2,00,00,00 19 | #define VER_PRODUCTVERSION_STR "2.00" 20 | #define VER_PRODUCTVERSION_W (0x02000) 21 | #define VER_PRODUCTVERSION_DW (0x02000) 22 | #define VER_FILEDESCRIPTION_STR "Windows NT Caps-lock Ctrl Swapper" 23 | #define VER_INTERNALNAME_STR "ctrl2cap.sys" 24 | #define VER_ORIGINALFILENAME_STR "ctrl2cap.Sys" 25 | 26 | #include "common.ver" 27 | 28 | -------------------------------------------------------------------------------- /chapter22/KeyFilter/objchk_wxp_x86/_objects.mac: -------------------------------------------------------------------------------- 1 | 386_OBJECTS= \ 2 | $(_OBJ_DIR)\i386\ctrl2cap.res \ 3 | $(_OBJ_DIR)\i386\ctrl2cap.obj 4 | 5 | PASS0_386_OBJECTS= 6 | 7 | IA64_OBJECTS= \ 8 | $(_OBJ_DIR)\ia64\ctrl2cap.res \ 9 | $(_OBJ_DIR)\ia64\ctrl2cap.obj 10 | 11 | PASS0_IA64_OBJECTS= 12 | 13 | AMD64_OBJECTS= \ 14 | $(_OBJ_DIR)\amd64\ctrl2cap.res \ 15 | $(_OBJ_DIR)\amd64\ctrl2cap.obj 16 | 17 | PASS0_AMD64_OBJECTS= 18 | 19 | ARM_OBJECTS= \ 20 | $(_OBJ_DIR)\arm\ctrl2cap.res \ 21 | $(_OBJ_DIR)\arm\ctrl2cap.obj 22 | 23 | PASS0_ARM_OBJECTS= 24 | 25 | -------------------------------------------------------------------------------- /chapter22/KeyFilter/objchk_wxp_x86/i386/ctrl2cap.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter22/KeyFilter/objchk_wxp_x86/i386/ctrl2cap.res -------------------------------------------------------------------------------- /chapter23/ErrorTest/DriverDev.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=.\DriverDev.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /chapter23/ErrorTest/HelloWDM.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter23/ErrorTest/HelloWDM.cpp -------------------------------------------------------------------------------- /chapter23/ErrorTest/HelloWDM.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter23/ErrorTest/HelloWDM.h -------------------------------------------------------------------------------- /chapter23/ErrorTest/HelloWDM.inf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter23/ErrorTest/HelloWDM.inf -------------------------------------------------------------------------------- /chapter23/ErrorTest/说明.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter23/ErrorTest/说明.txt -------------------------------------------------------------------------------- /chapter23/ErrorTest2/DriverDev.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DriverDev"=.\DriverDev.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /chapter23/ErrorTest2/HelloWDM.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter23/ErrorTest2/HelloWDM.cpp -------------------------------------------------------------------------------- /chapter23/ErrorTest2/HelloWDM.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter23/ErrorTest2/HelloWDM.h -------------------------------------------------------------------------------- /chapter23/ErrorTest2/HelloWDM.inf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter23/ErrorTest2/HelloWDM.inf -------------------------------------------------------------------------------- /chapter23/ErrorTest2/说明.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/chapter23/ErrorTest2/说明.txt -------------------------------------------------------------------------------- /readme.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/readme.doc -------------------------------------------------------------------------------- /笔记/第1课.pps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limin1224/Windows-Driver-Development-Internals/3c119e041d95e9c54be367050634e458aceaa342/笔记/第1课.pps --------------------------------------------------------------------------------