|
最近碰到一个怪问题,写USB设备,有时会碰到下面的情况:
用OVERLAPPED方式打开USB设备, 然后用WriteFile写一个字符下去给
BOOL blRet = ::WriteFile(_hCommHandle, Buffer, dwBytesWrite, &dwBytesWrite, &_WriteOverlapped);
返回ERROR_IO_PENDING后,WaitForSingleObject(_WriteOverlapped.hEvent, 10000);
这个马上就返回了,理论上是成功了,但是在注册的回调中却没法收到EV_TXEMPTY的事件.
请问哪位大哥碰到过类似问题,知道怎么解决的,说一下该怎么办?
|
|