I am using WinUSB via a .Net component written in C#.
Every first read I get error 1008 - ERROR_NO_TOKEN "An attempt was made to
reference a token that does not exist". This happens only the first time I
read after connecting the device.
No information in the system event logs.
The full source code is here:
http://www.asyncop.com/MTnPDirEnum.aspx?treeviewPath=%5bo%5d+Open-Source%5cWinUSB+Component (see at the bottom)
Any idea why 1008 may happen?
TIA,
Asaf
That's the source code for the component, but not for the code in your app
that CALLS the component. That's what we need to see. Are you sure you
have the endpoint numbers right? Did you set the GUID in the component to
the GUID from your INF? What endpoints does your device have?
--
Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.
The workaround was reading zero bytes:
winUSBDevice1.ReadBlocking(0);
Only the first read will fail 1008 and all the other operations work great
so the system is set up correctly. I also know that it is the first read
regardless of write, that nothing goes to the USB wire when the read fails
and that it is happening on several machines.
Thanks,
Asaf