Hi, I’m developing a fs minifilter and I just got a strange failure on FltGetFileNameInformation. However the symptom of failure is very simple whenever file open by file id operation comes to PreCreate, FltGetFileNameInformation always fails with error code STATUS_INVALID_PARAMETER.
How do I properly obtain FileName Information for the FileObject in this situation? Is it even possible? Or is there some work around method for this?
In this case open by file id, get file name information in post create.
Good Luck!
wrote in message news:xxxxx@ntfsd… > Hi, > > Hi, I’m developing a fs minifilter and I just got a strange failure on > FltGetFileNameInformation. However the symptom of failure is very simple > whenever file open by file id operation comes to PreCreate, > FltGetFileNameInformation always fails with error code > STATUS_INVALID_PARAMETER. > > How do I properly obtain FileName Information for the FileObject in this > situation? Is it even possible? Or is there some work around method for > this? > > thank you in advance. >
If I have to get a name from PostCreate then it will be a big problem for me. Cuz I need to reparse name of FileObject at that point. File Id is unique so there must be a way to identify the file and its name. Is there such method that can get file name from file id?
However, I checked DDK reparse sample (‘simrep’) for the solution but I can’t find any related work in the source. Im just confused… If you got a any suggestion It will be great help.
If you really need to get the name in pre-create then you could issue your own create to open the file by ID and query for the name with that handle, then close that handle and continue processing the original create request. Not the greatest for performance but I do not think open by ID is used very often.
Sorry for jumping in so late in this thread, but as far as I know FltGetFileNameInformation works for opens by ID both in preCreate and after that. I guess there must be something else going on. Could you post some code ?
Regards,
Alex.
This posting is provided “AS IS” with no warranties, and confers no rights.
Alex, I’m not doing anything special, what my driver do is redirect all file operation to hidden virtual disk and I got problem when I try to get a file name from FILE_OPEN_BY_FILE_ID operation in PreCreate.
anyway, My code that retrieve file name looks like this.
AhnDbgPrint( ASTD_MESSAGE_LV,
(“[VeffhGetParsedFileNameInformation] Failed to FltParseFileNameInformation (Err:%d)\n”,
nStatus ) );
ASSERT(FALSE);
}
}
this code stay on very first of My PreCreate CallBack routine. everything i do comes after getting file name cuz I need file name to validate what to do next.
I just check ‘simrep’ sample source code in DDK and I think the sample has same problem that I have. cuz FltGetFileNameInformation fails everytime for file ID operation.