Hi All,
I have written a usb client driver. In the
AddDevice() of the driver I am creating the
DeviceObject with a name and providing a symbolic link
to the device object. When I put the device on the USB
socket I am able to to see the device object using the
Object Viewer utility.
I want to open this device created from some other
driver. I am using the call ZwCreateFile for this
purpose. The call is failing with the error code
device not found. What could be the reason for this
behaviour? Please send some inputs on this.
Regards,
Murali
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2
Murali S wrote:
I have written a usb client driver. In the
AddDevice() of the driver I am creating the
DeviceObject with a name and providing a symbolic link
to the device object. When I put the device on the USB
socket I am able to to see the device object using the
Object Viewer utility.
I want to open this device created from some other
driver. I am using the call ZwCreateFile for this
purpose. The call is failing with the error code
device not found. What could be the reason for this
behaviour? Please send some inputs on this.
What is the name of the device object and of the symbolic link? What is
the name you specified in your call to ZwCreateFile? (Incidentally, I
think you should probably use IoGetDeviceObjectPointer instead of
ZwCreateFile because handle-based I/O is much more cumbersome in kernel
mode than simply creating and sending IRPs.)
–
Walter Oney, Consulting and Training
Basic and Advanced Driver Programming Seminars
Now teaming with John Hyde for USB Device Engineering Seminars
Check out our schedule at http://www.oneysoft.com
Hi,
The name used to create the device is L"\Device\DEVICE_0". This
string is passed as an 3 arg to the function IoCreateDevice. The symbolic
link name used is L"\DosDevice\DEVICE_0".
The name used to open the device in the other driver is
L"\Device\DEVICE_0". I will try out the suggestion given. Thanks for the
reply.
Regards,
Murali