阅读:7255回复:7
CreateFile GetLastError: 31
在win2k+ddk
我已经获得了一个设备的 DevicePath, \\\\?\\usb#vid_058f&pid_1248#5&3be5b54&0&2#{50dd5230-ba8a-11d1-bf5d-0000f805f530} 但当我想 HANDLE pDevicefile = CreateFile( ifDetail->DevicePath, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); 时,却得到了INVALID_HANDLE_VALUE的 pDevicefile GetLastError()为31 用usb verifier 有如下内容: Device Descriptor: bcdUSB: 0x0110 bDeviceClass: 0x00 bDeviceSubClass: 0x00 bDeviceProtocol: 0x00 bMaxPacketSize0: 0x08 (8) idVendor: 0x058F (Alcor Micro, Inc.) idProduct: 0x9510 bcdDevice: 0x0200 iManufacturer: 0x01 iProduct: 0x02 iSerialNumber: 0x00 bNumConfigurations: 0x01 ConnectionStatus: DeviceConnected Current Config Value: 0x01 Device Bus Speed: Full Device Address: 0x02 Open Pipes: 3 Endpoint Descriptor: bEndpointAddress: 0x81 Transfer Type: Interrupt wMaxPacketSize: 0x0001 (1) bInterval: 0x20 Endpoint Descriptor: bEndpointAddress: 0x02 Transfer Type: Bulk wMaxPacketSize: 0x0010 (16) bInterval: 0x20 Endpoint Descriptor: bEndpointAddress: 0x83 Transfer Type: Bulk wMaxPacketSize: 0x0010 (16) bInterval: 0x20 |
|
最新喜欢:![]() |
沙发#
发布于:2003-01-08 10:41
高手高手
在线等待 |
|
板凳#
发布于:2003-01-08 14:03
是什么设备驱动?
|
|
|
地板#
发布于:2003-01-08 15:08
智能卡读写器
|
|
地下室#
发布于:2003-01-10 11:21
你用的是系统的驱动程序还是你自己写的驱动?
最有可能的是你找到了设备路径,但是驱动程序没有提供 IRP_MJ_CREATE例程,所以产生了0x1F错误。 其它的原因我也不太清楚。 |
|
|
5楼#
发布于:2003-01-13 09:49
我用的是系统的驱动程序,支持pc/sc
因为某些原因,我要这样做。 怎样能用creatfile打开? |
|
6楼#
发布于:2011-09-28 14:57
Re:CreateFile GetLastError: 31
出现和楼主一样的错误,请各位大牛帮忙解决一下 |
|
7楼#
发布于:2011-11-12 15:35
Re:CreateFile GetLastError: 31
你是不是可以attach一个内核调试器,看看设备驱动程序的IRP_MJ_CREATE分发函数有没有调入?把你的调试结果更新到这里。 |
|
|