Driver Problems? Questions? Issues?
Put OSR's experience to work for you! Contact us for assistance with:
  • Creating the right design for your requirements
  • Reviewing your existing driver code
  • Analyzing driver reliability/performance issues
  • Custom training mixed with consulting and focused directly on your specific areas of interest/concern.
Check us out. OSR, the Windows driver experts.

Upcoming OSR Seminars:

Writing WDF Drivers I: Core Concepts, Nashua, NH 15-19 May, 2017
Writing WDF Drivers II: Advanced Implementation Tech., Nashua, NH 23-26 May, 2017
Kernel Debugging and Crash Analysis, Dulles, VA 26-30 June, 2017
Windows Internals & Software Driver Development, Nashua, NH 24-28 July, 2017


Go Back   OSR Online Lists > ntfsd
Welcome, Guest
You must login to post to this list
  Message 1 of 10  
02 May 17 02:55
Ehsan Taheri
xxxxxx@yahoo.com
Join Date: 10 May 2016
Posts To This List: 96
FltGetFileNameInformation conflict with FltCreateFileEx

hi all, I have a minifilter which calls FltGetFileNameInformation then FltParseFileNameInformation and at last FltCreateFileEx, all in PRE_CREATE. The problem is when I try to save as applications give me access denied error for the requested file, while the empty file is created. I commented the rest of the code and now I only have pre_create containing what I explained above. if any of FltGetFileNameInformation or FltCreateFileEx get commented, it would remove the error. Is something wrong about calling these in pre-create which I am not aware of? parameters : FltGetFileNameInformation(data, FLT_FILE_NAME_NORMALIZED | FLT_FILE_NAME_QUERY_FILESYSTEM_ONLY, nameInfo); FltCreateFileEx(FltObjects->Filter, FltObjects->Instance, &fileHandle, &fileObject, Data->Iopb->Parameters.Create.SecurityContext->DesiredAccess, &objectAttributes, &ioStatus, &Data->Iopb->Parameters.Create.AllocationSize, Data->Iopb->Parameters.Create.FileAttributes, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, FILE_OPEN, Data->Iopb->Parameters.Create.Options, Data->Iopb->Parameters.Create.EaBuffer, Data->Iopb->Parameters.Create.EaLength, 0); I checked FltCreateFileEx for returned status. It returns multiple STATUS_OBJECT_NAME_NOT_FOUND first then it keeps returning STATUS_DELETE_PENDING for my target file. Any comment?
  Message 2 of 10  
02 May 17 04:12
Ehsan Taheri
xxxxxx@yahoo.com
Join Date: 10 May 2016
Posts To This List: 96
FltGetFileNameInformation conflict with FltCreateFileEx

>if any of FltGetFileNameInformation or FltCreateFileEx get commented replace with if FltCreateFileEx get commented
  Message 3 of 10  
02 May 17 15:41
Scott Noone
xxxxxx@osr.com
Join Date: 10 Jul 2002
Posts To This List: 884
List Moderator
FltGetFileNameInformation conflict with FltCreateFileEx

Your question is way to open ended. What you're trying to do definitely works. However, creates can have side effects so, yes, opening the file yourself can mess with the calling application. You need to look carefully at the operations and see what's going on. Does the user open have the delete on close bit set? Also check the ACL on the newly created file and make sure you haven't messed something up. -scott OSR @OSRDrivers wrote in message news:102472@ntfsd... >if any of FltGetFileNameInformation or FltCreateFileEx get commented replace with if FltCreateFileEx get commented
  Message 4 of 10  
03 May 17 03:12
Ehsan Taheri
xxxxxx@yahoo.com
Join Date: 10 May 2016
Posts To This List: 96
FltGetFileNameInformation conflict with FltCreateFileEx

Thanks scott > Your question is way to open ended. To me it is way more restricted!! It seems that I am not understanding something correctly! The whole code and callbacks are commented and I only have those 3 mentioned function calls. (besides driverEntry and load-unload handlers) >yes, opening the file yourself can mess with the calling application. I am not opening file instead of FS. I am calling FltCreateFileEx using FILE_OPEN as create disposition. Also the create always fails for that specific file. I am stating this because I feel you think I am opening the file and completing the operation myself. There is also no case in which I return any return value other than FLT_PREOP_SUCCESS_NO_CALLBACK. I see no where which I can interfere with FS really! could you please be more specific. (Well if you still consider my case open-ended you can't) For now, my only guess is I am doing something wrong with FltCreateFileEx performed on other files than the target file. i.e. directory-volume opens which might successfully be created.
  Message 5 of 10  
03 May 17 14:29
NtDev Geek
xxxxxx@gmail.com
Join Date: 09 Aug 2013
Posts To This List: 26
FltGetFileNameInformation conflict with FltCreateFileEx

objectAttributes contains what ??? it might be like : InitializeObjectAttributes(&oa, Name, OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE, Handle, NULL); since it is not necessary to use thease Data->Iopb->Parameters.Create.EaBuffer,Data->Iopb->Parameters.Create.EaLength, here. ./nT
  Message 6 of 10  
04 May 17 09:23
Scott Noone
xxxxxx@osr.com
Join Date: 10 Jul 2002
Posts To This List: 884
List Moderator
FltGetFileNameInformation conflict with FltCreateFileEx

Can you explain at a higher level what it is you're trying to do? I'm sorry but there just isn't enough detail to grab onto here to even begin to give you an answer. There's lots of reasons why opening a file might fail. Best I can do at this point is to say the following: 1. If you're in PreCreate and you're trying to open a file that is being created then I would expect you to get STATUS_OBJECT_NAME_NOT_FOUND (it hasn't been created yet...). 2. You're reflecting the caller's create options into the lower open (Data->Iopb->Parameters.Create.Options). If the file exists and FILE_DELETE_ON_CLOSE is set, you're going to prematurely set the file as delete pending. Does this also happen on FAT? If yes, I *highly* recommend building your own copy of FASTFAT and running it on your target machine. This will let you set breakpoints in the lower file system and step through the code. This can help build a better understanding of what's going on (especially when things don't work). -scott OSR @OSRDrivers wrote in message news:102477@ntfsd... Thanks scott > Your question is way to open ended. To me it is way more restricted!! It seems that I am not understanding something correctly! The whole code and callbacks are commented and I only have those 3 mentioned function calls. (besides driverEntry and load-unload handlers) >yes, opening the file yourself can mess with the calling application. I am not opening file instead of FS. I am calling FltCreateFileEx using FILE_OPEN as create disposition. Also the create always fails for that specific file. I am stating this because I feel you think I am opening the file and completing the operation myself. There is also no case in which I return any return value other than FLT_PREOP_SUCCESS_NO_CALLBACK. I see no where which I can interfere with FS really! could you please be more specific. (Well if you still consider my case open-ended you can't) For now, my only guess is I am doing something wrong with FltCreateFileEx performed on other files than the target file. i.e. directory-volume opens which might successfully be created.
  Message 7 of 10  
07 May 17 07:43
Ehsan Taheri
xxxxxx@yahoo.com
Join Date: 10 May 2016
Posts To This List: 96
FltGetFileNameInformation conflict with FltCreateFileEx

>>objectAttributes contains what ??? >>it might be like : InitializeObjectAttributes(&oa, >> Name, >> OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE, >> Handle, >> NULL); yes, it does. >>1. If you're in PreCreate and you're trying to open a file that is being >>created then I would expect you to get STATUS_OBJECT_NAME_NOT_FOUND (it >>hasn't been created yet...). yes it returns STATUS_OBJECT_NAME_NOT_FOUND first but STATUS_DELETE_PENDING after that. >>2. You're reflecting the caller's create options into the lower open >>(Data->Iopb->Parameters.Create.Options). If the file exists and >>FILE_DELETE_ON_CLOSE is set, you're going to prematurely set the file as >>delete pending. I tried having FILE_DELETE_ON_CLOSE removed. even that did not help. I will try what you suggested. Thanks.
  Message 8 of 10  
14 May 17 03:36
Ehsan Taheri
xxxxxx@yahoo.com
Join Date: 10 May 2016
Posts To This List: 96
FltGetFileNameInformation conflict with FltCreateFileEx

I found the problem couple of days ago. The problem was the handle to some files remaining opened.
  Message 9 of 10  
15 May 17 11:13
Scott Noone
xxxxxx@osr.com
Join Date: 10 Jul 2002
Posts To This List: 884
List Moderator
FltGetFileNameInformation conflict with FltCreateFileEx

Nice! Glad to hear you're unblocked and on to the next thing. -scott OSR @OSRDrivers wrote in message news:102538@ntfsd... I found the problem couple of days ago. The problem was the handle to some files remaining opened.
  Message 10 of 10  
15 May 17 21:39
Ehsan Taheri
xxxxxx@yahoo.com
Join Date: 10 May 2016
Posts To This List: 96
FltGetFileNameInformation conflict with FltCreateFileEx

Thanks Scott. Can you guess what could keep a file from being opened successfully when I had its handle opened using FILE_OPEN disposition? I've read about conflicting share access and desired access and tested different access values with no luck already
Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You must login to OSR Online AND be a member of the ntfsd list to be able to post.

All times are GMT -5. The time now is 03:21.


Copyright ©2015, OSR Open Systems Resources, Inc.
Based on vBulletin Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Modified under license