FASTIO And FltQueryInformationFile

Hi,

in a PostOp CREATE_IRP, I first test if the Status block in Data has an
error and the I use the FltQueryInformationFile to test if the fileobjet
is a directory.

If the Data->Flag has FLTFL_CALLBACK_DATA_FAST_IO_OPERATION set, the
FltQueryInformationFile fail with status_Invalid_parameter.

Now I add in the PreOp a check to refuse a FASTIO Create.

I have to use another API instead of FltQueryInformationFile for FASTIO
Operation?

Thank’s

If you are really just trying to determine if it’s a directory, try
FltIsDirectory().

Otherwise, it’s difficult to say without more info. What does the call look
like?

Ken


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Gian-luca Tenti
Sent: Friday, February 17, 2006 9:53 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] FASTIO And FltQueryInformationFile

Hi,

in a PostOp CREATE_IRP, I first test if the Status block in Data has an
error and the I use the FltQueryInformationFile to test if the fileobjet is
a directory.

If the Data->Flag has FLTFL_CALLBACK_DATA_FAST_IO_OPERATION set, the
FltQueryInformationFile fail with status_Invalid_parameter.

Now I add in the PreOp a check to refuse a FASTIO Create.

I have to use another API instead of FltQueryInformationFile for FASTIO
Operation?

Thank’s


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

Hi Ken,

This is my code:

NTSTATUS Status;
FILE_ATTRIBUTE_TAG_INFORMATION FileAttribute = {0,0};
PREPARSE_CNTX FCchItem = CompletionContext;
if(NT_SUCCESS(Data->IoStatus.Status))
{
FCchItem->DestFileObject = FltObjects->FileObject;
FCchItem->DestInstance = FltObjects->Instance;

Status = FltQueryInformationFile(
FltObjects->Instance,
FltObjects->FileObject,
&FileAttribute,
sizeof(FILE_ATTRIBUTE_TAG_INFORMATION),
FileAttributeTagInformation,
NULL);

FCchItem->IsDirectory = (FlagOn(FILE_ATTRIBUTE_DIRECTORY,FileAttribute.FileAttributes)==FILE_ATTRIBUTE_DIRECTORY);

if(FCchItem->IsDirectory)
{
OpenDirectory(
Data,
FltObjects->Filter,
FCchItem->OrigInstance,
&FCchItem->OrigFileName,
&FCchItem->OrigFileObject,
&FCchItem->hOrigFile);
}
}else
FCchDel(FCchItem);

return FLT_POSTOP_FINISHED_PROCESSING;

Now In the PreCreate if the access is fastio, I return FLT_PREOP_DISALLOW_FASTIO.

FltIsDirectory is great but is only for winxp sp2 and 2003 sp1 and not for 2000 sp4.

It seems that when the create is a fastio, in the create’s postop the file was not open yet or the FltQueryInformationFile was unable to work with fastio post op.

Looking in the FltObjects->FileObject I saw that the FsContext is not set (NULL) even if the Data->IoStatus.Status is STATUS_SUCCESS !?

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Ken Cross
Sent: venerd? 17 febbraio 2006 20.37
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] FASTIO And FltQueryInformationFile

If you are really just trying to determine if it’s a directory, try
FltIsDirectory().

Otherwise, it’s difficult to say without more info. What does the call look
like?

Ken


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Gian-luca Tenti
Sent: Friday, February 17, 2006 9:53 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] FASTIO And FltQueryInformationFile

Hi,

in a PostOp CREATE_IRP, I first test if the Status block in Data has an
error and the I use the FltQueryInformationFile to test if the fileobjet is
a directory.

If the Data->Flag has FLTFL_CALLBACK_DATA_FAST_IO_OPERATION set, the
FltQueryInformationFile fail with status_Invalid_parameter.

Now I add in the PreOp a check to refuse a FASTIO Create.

I have to use another API instead of FltQueryInformationFile for FASTIO
Operation?

Thank’s


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: xxxxx@filippetti.it
To unsubscribe send a blank email to xxxxx@lists.osr.com

The code looks OK (assuming you check Status after the call and just
excluded it for brevity). I don’t use FltQueryInformationFile in
post-Create, but I use it a number of other places and haven’t had any
problems. I don’t make any special checks for fastio.

FltIsDirectory is available on Windows 2000 if FltMgr is installed. And
that must be installed for your driver to work anyhow. It’s installed with
Update Rollup 1 or KB 905590. (In fact, the Windows 2000 version has some
things the Windows XP version doesn’t, like FltCreateFileEx).

Ken

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Gian-luca Tenti
Sent: Saturday, February 18, 2006 1:55 AM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] FASTIO And FltQueryInformationFile

Hi Ken,

This is my code:

NTSTATUS Status;
FILE_ATTRIBUTE_TAG_INFORMATION FileAttribute = {0,0};
PREPARSE_CNTX FCchItem = CompletionContext;
if(NT_SUCCESS(Data->IoStatus.Status))
{
FCchItem->DestFileObject = FltObjects->FileObject;
FCchItem->DestInstance = FltObjects->Instance;

Status = FltQueryInformationFile(
FltObjects->Instance,
FltObjects->FileObject,
&FileAttribute,
sizeof(FILE_ATTRIBUTE_TAG_INFORMATION),
FileAttributeTagInformation,
NULL);

FCchItem->IsDirectory =
(FlagOn(FILE_ATTRIBUTE_DIRECTORY,FileAttribute.FileAttributes)==FILE_ATTRIBU
TE_DIRECTORY);

if(FCchItem->IsDirectory)
{
OpenDirectory(
Data,
FltObjects->Filter,
FCchItem->OrigInstance,
&FCchItem->OrigFileName,
&FCchItem->OrigFileObject,
&FCchItem->hOrigFile);
}
}else
FCchDel(FCchItem);

return FLT_POSTOP_FINISHED_PROCESSING;

Now In the PreCreate if the access is fastio, I return
FLT_PREOP_DISALLOW_FASTIO.

FltIsDirectory is great but is only for winxp sp2 and 2003 sp1 and not for
2000 sp4.

It seems that when the create is a fastio, in the create’s postop the file
was not open yet or the FltQueryInformationFile was unable to work with
fastio post op.

Looking in the FltObjects->FileObject I saw that the FsContext is not set
(NULL) even if the Data->IoStatus.Status is STATUS_SUCCESS !?

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ken Cross
Sent: venerd? 17 febbraio 2006 20.37
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] FASTIO And FltQueryInformationFile

If you are really just trying to determine if it’s a directory, try
FltIsDirectory().

Otherwise, it’s difficult to say without more info. What does the call look
like?

Ken


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Gian-luca Tenti
Sent: Friday, February 17, 2006 9:53 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] FASTIO And FltQueryInformationFile

Hi,

in a PostOp CREATE_IRP, I first test if the Status block in Data has an
error and the I use the FltQueryInformationFile to test if the fileobjet is
a directory.

If the Data->Flag has FLTFL_CALLBACK_DATA_FAST_IO_OPERATION set, the
FltQueryInformationFile fail with status_Invalid_parameter.

Now I add in the PreOp a check to refuse a FASTIO Create.

I have to use another API instead of FltQueryInformationFile for FASTIO
Operation?

Thank’s


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: xxxxx@filippetti.it
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

Hi Ken,



This was great, but in the IFSDK:

“This routine is available on Microsoft Windows XP SP2, Microsoft Windows Server 2003 SP1, and later.”

Thank’s

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Ken Cross
Sent: sabato 18 febbraio 2006 14.57
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] FASTIO And FltQueryInformationFile

The code looks OK (assuming you check Status after the call and just
excluded it for brevity). I don’t use FltQueryInformationFile in
post-Create, but I use it a number of other places and haven’t had any
problems. I don’t make any special checks for fastio.

FltIsDirectory is available on Windows 2000 if FltMgr is installed. And
that must be installed for your driver to work anyhow. It’s installed with
Update Rollup 1 or KB 905590. (In fact, the Windows 2000 version has some
things the Windows XP version doesn’t, like FltCreateFileEx).

Ken

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Gian-luca Tenti
Sent: Saturday, February 18, 2006 1:55 AM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] FASTIO And FltQueryInformationFile

Hi Ken,

This is my code:

NTSTATUS Status;
FILE_ATTRIBUTE_TAG_INFORMATION FileAttribute = {0,0};
PREPARSE_CNTX FCchItem = CompletionContext;
if(NT_SUCCESS(Data->IoStatus.Status))
{
FCchItem->DestFileObject = FltObjects->FileObject;
FCchItem->DestInstance = FltObjects->Instance;

Status = FltQueryInformationFile(
FltObjects->Instance,
FltObjects->FileObject,
&FileAttribute,
sizeof(FILE_ATTRIBUTE_TAG_INFORMATION),
FileAttributeTagInformation,
NULL);

FCchItem->IsDirectory =
(FlagOn(FILE_ATTRIBUTE_DIRECTORY,FileAttribute.FileAttributes)==FILE_ATTRIBU
TE_DIRECTORY);

if(FCchItem->IsDirectory)
{
OpenDirectory(
Data,
FltObjects->Filter,
FCchItem->OrigInstance,
&FCchItem->OrigFileName,
&FCchItem->OrigFileObject,
&FCchItem->hOrigFile);
}
}else
FCchDel(FCchItem);

return FLT_POSTOP_FINISHED_PROCESSING;

Now In the PreCreate if the access is fastio, I return
FLT_PREOP_DISALLOW_FASTIO.

FltIsDirectory is great but is only for winxp sp2 and 2003 sp1 and not for
2000 sp4.

It seems that when the create is a fastio, in the create’s postop the file
was not open yet or the FltQueryInformationFile was unable to work with
fastio post op.

Looking in the FltObjects->FileObject I saw that the FsContext is not set
(NULL) even if the Data->IoStatus.Status is STATUS_SUCCESS !?

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ken Cross
Sent: venerd? 17 febbraio 2006 20.37
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] FASTIO And FltQueryInformationFile

If you are really just trying to determine if it’s a directory, try
FltIsDirectory().

Otherwise, it’s difficult to say without more info. What does the call look
like?

Ken

________________________________

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Gian-luca Tenti
Sent: Friday, February 17, 2006 9:53 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] FASTIO And FltQueryInformationFile

Hi,

in a PostOp CREATE_IRP, I first test if the Status block in Data has an
error and the I use the FltQueryInformationFile to test if the fileobjet is
a directory.

If the Data->Flag has FLTFL_CALLBACK_DATA_FAST_IO_OPERATION set, the
FltQueryInformationFile fail with status_Invalid_parameter.

Now I add in the PreOp a check to refuse a FASTIO Create.

I have to use another API instead of FltQueryInformationFile for FASTIO
Operation?

Thank’s


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: xxxxx@filippetti.it
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

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 ?

The docs are wrong.

Ken

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Gian-luca Tenti
Sent: Sunday, February 19, 2006 7:09 AM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] FASTIO And FltQueryInformationFile

Hi Ken,



This was great, but in the IFSDK:

“This routine is available on Microsoft Windows XP SP2, Microsoft Windows
Server 2003 SP1, and later.”

Thank’s

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ken Cross
Sent: sabato 18 febbraio 2006 14.57
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] FASTIO And FltQueryInformationFile

The code looks OK (assuming you check Status after the call and just
excluded it for brevity). I don’t use FltQueryInformationFile in
post-Create, but I use it a number of other places and haven’t had any
problems. I don’t make any special checks for fastio.

FltIsDirectory is available on Windows 2000 if FltMgr is installed. And
that must be installed for your driver to work anyhow. It’s installed with
Update Rollup 1 or KB 905590. (In fact, the Windows 2000 version has some
things the Windows XP version doesn’t, like FltCreateFileEx).

Ken

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Gian-luca Tenti
Sent: Saturday, February 18, 2006 1:55 AM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] FASTIO And FltQueryInformationFile

Hi Ken,

This is my code:

NTSTATUS Status;
FILE_ATTRIBUTE_TAG_INFORMATION FileAttribute = {0,0};
PREPARSE_CNTX FCchItem = CompletionContext;
if(NT_SUCCESS(Data->IoStatus.Status))
{
FCchItem->DestFileObject = FltObjects->FileObject;
FCchItem->DestInstance = FltObjects->Instance;

Status = FltQueryInformationFile(
FltObjects->Instance,
FltObjects->FileObject,
&FileAttribute,
sizeof(FILE_ATTRIBUTE_TAG_INFORMATION),
FileAttributeTagInformation,
NULL);

FCchItem->IsDirectory =
(FlagOn(FILE_ATTRIBUTE_DIRECTORY,FileAttribute.FileAttributes)==FILE_ATTRIBU
TE_DIRECTORY);

if(FCchItem->IsDirectory)
{
OpenDirectory(
Data,
FltObjects->Filter,
FCchItem->OrigInstance,
&FCchItem->OrigFileName,
&FCchItem->OrigFileObject,
&FCchItem->hOrigFile);
}
}else
FCchDel(FCchItem);

return FLT_POSTOP_FINISHED_PROCESSING;

Now In the PreCreate if the access is fastio, I return
FLT_PREOP_DISALLOW_FASTIO.

FltIsDirectory is great but is only for winxp sp2 and 2003 sp1 and not for
2000 sp4.

It seems that when the create is a fastio, in the create’s postop the file
was not open yet or the FltQueryInformationFile was unable to work with
fastio post op.

Looking in the FltObjects->FileObject I saw that the FsContext is not set
(NULL) even if the Data->IoStatus.Status is STATUS_SUCCESS !?

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ken Cross
Sent: venerd? 17 febbraio 2006 20.37
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] FASTIO And FltQueryInformationFile

If you are really just trying to determine if it’s a directory, try
FltIsDirectory().

Otherwise, it’s difficult to say without more info. What does the call look
like?

Ken

________________________________

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Gian-luca Tenti
Sent: Friday, February 17, 2006 9:53 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] FASTIO And FltQueryInformationFile

Hi,

in a PostOp CREATE_IRP, I first test if the Status block in Data has an
error and the I use the FltQueryInformationFile to test if the fileobjet is
a directory.

If the Data->Flag has FLTFL_CALLBACK_DATA_FAST_IO_OPERATION set, the
FltQueryInformationFile fail with status_Invalid_parameter.

Now I add in the PreOp a check to refuse a FASTIO Create.

I have to use another API instead of FltQueryInformationFile for FASTIO
Operation?

Thank’s


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: xxxxx@filippetti.it
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

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

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

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

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