jeudi 29 mai 2014

fenêtre - DDK échantillon passthru ne pas chargé dans win7 - Stack Overflow


I am developing a driver based on ddk sample "passthru" and I have trouble loading this driver in win7(x86 or x64). I have tested my driver in winxp (x86 and x64), and it works pretty well, but when I tried to load this driver into win7 (F8->Disable Driver Signature Enforcement), it seemed failed. Then, I tried the native passthru code, it also failed. I thought it failed because



  1. I can not see any outputs using KdPrint fron windbg.

  2. I can not see any useful information from system event.

  3. I set a breakpoint on passthru!DriverEntry, it seems that DriverEntry has not been called.


My WDK is 7600.16385.1, and passthru is supposed to be compatible with win7. I compile passthru using command "build -cZ". Could you help me understanding this problem, or any clue about why passthru not loaded in win7?


I have built this driver in win7 x86 checked build environment, and tested in win7 x86.


Solved: Actually, the driver has been loaded, but the output of KdPrint not shown in win7 by default, you should use KdPrintEx to specify message level, or modify registry to make debug message shown. Now I have no idea why bp failed either.




Normally you can't use a driver that was built for WinXP target on a Win7 machine. Rebuild for Win7 target.




Well your question is rather unspecific, but I see one particular problem here: Enabling test-signing and disabling kernel mode signing policy still requires you to sign the binary ... (after WHQL-tests MS would cross-sign the .cat file for the driver). Refer to this.


See:



For 64-bit versions of Windows Vista and later versions of Windows, the kernel-mode code signing policy requires that all kernel-mode code have a digital signature.



and:



The operating system loader and the kernel load drivers that are signed by any certificate. The certificate validation is not required to chain up to a trusted root certification authority. However, each driver image file must have a digital signature.



These commands should allow to load a driver signed with anything


bcdedit.exe -set loadoptions DDISABLE_INTEGRITY_CHECKS
bcdedit.exe -set TESTSIGNING ON



You don't mention what target OS you chose when building. Icepack mentioned it. You need to actually build for Windows 7 to make it work with the new NDIS 6.0. Simply loading a driver built for XP (and older NDIS version) may not work at all.


My suggestion, use DDKBUILD.CMD and build one driver with (free build, W7):


ddkbuild.cmd -W7 fre . -cZ

and one with (free build, WXP)


ddkbuild.cmd -W7XP fre . -cZ

the above command line already takes into account the WDK you have. Note that if DDKBUILD.CMD fails to detect your installed WDK you'll have to set the environment variable W7BASE to point to the folder in which the WDK is installed (the one with install.htm, usually something like C:\WINDDK\7600.16385.1).



I am developing a driver based on ddk sample "passthru" and I have trouble loading this driver in win7(x86 or x64). I have tested my driver in winxp (x86 and x64), and it works pretty well, but when I tried to load this driver into win7 (F8->Disable Driver Signature Enforcement), it seemed failed. Then, I tried the native passthru code, it also failed. I thought it failed because



  1. I can not see any outputs using KdPrint fron windbg.

  2. I can not see any useful information from system event.

  3. I set a breakpoint on passthru!DriverEntry, it seems that DriverEntry has not been called.


My WDK is 7600.16385.1, and passthru is supposed to be compatible with win7. I compile passthru using command "build -cZ". Could you help me understanding this problem, or any clue about why passthru not loaded in win7?


I have built this driver in win7 x86 checked build environment, and tested in win7 x86.


Solved: Actually, the driver has been loaded, but the output of KdPrint not shown in win7 by default, you should use KdPrintEx to specify message level, or modify registry to make debug message shown. Now I have no idea why bp failed either.



Normally you can't use a driver that was built for WinXP target on a Win7 machine. Rebuild for Win7 target.



Well your question is rather unspecific, but I see one particular problem here: Enabling test-signing and disabling kernel mode signing policy still requires you to sign the binary ... (after WHQL-tests MS would cross-sign the .cat file for the driver). Refer to this.


See:



For 64-bit versions of Windows Vista and later versions of Windows, the kernel-mode code signing policy requires that all kernel-mode code have a digital signature.



and:



The operating system loader and the kernel load drivers that are signed by any certificate. The certificate validation is not required to chain up to a trusted root certification authority. However, each driver image file must have a digital signature.



These commands should allow to load a driver signed with anything


bcdedit.exe -set loadoptions DDISABLE_INTEGRITY_CHECKS
bcdedit.exe -set TESTSIGNING ON



You don't mention what target OS you chose when building. Icepack mentioned it. You need to actually build for Windows 7 to make it work with the new NDIS 6.0. Simply loading a driver built for XP (and older NDIS version) may not work at all.


My suggestion, use DDKBUILD.CMD and build one driver with (free build, W7):


ddkbuild.cmd -W7 fre . -cZ

and one with (free build, WXP)


ddkbuild.cmd -W7XP fre . -cZ

the above command line already takes into account the WDK you have. Note that if DDKBUILD.CMD fails to detect your installed WDK you'll have to set the environment variable W7BASE to point to the folder in which the WDK is installed (the one with install.htm, usually something like C:\WINDDK\7600.16385.1).


0 commentaires:

Enregistrer un commentaire