Hello,
In our filter’s CREATE routine, before any action, the filter queries the
name
of the file, using ObQueryNameString). Because the file is not open yet,
it queries device name only. The filter then appends the name from
FileObject->RelatedFileObject (if any) and then from the file object itself.
Few days ago, I experienced strange deadlocks in our filter driver.
(Win2000, SP4). It appeared to happen on network files.
Later I reimplemented the name querying logic (without calling
ObQueryNameString). The deadlocks were solved by this
change.
Does anyone have experiences with some problems
when querying name at IRP_MJ_CREATE ?
As far as I’ve seen, this is the same method like
the one used in SFILTER example from IFSKit.
Regards,
L. Zezula
You need to handle this manually. Call the FS below you with an IRP to get
the name of the related file object and then append the file name in the
file object name string.
Jamey
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ladislav Zezula
Sent: Monday, February 23, 2004 1:20 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] ObQueryNameString at IRP_MJ_CREATE
Hello,
In our filter’s CREATE routine, before any action, the filter queries the
name
of the file, using ObQueryNameString). Because the file is not open yet,
it queries device name only. The filter then appends the name from
FileObject->RelatedFileObject (if any) and then from the file object itself.
Few days ago, I experienced strange deadlocks in our filter driver.
(Win2000, SP4). It appeared to happen on network files.
Later I reimplemented the name querying logic (without calling
ObQueryNameString). The deadlocks were solved by this
change.
Does anyone have experiences with some problems
when querying name at IRP_MJ_CREATE ?
As far as I’ve seen, this is the same method like
the one used in SFILTER example from IFSKit.
Regards,
L. Zezula
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
Jamey,
Thank you for the response. I only wonder
why this method is shown in IFS kit’s sample.
L.
You’ve got to be more attentive. SFilter queries file name only after
IRP_MJ_CREATE request is completed by underlying device.
SFilter has some bugs in the SfGetFileName routine. If
NameControl->smallBuffer is too small, FileObject is always queried for name
string, though FileObject must be queried only in case of successful create
operation. The code should work though, because 256 bytes (the size of
NameControl->smallBuffer) should be enough for the device name. The name of
RelatedFileObject should always be queried from file system as it may
already be freed. Backslash after related file name must be appended
conditionaly as related file name may already end with a backslash.
Look at FileSpy sample. It is somehow more complete concerning getting file
names.
–htfv
“Ladislav Zezula” wrote in message news:xxxxx@ntfsd…
> Jamey,
>
> Thank you for the response. I only wonder
> why this method is shown in IFS kit’s sample.
>
> L.
>
>
> You’ve got to be more attentive. SFilter queries file name only after
IRP_MJ_CREATE request is completed by underlying device.
Well, yes, I know. I wrote that I called the ObQueryNameString
before the file is open.
So the conclusion is - it is generally not safe to call ObQueryNameString
before the file is open…
About the other things - thank you for the informations.
L.
SFilter has some bugs in the SfGetFileName routine. If
NameControl->smallBuffer is too small, FileObject is always queried for
name
string, though FileObject must be queried only in case of successful
create
operation. The code should work though, because 256 bytes (the size of
NameControl->smallBuffer) should be enough for the device name. The name
of
RelatedFileObject should always be queried from file system as it may
already be freed. Backslash after related file name must be appended
conditionaly as related file name may already end with a backslash.
Look at FileSpy sample. It is somehow more complete concerning getting
file
names.
–htfv