Correct - the query fast I/O Open operation collapses four IRPs into a
single call: create, query information, cleanup and close. Thus it is
an optimization and it is used to obtain attribute information.
If you want to know in this case if it is a directory, look at the
FileAttributes structure (0x10 = FILE_ATTRIBUTE_DIRECTORY) in the
completion routine.
While you can disable this, the name is no longer an accurate reflection
of function because it is used extensively for local callers acquiring
attribute information and thus disabling it can have a material impact
on performance.
The filter manager does not provide this information because there is no
infrastructure at that point to query the underlying FSD (it would have
to open the file and perform the query.) Since you have the information
you are seeking, this call is not required.
Regards,
Tony
Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com
Looking forward to seeing you at the next OSR File Systems class in
Boston, MA April 18-21, 2006 (note new date - MS scheduled plugfest the
same week again.)
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Gian-luca Tenti
Sent: Sunday, February 19, 2006 9:44 AM
To: ntfsd redirect
Subject: RE: [ntfsd] FASTIO And FltQueryInformationFile
Ok resolved:
(From Maxim S. Shatskih)
Any Win32’s “query some file info by name” function like
GetFileAttributesEx -
which are NT’s syscalls NtQueryAttributesFile and
NtQueryFullAttributesFile will
trigger FastIoQueryOpen.
FastIoQueryOpen is provided with dummy file object with only ->FileName
valid,
it must not initialize a file object, it must just extract the necessary
info by
the name and fill it to the provided structure.
So I don’t hook any FastIO create postop.
Looking the trace of my driver, the system make some FastIO Create and
then the REAL Create (I hook this)
So the fastio create op is only intended for (I think) acquire cached
info and not for real open
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Gian-luca Tenti
Sent: domenica 19 febbraio 2006 15.18
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] FASTIO And FltQueryInformationFile
The Status is 0x00000000 (Information = 0x38 (??))
The FltSet FltSetStreamHandleContext Fails with STATUS_NOT_SUPPORTED but
if I disable the postop for fastio all goes OK.
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ken Cross
Sent: domenica 19 febbraio 2006 14.38
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] FASTIO And FltQueryInformationFile
And it’s succeeding on non-fastio operations, right?
Print the value of Data->IoStatus.Status, too. It may have something
like STATUS_PENDING (which is a success code) that needs to be handled
differently.
An alternative that should always work is to open the file yourself with
FltCreateFile followed by FltQueryInformationFile.
Ken
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Gian-luca Tenti
Sent: Sunday, February 19, 2006 7:57 AM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] FASTIO And FltQueryInformationFile
A new Entry:
Now I’m adding to my code the StreamHandleContext:
FLT_POSTOP_CALLBACK_STATUS
SpyPostOperationCallback(
IN OUT PFLT_CALLBACK_DATA Data,
IN PCFLT_RELATED_OBJECTS FltObjects,
IN PVOID CompletionContext,
IN FLT_POST_OPERATION_FLAGS Flags
)
{
NTSTATUS Status;
FILE_ATTRIBUTE_TAG_INFORMATION FileAttribute = {0,0};
PREPARSE_CNTX FCchItem = CompletionContext;
PREPARSE_CNTX FCchOldItem = NULL_CONTEXT;
if(NT_SUCCESS(Data->IoStatus.Status))
{
FCchRemove(FCchItem);
FCchItem->DestFileObject = FltObjects->FileObject;
FCchItem->DestInstance = FltObjects->Instance;
Status = FltIsDirectory(
FltObjects->FileObject,
FltObjects->Instance,
&FCchItem->IsDirectory);
if(NT_ERROR(Status))
KdPrint((“[SpyPostOperationCallback] Status %08X
IsFastIO %X\n”,Status,FLT_IS_FASTIO_OPERATION(Data)));
if(FCchItem->IsDirectory)
{
OpenDirectory(
Data,
FltObjects->Filter,
FCchItem->OrigInstance,
&FCchItem->OrigFileName,
&FCchItem->OrigFileObject,
&FCchItem->hOrigFile);
}
Status = FltSetStreamHandleContext(
FltObjects->Instance,
FltObjects->FileObject,
FLT_SET_CONTEXT_KEEP_IF_EXISTS,
FCchItem,
&FCchOldItem);
if(NT_ERROR(Status))
{
if(FCchOldItem != NULL_CONTEXT)
{
FltReleaseContext(FCchOldItem);
FltDeleteContext(FCchOldItem);
}
}
FltReleaseContext(FCchItem);
}else
FCchDel(FCchItem);
return FLT_POSTOP_FINISHED_PROCESSING;
}
In the PostCreate’s Op (after I enabled the FastIO) I have a
Data.IOStatus.Information = 0x38 , Data.IOStatus.Status = 0x0 ,
FLT_FASTIO set and
The FltIsDirectory return with STATUS_NOT_SUPPORTED (filesystem is
XPSP2’s NTFS)
And FltSetStreamHandleContext fails with STATUS_INVALID_PARAMETER.
The FCchItem is a pointer to fixed size memory allocated in the
PreCreate.
It’s possible that the Post Fastio create op have to be registered with
other code than IRP_MJ_NETWORK_QUERY_OPEN or IRP_MJ_CREATE ?
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
You are currently subscribed to ntfsd as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
You are currently subscribed to ntfsd as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
You are currently subscribed to ntfsd as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
You are currently subscribed to ntfsd as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com