Help with KMDF Disk Filter Driver - BSOD after install

Hello everyone,
I’m trying to realize a simple KMDF Disk Filter Driver that “logs” all the write operations in a sector bitmap, but I’m having troubles in installing and testing it.
I started from the KMDF sample in this article:
http://www.osronline.com/article.cfm?article=446

My code is the same as the article above, I’ve just excluded the user mode code (buffers to comunicate to user mode apps, etc.) and kept just WdfFltrRead function in the queue (no write, no devicecontrol events) to test if driver works and then proceed with my develop.
Then, I copied the .inf file from the DiskPerf example and adapted to my situation and installed the driver inside my test Hyper-V vm. The result was just a blue screen with the error INACCESSIBLE_BOOT_DEVICE.

Can someone help me to understand how to install correctly the driver and also if there are some parts in the code that I have to change in order to adapt the code to my situation?

Thank you to all in advance that will help me.
Best regards.

Andrew

Please can someone help me? I keep getting INACCESSIBLE_BOOT_DEVICE after every attempt of installing a disk driver.

(I deleted your other post because it’s not helpful to post the same question multiple times)

Which version of Windows? Is your driver properly signed?

  1. In all cases, this question is better place inside NTFSD group.
  2. The article that you took from 2006. Probably better to start from same DDK example?

@Michael_Grabelkovsky said:

  1. In all cases, this question is better place inside NTFSD group.
  2. The article that you took from 2006. Probably better to start from same DDK example?

Hello Michael, I posted inside the NTDEV section as I’m not developing a file system driver, but a disk filter driver.
I already managed to realize a fs minifilter, but I need a driver that stay at the level of the disks and register all I/O operations at the level of blocks (or sectors).
I know, the article is quite old but was then updated, and I’m following many examples, tutorial, but all of them at the end have problems when attaching to the boot disk (including DiskPerf example provided by Microsoft).

@andrewDrv said:
Please can someone help me? I keep getting INACCESSIBLE_BOOT_DEVICE after every attempt of installing a disk driver.

Hi Scott, the other post was a similar question, but not the same… anyway, the problem is connected.
The disk driver is properly signed but I’m running Windows 10 in test mode, so no signature problems.

The problem is that, as I told in the other post, the driver makes the boot disk inaccessible on Windows boot and infact there are no problems if I install (attach) the driver to a data disk (I mean, not the boot disk).
I’ve read that the INACCESSIBLE_BOOT_DEVICE error code can be given when the driver creates a “delay” in the boot of Windows… so if this is the problem… how can I avoid it?

Thanks in advance to all of you for your help.

Your filter is not available at boot. Thus the dreaded 7B.

Mark Roddy

@Mark_Roddy said:
Your filter is not available at boot. Thus the dreaded 7B.

Mark Roddy

What does it mean? How can I make it available at boot? Can it be something wrong during the installation or something inside the driver code?

andrewDrv wrote:

@Mark_Roddy said:
> Your filter is not available at boot. Thus the dreaded 7B.
What does it mean? How can I make it available at boot? Can it be something wrong during the installation or something inside the driver code?

How did you install your driver, exactly?  Remember, it’s not enough
just to specify a file system path.  At the time your driver needs to
load, there ARE no disks.  There are no file systems.  “C:” means nothing.

Is KMDF even possible in a boot-disk filter driver?

It is as long as all the components are present.

Mark Roddy

Enable boot debugging and see if your DriverEntry is being called::

bcdedit /bootdebug on

@Tim_Roberts said:
How did you install your driver, exactly? Remember, it’s not enough
just to specify a file system path. At the time your driver needs to
load, there ARE no disks. There are no file systems. “C:” means nothing.
Is KMDF even possible in a boot-disk filter driver?

I used the “default” installation by installing the driver as a kernel service (sc command) and then used the “AddFilter” exe (taken from the AddFilter project) to install driver as a filter on disk devices.
About the KMDF being possible on the boot disk, I know that it should be (if not, Microsoft probably would have warned about that on some documentation). Furthermore, I get the same error (INACCESSIBLE_BOOT_DEVICE) also on DiskPerf example that is a WDM driver… so I don’t thinks that KMDF is the problem.

@Mark_Roddy said:
It is as long as all the components are present.

So you think that probably there are some components missing? How can I know it? I will try to debug boot (as suggested by Scott below) to see if the driver at least passes through its entry function or blocks before being called.

@“Scott_Noone_(OSR)” said:
Enable boot debugging and see if your DriverEntry is being called::
bcdedit /bootdebug on

Thanks for the suggestion Scott, I enabled boot mode but I didn’t think about debug boot… I will try and let you know.

Hello, finally to install my KMDF correctly without getting any boot error. Just installed the driver as kernel driver with “sc create” and specified boot start, then used “AddFilter” to add it as upper filter (as I have to handle I/O operations, if you need to handle SCSI operations, install it as lower filter).

Hi, I have a WDM lower filter disk driver that I am trying to convert to KMDF. I am having heck of a time creating the INF file that works. The WDM driver works great.

I see great parallels between what you are doing with the upper filter and mine with the lower filter.
Can you echo your commands on how you used sc create and the AddFilter?. I see the AddFilter code does have support to add as lower filter but I am not sure how to use it to add a lower filter disk driver.

Thanks,
RK