unable to load custom disk driver

Hi, I have written a port filter driver that translates the pnp-ids of selected disks
to “IDE\MyDisk, MyDisk” and for those disks I intend to load my own disk driver. I use
DriverPackageInstall to install my disk driver. It all works as expected on all the
win 7 64-bit machines (with Intel, MS port drivers) tested so far. But on this particular
win 7 64-bit machine which has AMD’s port driver (and an AMD port filter), I see that windows
does not load my class driver for these disks even though pnp ids have been translated properly.
These disks are not claimed by my disk driver.

!devnode gives me the following:

0: kd> !DevNode fffffa80048ab980
DevNode 0xfffffa80048ab980 for PDO 0xfffffa80048a99d0
Parent 0xfffffa80039cab10 Sibling 0xfffffa80048ac980 Child 0000000000
InstancePath is “IDE\MyDisk\4&efa9814&0&010000”
State = DeviceNodeInitialized (0x302)
Previous State = DeviceNodeUninitialized (0x301)
StateHistory[00] = DeviceNodeUninitialized (0x301)
StateHistory[19] = Unknown State (0x0)
StateHistory[18] = Unknown State (0x0)
StateHistory[17] = Unknown State (0x0)
StateHistory[16] = Unknown State (0x0)
StateHistory[15] = Unknown State (0x0)
StateHistory[14] = Unknown State (0x0)
StateHistory[13] = Unknown State (0x0)
StateHistory[12] = Unknown State (0x0)
StateHistory[11] = Unknown State (0x0)
StateHistory[10] = Unknown State (0x0)
StateHistory[09] = Unknown State (0x0)
StateHistory[08] = Unknown State (0x0)
StateHistory[07] = Unknown State (0x0)
StateHistory[06] = Unknown State (0x0)
StateHistory[05] = Unknown State (0x0)
StateHistory[04] = Unknown State (0x0)
StateHistory[03] = Unknown State (0x0)
StateHistory[02] = Unknown State (0x0)
StateHistory[01] = Unknown State (0x0)
Flags (0x00002030) DNF_ENUMERATED, DNF_IDS_QUERIED,
DNF_HAS_PROBLEM
CapabilityFlags (0x00000180) SilentInstall, RawDeviceOK
Problem = CM_PROB_REGISTRY

The last line as per msdn makes me beleive that there is something wrong
with the inf of my disk class driver. Can anyone help me what is wrong
I’m doing? Below is the inf file. Thank you.

; Copyright (c) Microsoft, Inc. 2010

[Version]
Signature=“$WINDOWS NT$”
Class=MyDisk
ClassGUID={ED485AF6-3917-5e2c-BCAD-56F7B1527C41}

Provider=%Microsoft%
DriverVer=02/18/2011,1.0.0.0
CatalogFile=mydisk.cat

[ClassInstall32]
AddReg=ClassAddReg

[ClassAddReg]
HKR,%ClassName%
HKR,SilentInstall,1
HKR,NoInstallClass,1
HKR,Icon,“-9”

[DestinationDirs]
DefaultDestDir = 12 ; DIRID_DRIVERS

[SourceDisksNames.x86]
1=%diskid1%,\i386

[SourceDisksNames.amd64]
1=%diskid1%,\amd64

[SourceDisksNames.ia64]
1=%diskid1%,\ia64

[SourceDisksFiles]
mydisk.sys= 1

[Manufacturer]
%Microsoft%=Microsoft,NTx86,NTamd64

[Microsoft.NTx86]
%MyDiskDesc% = mydisk_Inst, MyDisk

[Microsoft.NTamd64]
%MyDiskDesc% = mydisk_Inst, MyDisk

;****************************************************
; Generic
[mydisk_Inst]
CopyFiles = @mydisk.sys

[mydisk_Inst.Services]
AddService = mydisk, %SPSVCINST_ASSOCSERVICE%, mydisk_Service_Inst

[mydisk_Service_Inst]
ServiceType = %SERVICE_KERNEL_DRIVER%
StartType = %SERVICE_BOOT_START%
ErrorControl = %SERVICE_ERROR_CRITICAL%
ServiceBinary = %12%\mydisk.sys
AddReg = mydisk_addreg

[mydisk_addreg]

[Strings]
;Localizable
Microsoft=“Microsoft”
diskid1=“Microsoft Inc Installation Disk # 1 (My Disk Driver)”
MyDiskDesc= “My Disk Device”
ClassName=“My Disk Devices”

;*******************************************
;Non-localizable, Handy macro substitutions
SPSVCINST_ASSOCSERVICE = 0x00000002
SERVICE_KERNEL_DRIVER = 1
SERVICE_BOOT_START = 0
SERVICE_DEMAND_START = 3
SERVICE_SYSTEM_START = 1
SERVICE_ERROR_NORMAL = 1
SERVICE_ERROR_CRITICAL = 3
REG_EXPAND_SZ = 0x00020000
REG_DWORD = 0x00010001
REG_MULTI_SZ = 0x00010000

  1. did this inf file pass checkinf?

  2. what is in setupapi.dev.log?

Mark Roddy

On Mon, Feb 21, 2011 at 11:13 PM, wrote:
> Hi, I have written a port filter driver that translates the pnp-ids of selected disks
> to “IDE\MyDisk, MyDisk” and for those disks I intend to load my own disk driver. I use
> DriverPackageInstall to install my disk driver. It all works as expected on all the
> win 7 64-bit machines (with Intel, MS port drivers) tested so far. But on this particular
> win 7 64-bit machine which has AMD’s port driver (and an AMD port filter), I see that windows
> does not load my class driver for these disks even though pnp ids have been translated properly.
> These disks are not claimed by my disk driver.
>
> !devnode gives me the following:
>
> 0: kd> !DevNode fffffa80048ab980
> DevNode 0xfffffa80048ab980 for PDO 0xfffffa80048a99d0
> ?Parent 0xfffffa80039cab10 ? Sibling 0xfffffa80048ac980 ? Child 0000000000
> ?InstancePath is “IDE\MyDisk\4&efa9814&0&010000”
> ?State = DeviceNodeInitialized (0x302)
> ?Previous State = DeviceNodeUninitialized (0x301)
> ?StateHistory[00] = DeviceNodeUninitialized (0x301)
> ?StateHistory[19] = Unknown State (0x0)
> ?StateHistory[18] = Unknown State (0x0)
> ?StateHistory[17] = Unknown State (0x0)
> ?StateHistory[16] = Unknown State (0x0)
> ?StateHistory[15] = Unknown State (0x0)
> ?StateHistory[14] = Unknown State (0x0)
> ?StateHistory[13] = Unknown State (0x0)
> ?StateHistory[12] = Unknown State (0x0)
> ?StateHistory[11] = Unknown State (0x0)
> ?StateHistory[10] = Unknown State (0x0)
> ?StateHistory[09] = Unknown State (0x0)
> ?StateHistory[08] = Unknown State (0x0)
> ?StateHistory[07] = Unknown State (0x0)
> ?StateHistory[06] = Unknown State (0x0)
> ?StateHistory[05] = Unknown State (0x0)
> ?StateHistory[04] = Unknown State (0x0)
> ?StateHistory[03] = Unknown State (0x0)
> ?StateHistory[02] = Unknown State (0x0)
> ?StateHistory[01] = Unknown State (0x0)
> ?Flags (0x00002030) ?DNF_ENUMERATED, DNF_IDS_QUERIED,
> ? ? ? ? ? ? ? ? ? ? ?DNF_HAS_PROBLEM
> ?CapabilityFlags (0x00000180) ?SilentInstall, RawDeviceOK
> ?Problem = CM_PROB_REGISTRY
>
>
> The last line as per msdn makes me beleive that there is something wrong
> with the inf of my disk class driver. Can anyone help me what is wrong
> I’m doing? Below is the inf file. Thank you.
>
>
>
> ; Copyright (c) Microsoft, Inc. 2010
>
> [Version]
> Signature=“$WINDOWS NT$”
> Class=MyDisk
> ClassGUID={ED485AF6-3917-5e2c-BCAD-56F7B1527C41}
>
> Provider=%Microsoft%
> DriverVer=02/18/2011,1.0.0.0
> CatalogFile=mydisk.cat
>
> [ClassInstall32]
> AddReg=ClassAddReg
>
> [ClassAddReg]
> HKR,%ClassName%
> HKR,SilentInstall,1
> HKR,NoInstallClass,1
> HKR,Icon,“-9”
>
> [DestinationDirs]
> DefaultDestDir = 12 ; DIRID_DRIVERS
>
> [SourceDisksNames.x86]
> 1=%diskid1%,\i386
>
> [SourceDisksNames.amd64]
> 1=%diskid1%,\amd64
>
> [SourceDisksNames.ia64]
> 1=%diskid1%,\ia64
>
> [SourceDisksFiles]
> mydisk.sys= 1
>
> [Manufacturer]
> %Microsoft%=Microsoft,NTx86,NTamd64
>
> [Microsoft.NTx86]
> %MyDiskDesc% = mydisk_Inst, MyDisk
>
> [Microsoft.NTamd64]
> %MyDiskDesc% = mydisk_Inst, MyDisk
>
> ;*********
> ; Generic
> [mydisk_Inst]
> CopyFiles = @mydisk.sys
>
> [mydisk_Inst.Services]
> AddService = mydisk, %SPSVCINST_ASSOCSERVICE%, mydisk_Service_Inst
>
> [mydisk_Service_Inst]
> ServiceType ? ?= %SERVICE_KERNEL_DRIVER%
> StartType ? ? = %SERVICE_BOOT_START%
> ErrorControl ?= %SERVICE_ERROR_CRITICAL%
> ServiceBinary ?= %12%\mydisk.sys
> AddReg ? ? ? ? = mydisk_addreg
>
> [mydisk_addreg]
>
>
> [Strings]
> ;Localizable
> Microsoft=“Microsoft”
> diskid1=“Microsoft Inc Installation Disk # 1 (My Disk Driver)”
> MyDiskDesc= “My Disk Device”
> ClassName=“My Disk Devices”
>
> ;

> ;Non-localizable, Handy macro substitutions
> SPSVCINST_ASSOCSERVICE = 0x00000002
> SERVICE_KERNEL_DRIVER ?= 1
> SERVICE_BOOT_START ? ? = 0
> SERVICE_DEMAND_START ?= 3
> SERVICE_SYSTEM_START ?= 1
> SERVICE_ERROR_NORMAL ? = 1
> SERVICE_ERROR_CRITICAL = 3
> REG_EXPAND_SZ ? ? ? ? ?= 0x00020000
> REG_DWORD ? ? ? ? ? ? ?= 0x00010001
> REG_MULTI_SZ ? ? ? ? ? = 0x00010000
>
>
>
> —
> 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
>

  1. chkinf gave the following warning but I think that is because of the new GUID. Also it complained about the company name as Microsoft which I changed but same behavior.

Warnings:
Line 5: (W22.1.2215) Class MyDisk (ClassGUID {ED485AF6-3917-5e2c-BCAD-56F7B1527C41}) is unrecognized.

  1. setupapi log showed status as sucessful.

Try to debug your driver to see if DriverEntry and all necessary dispatch routines called. Also try to set up check build version of disk.sys and if available check build of AMD drivers. Try to compare debug output messages from Intel machine and AMD. Debug information may help you to analyze the problem.

Igor Sharovar

Thank you Igor. I do not have access to the checked build of AMD drivers. But one thing I noticed is that AMD port filter is a device filter while my port filter is a port class filter. When I change my port fltr also to a port device filter every thing works fine as expected. I’m not sure if this is some kind of a timing problem.

can you please clarify which debug messages are you talking about? Thank you.

>can you please clarify which debug messages are you talking about? Thank you.
A check build version of driver may output debug messages. The check build of Windows contains check build version of Windows components. Using such drivers together with WinDbg may help to get more information about a problem.
Where do you install your filter driver in Windows register? Try to do it manually.

Igor Sharovar