Hi all,
I’m trying to use IoQueryFileInformation to discover if a FileObject is
referent a file or directory, but some times this call fail with
STATUS_INVALID_PARAMETER (0xc000000d). I’m calling my simple function on
completion of create if NT_SUCCEESS(Irp->IoStatus.Status).
Any help is welcome.
NTSTATUS IsDirectory(IN PFILE_OBJECT pFileObject,
OUT PBOOLEAN pbIsDirectory)
{
NTSTATUS nts;
ULONG ulSize;
FILE_STANDARD_INFORMATION StandardInfo;
nts = IoQueryFileInformation(pFileObject,
FileStandardInformation,
sizeof(StandardInfo),
&StandardInfo,
&ulSize);
if (NT_SUCCESS(nts))
*pbIsDirectory = StandardInfo.Directory;
return nts;
}
Thanks in advance,
Fernando Roberto da Silva.
make sure that u have the file object around until ur function is executed.
Regards,
Vikramaditya.
“Life is not measured by the number of breaths we take, but by the moments
that take our breath away”
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Fernando Roberto da
Silva
Sent: Tuesday, November 11, 2003 11:55 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] Is File or Directory
Hi all,
I’m trying to use IoQueryFileInformation to discover if a FileObject
is referent a file or directory, but some times this call fail with
STATUS_INVALID_PARAMETER (0xc000000d). I’m calling my simple function on
completion of create if NT_SUCCEESS(Irp->IoStatus.Status).
Any help is welcome.
NTSTATUS IsDirectory(IN PFILE_OBJECT pFileObject,
OUT PBOOLEAN pbIsDirectory)
{
NTSTATUS nts;
ULONG ulSize;
FILE_STANDARD_INFORMATION StandardInfo;
nts = IoQueryFileInformation(pFileObject,
FileStandardInformation,
sizeof(StandardInfo),
&StandardInfo,
&ulSize);
if (NT_SUCCESS(nts))
*pbIsDirectory = StandardInfo.Directory;
return nts;
}
Thanks in advance,
Fernando Roberto da Silva.
You are currently subscribed to ntfsd as: xxxxx@tacitnetworks.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
Vikramaditya,
Thanks for your attention. And can you say me how can I know if have I a
FileObject. I’m calling this routine from completion of create. In this case
pFileObject->FsContext is not NULL. Should I call ZwQueryInformationFile? or
should I call IoQueryFileInformation at PASSIVE_LEVEL?
Thanks in advance,
Fernando.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Vikramaditya Gupta
Sent: ter?a-feira, 11 de novembro de 2003 15:23
To: Windows File Systems Devs Interest List
Subject: [ntfsd] RE: Is File or Directory
make sure that u have the file object around until ur function is
executed.
Regards,
Vikramaditya.
“Life is not measured by the number of breaths we take, but by the moments
that take our breath away”
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Fernando Roberto da
Silva
Sent: Tuesday, November 11, 2003 11:55 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] Is File or Directory
Hi all,
I’m trying to use IoQueryFileInformation to discover if a FileObject
is referent a file or directory, but some times this call fail with
STATUS_INVALID_PARAMETER (0xc000000d). I’m calling my simple function on
completion of create if NT_SUCCEESS(Irp->IoStatus.Status).
Any help is welcome.
NTSTATUS IsDirectory(IN PFILE_OBJECT pFileObject,
OUT PBOOLEAN pbIsDirectory)
{
NTSTATUS nts;
ULONG ulSize;
FILE_STANDARD_INFORMATION StandardInfo;
nts = IoQueryFileInformation(pFileObject,
FileStandardInformation,
sizeof(StandardInfo),
&StandardInfo,
&ulSize);
if (NT_SUCCESS(nts))
*pbIsDirectory = StandardInfo.Directory;
return nts;
}
Thanks in advance,
Fernando Roberto da Silva.
You are currently subscribed to ntfsd as: xxxxx@scuasecurity.com.br
To unsubscribe send a blank email to xxxxx@lists.osr.com
If the file object represents a handle to a volume (FileObject->FileName.Length == 0 && FileObject->RelatedFileObject == NULL) this function will return STATUS_INVALID_PARAMETER.
Alexei.
“Fernando Roberto da Silva” wrote in message news:xxxxx@ntfsd…
Hi all,
I’m trying to use IoQueryFileInformation to discover if a FileObject is referent a file or directory, but some times this call fail with STATUS_INVALID_PARAMETER (0xc000000d). I’m calling my simple function on completion of create if NT_SUCCEESS(Irp->IoStatus.Status).
Any help is welcome.
NTSTATUS IsDirectory(IN PFILE_OBJECT pFileObject,
OUT PBOOLEAN pbIsDirectory)
{
NTSTATUS nts;
ULONG ulSize;
FILE_STANDARD_INFORMATION StandardInfo;
nts = IoQueryFileInformation(pFileObject,
FileStandardInformation,
sizeof(StandardInfo),
&StandardInfo,
&ulSize);
if (NT_SUCCESS(nts))
*pbIsDirectory = StandardInfo.Directory;
return nts;
}
Thanks in advance,
Fernando Roberto da Silva.
Also be certain that the “success” that was returned was not STATUS_REPARSE.
If the FileObject.FsContext is NULL, the file is NOT opened.
/ted
-----Original Message-----
From: Alexei Jelvis [mailto:xxxxx@rogers.com]
Sent: Tuesday, November 11, 2003 11:47 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] Re: Is File or Directory
If the file object represents a handle to a volume
(FileObject->FileName.Length == 0 && FileObject->RelatedFileObject == NULL)
this function will return STATUS_INVALID_PARAMETER.
Alexei.
“Fernando Roberto da Silva” mailto:xxxxx > wrote in message news:xxxxx@ntfsd
news:xxxxx …
Hi all,
I’m trying to use IoQueryFileInformation to discover if a FileObject is
referent a file or directory, but some times this call fail with
STATUS_INVALID_PARAMETER (0xc000000d). I’m calling my simple function on
completion of create if NT_SUCCEESS(Irp->IoStatus.Status).
Any help is welcome.
NTSTATUS IsDirectory(IN PFILE_OBJECT pFileObject,
OUT PBOOLEAN pbIsDirectory)
{
NTSTATUS nts;
ULONG ulSize;
FILE_STANDARD_INFORMATION StandardInfo;
nts = IoQueryFileInformation(pFileObject,
FileStandardInformation,
sizeof(StandardInfo),
&StandardInfo,
&ulSize);
if (NT_SUCCESS(nts))
*pbIsDirectory = StandardInfo.Directory;
return nts;
}
Thanks in advance,
Fernando Roberto da Silva.
—
You are currently subscribed to ntfsd as: xxxxx@livevault.com
To unsubscribe send a blank email to xxxxx@lists.osr.com</news:xxxxx></mailto:xxxxx>