I have a problem with a device driver that I am trying to get working on
WinXP.
This driver ‘works’ on Win2K. It was originally a NT4 driver and was
upgraded
by following guidelines in Walter Oney’s book Programming WDM, second
edition,
Chapter 11, Mutifunction devices.
The device driver implements two devices, one the primary (fdo) and
second the ‘child’
(pdo) device. Primary is chained into drivers stack. At StartDevice()
call, the child
device is created. It is created with a name and a symbolic link. Child
has its own ISR.
INF file is provided that deals with primary device only.
If I complete IRP_MN_QUERY_ID with status unsupported, the two devices
are usable under WIn2K but NOT under WinXP. Under WinXP the primary
device object can be examined in WinObj but child device cannot be
exmined or
opened.
If I implement IRP_MN_QUERY_ID to return dummy BusQueryInstanceID,
BusQueryDeviceID, BusQueryHardwareIDs I will get a ‘New Device found’
(unknown type) dialog.
If I ‘borrow’ hardware ID for primary (fdo) device from INF file things will
progess to a point where .SYS file is (re)installed for child device.
DeviceManager
in Computer Management now shows two identical devices, which was not
intended.
This was the behavior on Win2K. On WinXP a fault occured because my
StartDevice
was invoked unexpectedly, and it mishandled the situation.
Looking at Win2K debug trace for same indicated that it too had
StartDevice() invoked
for second time but due to lucky circumstances the device was deemed
invalid and
code did not fail.
Clearly if my child device was meant to be activated via StartDevice(),
Win2K still allowed it
to be opened and used without invocation of StartDevice(). WinXp does
not allow this.
Now, If I handle StartDevice() correctly things should be ok but what of
device naming?
Is there anything I can do to force system to use my (unique) device
name I gave to the
child at time I created it with IoCreateDevice() call.
I do want to avoid having device name entries in DeviceManager and I
want to avoid
the "New Device Found’ dialog for this child device.
ned
> If I complete IRP_MN_QUERY_ID with status unsupported, the two devices
are usable under WIn2K but NOT under WinXP.
For a parent, pass QUERY_ID down together with most other PnP IRPs.
For a child, you must handle QUERY_ID and report some IDs of your own - like
MYBUS\ChildDevice. Look at Toaster bus driver sample for details.
If I implement IRP_MN_QUERY_ID to return dummy BusQueryInstanceID,
BusQueryDeviceID, BusQueryHardwareIDs I will get a ‘New Device found’
(unknown type) dialog.
Correct. This must be so. Your INF file must provide the information about this
ID.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
I have a proper INF file now but child object is still inaccessible
under XP.
Under Win2K I can examine SymLink objects under ?? and actual devices under
\Device tree, using WinObj utility.
Under WinXP Both SymLinks look identical to Win2K onese except they are in
GLOBAL??. They can both be examined with WinObj.
Actual primary (fdo) object and child (pdo) objects are under \Device,
as I expect
them to be. I can examine primary with WinObj OK but I get an error
“Unable to Open \Device\MyChild” if I double-click on child.
Using a win32 test app top open child device, GetLastError() return 2,
“The system cannot find the file specified”.
Presumably WinXP PnP manager has somehow made the pdo unusable for
actual access.
Has anyone got any suggestions?
ned
Maxim S. Shatskih wrote:
>If I complete IRP_MN_QUERY_ID with status unsupported, the two devices
>are usable under WIn2K but NOT under WinXP.
>
>
For a parent, pass QUERY_ID down together with most other PnP IRPs.
For a child, you must handle QUERY_ID and report some IDs of your own - like
MYBUS\ChildDevice. Look at Toaster bus driver sample for details.
>If I implement IRP_MN_QUERY_ID to return dummy BusQueryInstanceID,
>BusQueryDeviceID, BusQueryHardwareIDs I will get a ‘New Device found’
>(unknown type) dialog.
>
>
Correct. This must be so. Your INF file must provide the information about this
ID.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@colorts.com.au
To unsubscribe send a blank email to xxxxx@lists.osr.com
Use the PnP device interfaces instead of manually created symlinks.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: “ned kacavenda”
To: “Windows System Software Devs Interest List”
Sent: Monday, July 19, 2004 8:15 AM
Subject: Re: [ntdev] IRP_MN_QUERY_ID handling problem
>
> I have a proper INF file now but child object is still inaccessible
> under XP.
>
> Under Win2K I can examine SymLink objects under ?? and actual devices under
> \Device tree, using WinObj utility.
>
> Under WinXP Both SymLinks look identical to Win2K onese except they are in
> GLOBAL??. They can both be examined with WinObj.
> Actual primary (fdo) object and child (pdo) objects are under \Device,
> as I expect
> them to be. I can examine primary with WinObj OK but I get an error
> “Unable to Open \Device\MyChild” if I double-click on child.
>
> Using a win32 test app top open child device, GetLastError() return 2,
> “The system cannot find the file specified”.
>
> Presumably WinXP PnP manager has somehow made the pdo unusable for
> actual access.
>
> Has anyone got any suggestions?
>
>
> ned
>
>
>
> Maxim S. Shatskih wrote:
>
> >>If I complete IRP_MN_QUERY_ID with status unsupported, the two devices
> >>are usable under WIn2K but NOT under WinXP.
> >>
> >>
> >
> >For a parent, pass QUERY_ID down together with most other PnP IRPs.
> >
> >For a child, you must handle QUERY_ID and report some IDs of your own - like
> >MYBUS\ChildDevice. Look at Toaster bus driver sample for details.
> >
> >
> >
> >>If I implement IRP_MN_QUERY_ID to return dummy BusQueryInstanceID,
> >>BusQueryDeviceID, BusQueryHardwareIDs I will get a ‘New Device found’
> >>(unknown type) dialog.
> >>
> >>
> >
> >Correct. This must be so. Your INF file must provide the information about
this
> >ID.
> >
> >Maxim Shatskih, Windows DDK MVP
> >StorageCraft Corporation
> >xxxxx@storagecraft.com
> >http://www.storagecraft.com
> >
> >
> >—
> >Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
> >
> >You are currently subscribed to ntdev as: xxxxx@colorts.com.au
> >To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >
> >
> >
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
I do not see that this would resolve the issue as manually created
symbolic link does not seem to have
a problem, it is the device object itself that seems to have a problem.
ned
Maxim S. Shatskih wrote:
Use the PnP device interfaces instead of manually created symlinks.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: “ned kacavenda”
>To: “Windows System Software Devs Interest List”
>Sent: Monday, July 19, 2004 8:15 AM
>Subject: Re: [ntdev] IRP_MN_QUERY_ID handling problem
>
>
>
>
>>I have a proper INF file now but child object is still inaccessible
>>under XP.
>>
>>Under Win2K I can examine SymLink objects under ?? and actual devices under
>>\Device tree, using WinObj utility.
>>
>>Under WinXP Both SymLinks look identical to Win2K onese except they are in
>>GLOBAL??. They can both be examined with WinObj.
>>Actual primary (fdo) object and child (pdo) objects are under \Device,
>>as I expect
>>them to be. I can examine primary with WinObj OK but I get an error
>>“Unable to Open \Device\MyChild” if I double-click on child.
>>
>>Using a win32 test app top open child device, GetLastError() return 2,
>>“The system cannot find the file specified”.
>>
>>Presumably WinXP PnP manager has somehow made the pdo unusable for
>>actual access.
>>
>>Has anyone got any suggestions?
>>
>>
>>ned
>>
>>
>>
>>Maxim S. Shatskih wrote:
>>
>>
>>
>>>>If I complete IRP_MN_QUERY_ID with status unsupported, the two devices
>>>>are usable under WIn2K but NOT under WinXP.
>>>>
>>>>
>>>>
>>>>
>>>For a parent, pass QUERY_ID down together with most other PnP IRPs.
>>>
>>>For a child, you must handle QUERY_ID and report some IDs of your own - like
>>>MYBUS\ChildDevice. Look at Toaster bus driver sample for details.
>>>
>>>
>>>
>>>
>>>
>>>>If I implement IRP_MN_QUERY_ID to return dummy BusQueryInstanceID,
>>>>BusQueryDeviceID, BusQueryHardwareIDs I will get a ‘New Device found’
>>>>(unknown type) dialog.
>>>>
>>>>
>>>>
>>>>
>>>Correct. This must be so. Your INF file must provide the information about
>>>
>>>
>this
>
>
>>>ID.
>>>
>>>Maxim Shatskih, Windows DDK MVP
>>>StorageCraft Corporation
>>>xxxxx@storagecraft.com
>>>http://www.storagecraft.com
>>>
>>>
>>>—
>>>Questions? First check the Kernel Driver FAQ at
>>>
>>>
>http://www.osronline.com/article.cfm?id=256
>
>
>>>You are currently subscribed to ntdev as: xxxxx@colorts.com.au
>>>To unsubscribe send a blank email to xxxxx@lists.osr.com
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>—
>>Questions? First check the Kernel Driver FAQ at
>>
>>
>http://www.osronline.com/article.cfm?id=256
>
>
>>You are currently subscribed to ntdev as: xxxxx@storagecraft.com
>>To unsubscribe send a blank email to xxxxx@lists.osr.com
>>
>>
>
>
>—
>Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@colorts.com.au
>To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
>
Is the CREATE path ever called?
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: “ned kacavenda”
To: “Windows System Software Devs Interest List”
Sent: Tuesday, July 20, 2004 2:42 AM
Subject: Re: [ntdev] IRP_MN_QUERY_ID handling problem
>
> I do not see that this would resolve the issue as manually created
> symbolic link does not seem to have
> a problem, it is the device object itself that seems to have a problem.
>
> ned
>
>
> Maxim S. Shatskih wrote:
>
> > Use the PnP device interfaces instead of manually created symlinks.
> >
> >Maxim Shatskih, Windows DDK MVP
> >StorageCraft Corporation
> >xxxxx@storagecraft.com
> >http://www.storagecraft.com
> >
> >----- Original Message -----
> >From: “ned kacavenda”
> >To: “Windows System Software Devs Interest List”
> >Sent: Monday, July 19, 2004 8:15 AM
> >Subject: Re: [ntdev] IRP_MN_QUERY_ID handling problem
> >
> >
> >
> >
> >>I have a proper INF file now but child object is still inaccessible
> >>under XP.
> >>
> >>Under Win2K I can examine SymLink objects under ?? and actual devices
under
> >>\Device tree, using WinObj utility.
> >>
> >>Under WinXP Both SymLinks look identical to Win2K onese except they are in
> >>GLOBAL??. They can both be examined with WinObj.
> >>Actual primary (fdo) object and child (pdo) objects are under \Device,
> >>as I expect
> >>them to be. I can examine primary with WinObj OK but I get an error
> >>“Unable to Open \Device\MyChild” if I double-click on child.
> >>
> >>Using a win32 test app top open child device, GetLastError() return 2,
> >>“The system cannot find the file specified”.
> >>
> >>Presumably WinXP PnP manager has somehow made the pdo unusable for
> >>actual access.
> >>
> >>Has anyone got any suggestions?
> >>
> >>
> >>ned
> >>
> >>
> >>
> >>Maxim S. Shatskih wrote:
> >>
> >>
> >>
> >>>>If I complete IRP_MN_QUERY_ID with status unsupported, the two devices
> >>>>are usable under WIn2K but NOT under WinXP.
> >>>>
> >>>>
> >>>>
> >>>>
> >>>For a parent, pass QUERY_ID down together with most other PnP IRPs.
> >>>
> >>>For a child, you must handle QUERY_ID and report some IDs of your own -
like
> >>>MYBUS\ChildDevice. Look at Toaster bus driver sample for details.
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>>If I implement IRP_MN_QUERY_ID to return dummy BusQueryInstanceID,
> >>>>BusQueryDeviceID, BusQueryHardwareIDs I will get a ‘New Device found’
> >>>>(unknown type) dialog.
> >>>>
> >>>>
> >>>>
> >>>>
> >>>Correct. This must be so. Your INF file must provide the information about
> >>>
> >>>
> >this
> >
> >
> >>>ID.
> >>>
> >>>Maxim Shatskih, Windows DDK MVP
> >>>StorageCraft Corporation
> >>>xxxxx@storagecraft.com
> >>>http://www.storagecraft.com
> >>>
> >>>
> >>>—
> >>>Questions? First check the Kernel Driver FAQ at
> >>>
> >>>
> >http://www.osronline.com/article.cfm?id=256
> >
> >
> >>>You are currently subscribed to ntdev as: xxxxx@colorts.com.au
> >>>To unsubscribe send a blank email to xxxxx@lists.osr.com
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>
> >>—
> >>Questions? First check the Kernel Driver FAQ at
> >>
> >>
> >http://www.osronline.com/article.cfm?id=256
> >
> >
> >>You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> >>To unsubscribe send a blank email to xxxxx@lists.osr.com
> >>
> >>
> >
> >
> >—
> >Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
> >
> >You are currently subscribed to ntdev as: xxxxx@colorts.com.au
> >To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >
> >
> >
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
If you mean AddDevice() for Child, no, neither was StartDevice().
Note that child device was created ok and so was symbolic link created
ok (not indicated in trace). Note also that device driver is implemented
as a single .SYS image.
This is a PNP trace of events. Note that ( ! IRP_…) is PNP request
on FDO device
and (IRP_…) on pdo.
PCIDEV: entering AddDevice
PCIDEV: (FDO) - PNP Request (!IRP_MN_QUERY_LEGACY_BUS_INFORMATION)
PCIDEV: (FDO) - PNP Request (!IRP_MN_FILTER_RESOURCE_REQUIREMENTS)
PCIDEV: InterfaceType: 5 Bus: 0 Slot: 4
PCIDEV: (FDO) - PNP Request (!IRP_MN_QUERY_INTERFACE)
PCIDEV: (FDO) - PNP Request (!IRP_MN_QUERY_INTERFACE)
PCIDEV: (FDO) - PNP Request (!IRP_MN_QUERY_INTERFACE)
PCIDEV: (FDO) - PNP Request (!IRP_MN_START_DEVICE)
PCIDEV: - StartDevice:
PCIDEV: FPGA Loaded OK
PCIDEV: Created symbolic link btween \DosDevices\DIPCI0 and
\Device\CbPci0
PCIDEV: UART Hardware Init
PCIDEV: UART Loopback
PCIDEV: UART Tx “Uart Test” Rx “Uart Test”
PCIDEV: All is good!
PCIDEV: Started
PCIDEV: (FDO) - PNP Request (!IRP_MN_QUERY_CAPABILITIES)
PCIDEV: (FDO) - PNP Request (!IRP_MN_QUERY_PNP_DEVICE_STATE)
PCIDEV: (FDO) - PNP Request (!IRP_MN_QUERY_DEVICE_RELATIONS)
PCIDEV: (pdo) - PNP Request (IRP_MN_QUERY_ID)
PCIDEV: (pdo) - BusQueryDeviceID:
PCIDEV: (pdo) - PNP Request (IRP_MN_QUERY_CAPABILITIES)
PCIDEV: (FDO) - PNP Request (!IRP_MN_QUERY_CAPABILITIES)
PCIDEV: (pdo) - PNP Request (IRP_MN_QUERY_DEVICE_TEXT)
PCIDEV: (pdo) - PNP Request (IRP_MN_QUERY_DEVICE_TEXT)
PCIDEV: (pdo) - PNP Request (IRP_MN_QUERY_ID)
PCIDEV: (pdo) - BusQueryInstanceID:
PCIDEV: (pdo) - PNP Request (IRP_MN_QUERY_ID)
PCIDEV: (pdo) - BusQueryHardwareIDs:
PCIDEV: (pdo) - PNP Request (IRP_MN_QUERY_ID)
PCIDEV: (pdo) - PNP Request (IRP_MN_QUERY_RESOURCE_REQUIREMENTS)
PCIDEV: (pdo) - PNP Request (IRP_MN_QUERY_BUS_INFORMATION)
PCIDEV: (FDO) - PNP Request (!IRP_MN_QUERY_BUS_INFORMATION)
PCIDEV: (pdo) - PNP Request (IRP_MN_QUERY_RESOURCES)
PCIDEV: (FDO) - PNP Request (!IRP_MN_QUERY_CAPABILITIES)
PCIDEV: (FDO) - PNP Request (!IRP_MN_QUERY_DEVICE_RELATIONS)
>>>No further IRPs seen until CreateFile() on primary OR disable device
in Device Manager
ned
Maxim S. Shatskih wrote:
Is the CREATE path ever called?
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com