Author Topic: USBView and WinUSB #1  (Read 9834 times)

NicOfTime

  • Member
  • ***
  • Posts: 4
USBView and WinUSB #1
« on: October 01, 2014, 09:54:04 am »
Hi, Jan.

I've been beating my head against the wall for some time trying to get this all sorted out.  I know I'm making progress, and at some point I'll get pretty good at this stuff, thanks to you.

A couple questions here over a couple posts:

From what I've been able to discern so far, it seems to be necessary to get a WinUSB handle to a device in order to ask for its descriptors.  Yet USBView doesn’t use WinUSB to get the device descriptors.  So:

a) How does USBView get the descriptors without opening a WinUSB handle to the device through WinUSB_Initialize?

b) If USBView can get the device descriptors without using WinUSB, does that mean that the operating system is already in active communication with the device and the WinUSB functions are not really necessary?  Or is USBView getting the device descriptors through some other means (perhaps some table of information) rather than from the device itself?

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: USBView and WinUSB #1
« Reply #1 on: October 01, 2014, 11:25:52 am »
USBView has been around much longer than WinUSB. You can view the source code here:

http://code.msdn.microsoft.com/windowshardware/USBView-sample-application-e3241039/view/SourceCode#content

NicOfTime

  • Member
  • ***
  • Posts: 4
Re: USBView and WinUSB #1
« Reply #2 on: October 02, 2014, 09:35:44 am »
Hi, Jan.

Thanks so much for your prompt response.

Yes, I had downloaded / viewed the source code for USBView some weeks ago.  I was going to use it as a reference for building / troubleshooting my own code.  It's only after I started analyzing the USBView source code that I realized it wasn't using WinUSB, so it wasn't much help in my efforts to use WinUSB to get where I'm going.

But since USBView wasn't using WinUSB, and USBView was talking to my devices (at least as far as getting the descriptors goes), then there was clearly something I didn't understand about the whole process conceptually, architecturally, and executionally(!).  USBView doesn't get "access denied" when communicating with my devices, and I wanted to understand why.

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: USBView and WinUSB #1
« Reply #3 on: October 02, 2014, 10:13:31 am »
If I recall correctly (someone correct me if wrong!), USBView doesn't access devices but just returns information already stored in the system.