64 bit disk filter driver

I am trying to implement diskperf like filter driver for 64 bit version of windows 7. The driver building did not give any issue. I signed the driver and verified the signing on the test system. Everytime the system start’s up it crashes with a bug INACCESSIBLE_BOOT_DEVICE. I am assuming this is a driver signing issue as I’ve tested the code on a 32 bit machine and it works fine.

I wanted to ask the following query regarding this issue.

  1. Is “amd64\signTool verify /a /v /pa” the correct command for verifying that a driver is signed or should it just “signTool verify /a”
  2. Is there any technical issue that would prevent a diskperf like driver in the 64 bit version (Microsoft haven’t given any sample code in this DDK)
  3. Is there any alternative solution that is close to a filter driver. Perhaps something which can be dynamically loaded and unloaded.

Regards

I use:

signtool verify /kp /v mydriver.sys

and that seems to work.

Absolutely not. No problem writing a 64-bit filter.

No, sorry.

If I may offer a suggestion? Forget about the signature crap while developing. Hook up the kernel debugger, and enable debugging AND boot debugging (both) on the target machine. Your life will instantly be easier.

Peter
OSR

I am assuming it is test signed. Have you ensured that the test signing is
turned on using bcdedit? Or follow Peter’s suggestion of hooking up a
kernel debugger.

I also import the signing certificate in the ‘trusted root’ store.

On Mon, Aug 20, 2012 at 11:38 AM, wrote:

>


>
> I use:
>
> signtool verify /kp /v mydriver.sys
>
> and that seems to work.
>
>


>
> Absolutely not. No problem writing a 64-bit filter.
>
>


>
> No, sorry.
>
> If I may offer a suggestion? Forget about the signature crap while
> developing. Hook up the kernel debugger, and enable debugging AND boot
> debugging (both) on the target machine. Your life will instantly be easier.
>
> Peter
> OSR
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

Thank you for your replies. It is a huge relief that the 64 bit should therotically work. Now the ugly part of practically getting it to work :).

Peter, I’ve verified my driver with your command and it seems to be fine. Atul, I have a real certificate and have imported it in the trusted root store. I’ve also connected WinDbg and verified the code on a 32 bit machine.

I had the following queries regarding your replies:

  1. In order to enable boot debuggint do I have to do anything other than run “bcdedit /set bootdebug on” on the test machine
  2. The debugger stack trace says that it died while running the “PnpBootDeviceWait” function. Is the PnP handling of the 64 bit any way different from the 32 bit.

Regards

No, that should be all you have to do, since you’ve already got regular kd
working, apparently.

Good luck,

mm

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@coventry.ac.uk
Sent: Tuesday, August 21, 2012 4:03 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] 64 bit disk filter driver

Thank you for your replies. It is a huge relief that the 64 bit should
therotically work. Now the ugly part of practically getting it to work :).

Peter, I’ve verified my driver with your command and it seems to be fine.
Atul, I have a real certificate and have imported it in the trusted root
store. I’ve also connected WinDbg and verified the code on a 32 bit machine.

I had the following queries regarding your replies:

  1. In order to enable boot debuggint do I have to do anything other than
    run “bcdedit /set bootdebug on” on the test machine 2. The debugger stack
    trace says that it died while running the “PnpBootDeviceWait” function. Is
    the PnP handling of the 64 bit any way different from the 32 bit.

Regards


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Right. And reboot.

Nope. Nothing’s different.

Now, this assumes that you’re using the proper data types … and using them correctly … for 64-bit. Don’t forget, for example, little things like the fact that Irp->IoStatus.Information is a ULONG_PTR (not an ULONG). Assuming you’re not “casting away” error reports from the compiler, you should be OK.

And was your driver on the stack? What functions in your driver had executed or were waiting to execute at this point?

I’m thinking you have a bug in both your 32-bit and 64-bit driver, but it’s only being triggered on 64-bit due to timing differences or whatever.

This isn’t a “64-bit is different” type of thing… because it 64-bit Windows ISN’T different.

Peter
OSR

64 bit diskperf should work without any issues. I have ran it many times.

Try ‘ctrl+alt+k’ on windbg so that it breaks in when the first symbol is
loaded (before your driver is loaded)

Then put a break point on your DriverEntry/AddDevice/PnP Dispatch function
and see if they all go through successfully.

On Tue, Aug 21, 2012 at 7:08 PM, wrote:

>


>
> Right. And reboot.
>
>


>
> Nope. Nothing’s different.
>
> Now, this assumes that you’re using the proper data types … and using
> them correctly … for 64-bit. Don’t forget, for example, little things
> like the fact that Irp->IoStatus.Information is a ULONG_PTR (not an ULONG).
> Assuming you’re not “casting away” error reports from the compiler, you
> should be OK.
>
>


>
> And was your driver on the stack? What functions in your driver had
> executed or were waiting to execute at this point?
>
> I’m thinking you have a bug in both your 32-bit and 64-bit driver, but
> it’s only being triggered on 64-bit due to timing differences or whatever.
>
> This isn’t a “64-bit is different” type of thing… because it 64-bit
> Windows ISN’T different.
>
> Peter
> OSR
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

Thank you for your replies the driver works now. I really don’t know what did the trick but like you suggested Peter I started from scratch and got a version woking on the 32 bit machine. I then deleted all the certificates and re-installed them. Atul thank you for ‘ctrl+alt+k’ hint. Its a neat little trick, I realized that my driver wasn’t called at all using it.

I believe these could be one of the possible reasons that my attempts didn’t work

  1. Did not run the inf file (Did the registry changes & copied the file manually)
  2. Did not install cross-certificate in the test machine (Had only checked the certificate each time)
  3. I may still be using the test signing mode (Currently that is on and I really don’t know what it does)

I will do a clean install to understand this better. Right now I am just happy that the whole thing worked. Thank you for all your help, would have struggled with this much longer without your replies.

Regards

Hi Josh,

I have the same problem with diskperf on Windows 2008R2 x64 “INACCESSIBLE_BOOT_DEVICE”,
have you got it running on 64bit os now?