Let me tell how we solve a similar problem in NDIS miniports. NDIS registers
pnp interface for every miniport and lets you open it in usermode, but it
doesn't allow you to send ioctls on that interface. So to send ioctls, you
have to create a separate device object and symbolik link using
NdisMRegisterDevice. If you have the handle to this link open during remove,
it will prevent the driver from unloading. To workaround this problem: first
you open the PNP interface registered by NDIS and register for PNP
notification. Then you open the symbolik link created by NdisMRegisterDevice
and use that handle for sending ioctls. When the device is removed, you will
get notified on the PNP interface handle. Just then you close both the
handles and voila, the driver will unload smoothly.
The NETVMINI sample exe in the Server 2003 DDK demonstrates this aspect. May
be you can follow that.
--
--
-Eliyas
This posting is provided "AS IS" with no warranties, and confers no rights.
So, NdisMRegisterDevice creates a PnP stack? Is it using IoReportDetectedDevice
internally?
--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
ma...@storagecraft.com
http://www.storagecraft.com
BTW, can a miniport know the name of its PNP interface, to derive the
secondary object's name from it?
"Maxim S. Shatskih" <ma...@storagecraft.com> wrote in message
news:u720ulU...@tk2msftngp13.phx.gbl...
--
--
-Eliyas
This posting is provided "AS IS" with no warranties, and confers no rights.
"Alexander Grigoriev" <al...@earthlink.net> wrote in message
news:emHP71X3...@TK2MSFTNGP11.phx.gbl...
Thank you for your clarifications.
I think will try another method, I found in the DDK's wdm audio sample
for SB16 which seems more clean to me.
This is to only overwrite the portclass Dispatch routine, and to
capture my private Ioctl's.
There is even the function PcDispatchIrp() in the DDK to forward the
IRP's that are for portclass !
So I do not need the additional DeviceObject.
The only problem will be, that I cannot share a REMOVE_LOCK with the
PortCls dispatch and remove, or do you have an idea for a solution ?
Markus.
"Eliyas Yakub [MSFT]" <eli...@online.microsoft.com> wrote in message news:<Y3hOb.76880$nt4.110937@attbi_s51>...