阅读:5424回复:1
【求救】minifilter中调用FltCreateFile的离奇问题
请教大家一个问题:我在minifilter的Pre-create函数中用下面的代码创建/打开一个文件,怎么在FltCreateFile后总是报status = STATUS_OBJECT_PATH_SYNTAX_BAD错误,MSDN上说是路径的问题,但对照MSDN的例子,我实在又看不出来这个路径有什么问题了?
RtlInitUnicodeString(&sFileDosFullPath, L"\\??\\D:\1.doc"); // init object attribute InitializeObjectAttributes(&ob, &sFileDosFullPath, OBJ_KERNEL_HANDLE|OBJ_CASE_INSENSITIVE, NULL,NULL) ; // create/open file uCreateDisposition = Cbd->Iopb->Parameters.Create.Options>>24 ; uCreateOptions = Cbd->Iopb->Parameters.Create.Options & 0x00ffffff ; uShareAccess = Cbd->Iopb->Parameters.Create.ShareAccess ; uFileAttributes = Cbd->Iopb->Parameters.Create.FileAttributes ; status = FltCreateFile(FltObjects->Filter, FltObjects->Instance, &hFile, uDesiredAccess, &ob, &IoStatus, NULL, uFileAttributes, uShareAccess, uCreateDisposition, uCreateOptions, NULL, 0, IO_IGNORE_SHARE_ACCESS_CHECK ) ; if (!NT_SUCCESS(status)) { FltStatus = FLT_PREOP_COMPLETE ; __leave ; } |
|
|
沙发#
发布于:2009-09-14 14:32
貌似RtlInitUnicodeString(&sFileDosFullPath, L"\\??\\D:\1.doc");
应该是RtlInitUnicodeString(&sFileDosFullPath, L"\\??\\D:\\1.doc"); 吧!楼主粗心了 |
|