Hi!
I meet with another problem! I want to get the complete path of the file to be opened in the create_dispatch. I call the function ObQueryNameString to get the name of
irpSp->FileObject. IFS document says when IRP_MJ_CREATE packet is sent, the FileObject pointer points to the file object to be opened. But what I get by calling this function is the name of the volume device object, like \Device\Harddisk1\DP(1)0-0+8.
WHY?
If I want to get the complete path of the file to be opened, what should I do?By the way, Sfilter also calls ObQueryNameString to get the file name!
Thank U!
Hi,
It is not common to ask a particular person in this list, other people may
not read your question or decide not to reply. Please, if you have any
question then create a new item with a name that describes the question. Do
not reply in this item, create the new with a relevant header.
You create two errors. The first - you call ObQueryNameString for an
uninitialized file object, as a result you receive only part of the name(
i.e. device name ), but might receive a BSOD. The second - from the FSD
filter you call the function which creates an IRP and sends it to the top of
the stack, this leads to a deadlock.
The full file name in create request is “Name of the
FileObject->DeviceObject”+“Name of the FileObject->RelatedFileObject if this
object is not NULL”+“FileObject->FileName”.
ObQueryNameString tries to retrieve a name by querying the FSD driver, but
it is illegal to query the name of the uninitialized file object.
–
Slava Imameyev, xxxxx@hotmail.com
wrote in message news:xxxxx@ntfsd…
> Hi!
>
> I meet with another problem! I want to get the complete path of the file
> to be opened in the create_dispatch. I call the function ObQueryNameString
> to get the name of
> irpSp->FileObject. IFS document says when IRP_MJ_CREATE packet is sent,
> the FileObject pointer points to the file object to be opened. But what I
> get by calling this function is the name of the volume device object, like
> \Device\Harddisk1\DP(1)0-0+8.
> WHY?
>
> If I want to get the complete path of the file to be opened, what should I
> do?By the way, Sfilter also calls ObQueryNameString to get the file name!
>
> Thank U!
>
Thanks Slava!
I learn two things!
First, I’ll never ask a particular in this list any more!
Second, I know why I fail to get the file name! I’ll try this way!