-

- 加为好友
- 发送私信
- 在线聊天
|
| 发表于:2008-08-19 17:28:09 楼主 |
我想得到这个盘符是否是USB接口类型的。。。 我的代码如下。我可以获取这个盘符的DEVICE_OBJECT对象,问题是如何得到这个对象的接口类型? RtlInitUnicodeString(&fileNameUnicodeString,L"\\DosDevices\\C:\\"); InitializeObjectAttributes( &objectAttributes, &fileNameUnicodeString,OBJ_CASE_INSENSITIVE, NULL, NULL ); ntStatus = ZwCreateFile( &ntFileHandle, SYNCHRONIZE|FILE_ANY_ACCESS, &objectAttributes, &ioStatus, NULL, 0, FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN, FILE_SYNCHRONOUS_IO_NONALERT|FILE_DIRECTORY_FILE, NULL, 0 ); if( !NT_SUCCESS( ntStatus ) ) { DbgPrint("Could not open drive C: %x\n", ntStatus); } else { DbgPrint("open drive C: Success!!! handle: %x\n", ntFileHandle); ntStatus = ObReferenceObjectByHandle( ntFileHandle, FILE_READ_DATA, NULL, KernelMode, &fileObject, NULL ); if( !NT_SUCCESS( ntStatus )) { DbgPrint("Could not get fileobject from handle\n"); ZwClose( ntFileHandle ); } else { DbgPrint("Get fileobject from handle Success\n"); //得到C盘对应的fileObject后,该如何得到C盘的接口类型??? ObDereferenceObject( fileObject ); ZwClose( ntFileHandle ); } } 希望各位驱动高手显个身,谢谢各位啦。(或者与上面的代码无关也行,请大家帮我看看如何得到盘符的接口类型,再次谢谢。。。) |
|
|
|
100
修改
删除
举报
引用
回复
| |