Installing KMDF Volume Filter

Hi there

I wrote a simple KMDF driver which does nothing but have DriverEntry and EvtDeviceAdd routine. I am installing it as a volume filter. I used OSR sample WDFFLTRINSTALL.EXE to install the filter and i changed the file version in the sample to KMDF 1.7.

Then i added registry entry under

HKLM\System\CurrentControlSet\Control\Class{71a27cdd-812a-11d0-bec7-08002be2092f} and added the service name under “UpperFilter” manually.

When i restarted the system it just crashed. I also tried using the diskperf.inf file by adding some CoInstaller sections in it and installing it by right clicking it . But the result was same.

I am not sure whether the problem is in the driver or the install process. Any suggestions would be helpful.

Thanks
Suhail

Look at the crash with the debugger. Post the output of the !Analyze -v
command.

Bill Wandel

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com]
On Behalf Of xxxxx@hotmail.com
Sent: Tuesday, December 02, 2008 6:41 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Installing KMDF Volume Filter

Hi there

I wrote a simple KMDF driver which does nothing but have DriverEntry and
EvtDeviceAdd routine. I am installing it as a volume filter. I used OSR
sample WDFFLTRINSTALL.EXE to install the filter and i changed the file
version in the sample to KMDF 1.7.

Then i added registry entry under

HKLM\System\CurrentControlSet\Control\Class{71a27cdd-812a-11d0-bec7-08002be
2092f} and added the service name under “UpperFilter” manually.

When i restarted the system it just crashed. I also tried using the
diskperf.inf file by adding some CoInstaller sections in it and installing
it by right clicking it . But the result was same.

I am not sure whether the problem is in the driver or the install process.
Any suggestions would be helpful.

Thanks
Suhail


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

Does your driver even load? Generally if you get a load failure at this
point (for example because the kmdf dll is not setup as boot start or not
installed at all, or your driver is not setup as boot start) you will get a
7B bugcheck.
The difficulty of filter installation is yet another adoption issue for
kmdf. Of course there would be no difficulty of a static link option were
available.

Mark Roddy

On Tue, Dec 2, 2008 at 6:40 PM, wrote:

> Hi there
>
> I wrote a simple KMDF driver which does nothing but have DriverEntry and
> EvtDeviceAdd routine. I am installing it as a volume filter. I used OSR
> sample WDFFLTRINSTALL.EXE to install the filter and i changed the file
> version in the sample to KMDF 1.7.
>
> Then i added registry entry under
>
> HKLM\System\CurrentControlSet\Control\Class{71a27cdd-812a-11d0-bec7-08002be2092f}
> and added the service name under “UpperFilter” manually.
>
> When i restarted the system it just crashed. I also tried using the
> diskperf.inf file by adding some CoInstaller sections in it and installing
> it by right clicking it . But the result was same.
>
> I am not sure whether the problem is in the driver or the install process.
> Any suggestions would be helpful.
>
> Thanks
> Suhail
>
> —
> 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
>

You have to invoke the coinstaller if you want KMDF. I don’t expect that to change in the foreseeable future. If you are doing filter drivers installed in this fashion, you have to either follow the method used in the WDK nonPnP sample [and make sure you mark your service as boot start so the coinstaller marks KMDF sa boot start as well], or install another WDK sample driver on the machine first [and yes, you had best modify that sample so it installs as boot start for the same reason].

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Mark Roddy
Sent: Tuesday, December 02, 2008 4:05 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Installing KMDF Volume Filter

Does your driver even load? Generally if you get a load failure at this point (for example because the kmdf dll is not setup as boot start or not installed at all, or your driver is not setup as boot start) you will get a 7B bugcheck.

The difficulty of filter installation is yet another adoption issue for kmdf. Of course there would be no difficulty of a static link option were available.

Mark Roddy

On Tue, Dec 2, 2008 at 6:40 PM, > wrote:
Hi there

I wrote a simple KMDF driver which does nothing but have DriverEntry and EvtDeviceAdd routine. I am installing it as a volume filter. I used OSR sample WDFFLTRINSTALL.EXE to install the filter and i changed the file version in the sample to KMDF 1.7.

Then i added registry entry under

HKLM\System\CurrentControlSet\Control\Class{71a27cdd-812a-11d0-bec7-08002be2092f} and added the service name under “UpperFilter” manually.

When i restarted the system it just crashed. I also tried using the diskperf.inf file by adding some CoInstaller sections in it and installing it by right clicking it . But the result was same.

I am not sure whether the problem is in the driver or the install process. Any suggestions would be helpful.

Thanks
Suhail


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

— 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

I found one problem. I installed this driver as a demand start and that is why i think it was failing on the boot. Once i installed it as a boot start there were no crash during the boot.

Here is the code from the sample file from OSR article.

VOID DoInstallation( VOID) {

SC_HANDLE schService;
WCHAR windowsDir[512];
WCHAR fullDriverPath[512];

//
// Because we’re doing the entire installation ourselves,
// copy the file to system32\drivers
//
if (!GetWindowsDirectory(windowsDir, 512)) {
return;
}

swprintf(fullDriverPath, L"%ls\system32\drivers\%ls",
windowsDir, SYSFile);

if (!CopyFile(SYSFile, fullDriverPath, FALSE)) {
return;
}

//
// Call the coinstaller for pre-install
//
if (WdfPreDeviceInstallPtr(INFFileWithPath, INFSectionName)) {
return;
}

//
// Create the service entry for the driver
//
schService = CreateService (SCManager,
ServiceName,
ServiceName,
SERVICE_ALL_ACCESS,
SERVICE_KERNEL_DRIVER,
IsDemand ?
SERVICE_DEMAND_START :
SERVICE_BOOT_START,
SERVICE_ERROR_NORMAL,
fullDriverPath,
NULL,
NULL,
NULL,
NULL,
NULL);

if (!schService) {
return;
}

CloseServiceHandle (schService);

if (WdfPostDeviceInstallPtr(INFFileWithPath, INFSectionName)) {
return;
}
}

I add the upper filter key manually.