阅读:1058回复:3
文件路径2问题 fullpathname
在filemon,我使用ObQueryNameString获得文件路径。
但是都是一些“\\Device\\HarddiskVolume2”. 请问打下为什么呀? DbgPrint( ("Opened %ws\n", nameInfo->Name.Buffer) ); 还有一个问题 文件路径全名到底在什么地方? fileObject->DeviceObject 还是 fileObject->FileName |
|
|
沙发#
发布于:2004-12-28 09:55
在驱动中路径就是这个样子的,\\Device\\HarddiskVolumeX就是驱动器信息了。在FileName中也是不全的,想要全路径,自已转换吧!
这是ZwQueryInformationFile中的说明: If the full path and file name are returned, the string will begin with a single backslash, regardless of its location. Thus the file C:\\dir1\\dir2\\filename.ext will appear as \\dir1\\dir2\\filename.ext, while the file \\\\server\\share\\dir1\\dir2\\filename.ext will appear as \\server\\share\\dir1\\dir2\\filename.ext. |
|
|
驱动老牛
|
板凳#
发布于:2004-12-28 10:48
最好不要转换成c:等,因为盘符是可以变的。
|
|
地板#
发布于:2004-12-28 15:59
filemon中是通过构造IRP来自己解决的。
//获取文件对象的完整路径 FileMonGetFullPath( BOOLEAN createPath, PFILE_OBJECT fileObject, PHOOK_EXTENSION hookExt, PCHAR fullPathName ); //具体的实现函数 FileMonQueryFile( PDEVICE_OBJECT DeviceObject, PFILE_OBJECT FileObject, FILE_INFORMATION_CLASS FileInformationClass, PVOID FileQueryBuffer, ULONG FileQueryBufferLength ); |
|
|