about IoRegisterDeviceInterface

Hi all,

I would like to export mulitple interface instance from my WDM driver on
Windows 98. I am using multiple calls to IoRegisterDeviceInterface to
create the interface instances. However, in my driver’s dispatch routines,
I cannot differentiate between the different instances. I try passing the
3rd argument (reference string) to IoRegisterDeviceInterface so as to
generate different symboliclink names for different instance. However, I
don’t know how to make use this refernce string to differentiate the
instances (don’t even know if this is possible). In Oney’s book, he
mentioned that this 3rd parameter to IoRegisterDeviceInterface is for MS
internal use and I found no eample of IoRegisterDeviceInterface with this
3rd parameter. Please enlighten me.

Thanks!
Edward

Edward wrote:

I would like to export mulitple interface instance from my WDM driver on
Windows 98. I am using multiple calls to IoRegisterDeviceInterface to
create the interface instances. However, in my driver’s dispatch routines,
I cannot differentiate between the different instances. I try passing the
3rd argument (reference string) to IoRegisterDeviceInterface so as to
generate different symboliclink names for different instance. However, I
don’t know how to make use this refernce string to differentiate the
instances (don’t even know if this is possible). In Oney’s book, he
mentioned that this 3rd parameter to IoRegisterDeviceInterface is for MS
internal use and I found no eample of IoRegisterDeviceInterface with this
3rd parameter. Please enlighten me.

Check out the stack->FileObject->FileName value inside your
DispatchCreate routine. Then use the file object’s FsContext (or
FsContext2) field to keep track of which thing got opened – you’ll be
getting the same file object pointer in every IRP up through
IRP_MJ_CLOSE.


Walter Oney, Consulting and Training
Basic and Advanced Driver Programming Seminars
Check out our schedule at http://www.oneysoft.com

Thanks for you help, Oney!

In addition to WDM, I also think of the implementation using a static VxD.
Here I have another question regarding interfacing WDM with VxD.
I would like to create the following driver structure.


VxD

| |


|WDM| |WDM|


H/W H/W

The WDM drivers control the hardware and will be used by the VxD driver.
The VxD driver in turn exports mulitple interfaces to other services that
will use the H/Ws.

Then I have two questions.

  1. Can VxD differentiate between various instances of WDM driver (the 2
    peices of H/W use the same WDM driver).
  2. How can the VxD detect the arrival/removal of the WDM driver (or H/W)?
    Please advise if this approach is feasible?

Thanks Again!
Edward

> don’t know how to make use this refernce string to differentiate the

instances (don’t even know if this is possible). In Oney’s book, he

IIRC it will be CurrentLoc->FileObject->FileName in CREATE path,
possibly with a backslash prefix.

Max