0

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.

Jeff Zhou
  • 9
  • 3

2 Answers2

0

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

SomeWittyUsername
  • 18,025
  • 3
  • 42
  • 85
  • I have built this driver in win7 x86 checked build environment, but it failed to be loaded. – Jeff Zhou Oct 22 '12 at 09:21
  • @0xC0000022L The question was about NDIS driver. Win7 has NDIS 6.x and WinXP has NDIS 5.x which is deprecated for anything above WinXP. I wouldn't recommend relying on the outcome of such usage even if it might appear working. – SomeWittyUsername Oct 22 '12 at 09:21
  • @JeffZhou look in the event viewer to see anything related to your driver. Also, do you see the driver in device manager? If so, does it have the 'yellow bang'? – SomeWittyUsername Oct 22 '12 at 09:24
  • I find nothing useful in event viewer. I can see "Passthru" device object using winobj, I can not see driver in device manager, could you tell me how to find a driver in device manager? – Jeff Zhou Oct 22 '12 at 09:38
  • You should see NDIS drivers under 'Network adapters'. If you don't see it there I suppose there is something wrong with your installation. – SomeWittyUsername Oct 22 '12 at 11:16
0

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).

Community
  • 1
  • 1
0xC0000022L
  • 20,597
  • 9
  • 86
  • 152
  • @icepack? So? Let me quote the linked document: "However, **in most cases**, an unsigned driver can be installed and loaded on 32-bit versions of Windows Vista and later versions of Windows." ... I'd rather do it by the book to find out I did something unnecessary instead of finding out that ignoring simple steps causes failure. Have been burned in the past by these particular MS-related issues. – 0xC0000022L Oct 22 '12 at 09:31
  • I run bcdedit.exe as you mentioned above, but still not worked. Should i use NDIS 6.x for win7? I noticed WDK documented that passthru example is supported in win7, but why i can not load it. – Jeff Zhou Oct 22 '12 at 10:07
  • Jeff: you are leaving out important facts from your question, as I wrote. What target do you build for? See, icepack has made a very good point. The driver model differs between pre-Vista and post-Vista for NDIS. So your build should account for that. I'll edit my answer. – 0xC0000022L Oct 22 '12 at 10:39
  • I have built this driver in win7 x86 checked build environment – Jeff Zhou Oct 22 '12 at 10:47
  • @Jeff: then it should be the signature issue. What does the event log say? Your question is really rather vague given the depth of the problem. – 0xC0000022L Oct 22 '12 at 10:50