Discussion:
USBd.dll problem
(too old to reply)
dlugolinski13
2010-05-03 15:37:24 UTC
Permalink
I am trying to get the VID and PID of the USB device attached(lets just say
any of them no specifics).
I am trying to load library as below but cannot, is WinCE able to load this
library and if so why can't I or where can i get it?

HINSTANCE usbLib = LoadLibrary(TEXT("usbd.dll"));
if(usbLib == 0)
printf("Can't load the library USBd.dll\n");
else
blah blah do stuff with it

it doesn't have to use this lib i just need to know how to get a USB device
so i can talk to it and yes i know about findfirstdevice and findnext

thanks,
chris
Bruce Eitman [eMVP]
2010-05-03 16:38:43 UTC
Permalink
I am not sure what good that would do. USBD.dll is a driver, so
applications don't use LoadLibrary() to access it.

Would I be correct in assuming that your are targeting CE 6.0? If so,
USBD.dll is most likly a kernel mode dll and not loadable via LoadLibrary().
--
Bruce Eitman (eMVP)
Senior Engineer
Bruce.Eitman AT Eurotech DOT com
My BLOG http://geekswithblogs.net/bruceeitman

Eurotech Inc.
www.Eurotech.com
Post by dlugolinski13
I am trying to get the VID and PID of the USB device attached(lets just say
any of them no specifics).
I am trying to load library as below but cannot, is WinCE able to load this
library and if so why can't I or where can i get it?
HINSTANCE usbLib = LoadLibrary(TEXT("usbd.dll"));
if(usbLib == 0)
printf("Can't load the library USBd.dll\n");
else
blah blah do stuff with it
it doesn't have to use this lib i just need to know how to get a USB device
so i can talk to it and yes i know about findfirstdevice and findnext
thanks,
chris
dlugolinski13
2010-05-03 19:51:01 UTC
Permalink
OK understood but I need a way to get to the PID and VID of the USB device
can you help with that?
I tried the FindFirstDevice and can enumerate through all connected devices
but what i need to check is the VID and PID and these are normally in the
PSP_DEVICE_INTERFACE_DETAIL_DATA which is populated with this function
SetupDiGetDeviceInterfaceDetail but this function is not used in any of the
CE libraries i can find? help please

chris
Post by Bruce Eitman [eMVP]
I am not sure what good that would do. USBD.dll is a driver, so
applications don't use LoadLibrary() to access it.
Would I be correct in assuming that your are targeting CE 6.0? If so,
USBD.dll is most likly a kernel mode dll and not loadable via LoadLibrary().
Post by dlugolinski13
I am trying to get the VID and PID of the USB device attached(lets just say
any of them no specifics).
[quoted text clipped - 14 lines]
Post by dlugolinski13
thanks,
chris
Ation
2010-05-24 09:05:17 UTC
Permalink
In fact, direct USBD loading is a bad idea, because it's used in HCD
context through notifications.
There are no "standard" way to get all USB devices.
You can do next
- clone USBD
- add additional functionality (shadow copy of all plugged devices and
backdoor for some application, to get this list (for example through
message queue)).
- build image

Continue reading on narkive:
Loading...