There is obviously something wrong with your implementation, but I’ll be
honest, it isn’t easy to tell from a code snippet - directory
enumeration in particular is complicated to get right. It could be the
value you return in the Information field, or the status code you
return, or the way you set up the individual directory entries.
Normally, the filename IS null on 2nd call (VDM will pass it in again,
but not Win32) and you are responsible for remembering this information.
So, focus on how you build those buffers - are you aligning each entry
on a quadword boundary? That’s required. Are you obeying the rules?
Here’s a decent summary from the fastfat code (in the IFS kit, which you
should certainly be using in crafting your directory code):
//
// Here are the rules concerning filling up the buffer:
//
// 1. The Io system garentees that there will always be
// enough room for at least one base record.
//
// 2. If the full first record (including file name)
cannot
// fit, as much of the name as possible is copied and
// STATUS_BUFFER_OVERFLOW is returned.
//
// 3. If a subsequent record cannot completely fit into
the
// buffer, none of it (as in 0 bytes) is copied, and
// STATUS_SUCCESS is returned. A subsequent query will
// pick up with this record.
//
And rather than trying to start with explorer, how about you build a
test application so you can look at what you are getting back. Start by
trying FindFirst/FindNext (win32 api) for directory enumeration and if
you can’t figure it out from there, build an application that does a
ZwQueryDirectoryFile and retrieve the raw data buffers - then compare
what NTFS and FAT return from what you return. I bet you’ll figure it
out that way.
Welcome to the wonderful world of file systems!
Regards,
Tony
Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Krishnama Raju
Sent: Wednesday, April 07, 2004 5:55 AM
To: ntfsd redirect
Subject: [ntfsd] Problem with IRP_MJ_DIRECTORY_CONTROL -
FILE_BOTH_DIR_INFORMATION
Thank you for your information. But Actually I’m handling
SL_RETURN_SINGLE_ENTRY for which I’m returning only one entry with the
status as “STATUS_SUCCESS”. But still the problem exists.
- First time it requests with the Query as “*” and the filename
as “*” (in my case its the root dir)
and with the flag SL_RETURN_SINGLE_ENTRY.
=: Here I’m returning only one entry and completing the
request.
- Immediately after the above request I’m getting the Query as
“NULL” with the filename as “(null)”, but this time without
the flag SL_RETURN_SINGLE_ENTRY.
=: For this request, I’m returning multiple entries as I
mentioned last time(PLZ see below).
where as the explorer displays only one entry. Could someone
help me to resolve this plz?
Thanking you in advance
–
Cheers
K.Raju
X-Message-Number: 2
X-lyris-Id: 59373
Date: Tue, 6 Apr 2004 07:59:15 -0400
From: “Tony Mason”
Subject: RE: Problem with IRP_MJ_DIRECTORY_CONTROL -
FILE_BOTH_DIR_INFORMATION
Do you properly handle the SL_RETURN_SINGLE_ENTRY option?
When Win32 applications use the FindFirst/FindNext interface, the first
call into the FSD normally indicates SL_RETURN_SINGLE_ENTRY and
subsequent calls do not include that bit. If you are returning multiple
entries on the first call, it will ignore the 2nd and subsequent entries
(it only asked for one!)
Of course, you might be doing that, but it isn’t present in the code
snippet you included.
Regards,
Tony=20
Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Krishnama Raju
Sent: Tuesday, April 06, 2004 7:40 AM
To: ntfsd redirect
Subject: [ntfsd] Problem with IRP_MJ_DIRECTORY_CONTROL -
FILE_BOTH_DIR_INFORMATION
Hello Everybody
I am implementing a file system driver which is the type of
FILE_DEVICE_DISK_FILE_SYSTEM. But actually this is not an disk based
instead I’ll get the data remotely and fill in the IRP.=20
My problem is, After filling the information in the IRP for the
request of IRP_MJ_DIRECTORY_CONTROL - FILE_BOTH_DIR_INFORMATION ,
Explorer is not displaying all the folders that I have added, instead it
displays only one folder. Even I have tried printing the information
just before completing the request, where in it prints all the folders I
have added. Following is the code snippet for printing the added info…
pData =3D Buffer; // User Buffer
pInfo=3D (PFILE_BOTH_DIR_INFORMATION)pData;
while (TRUE && pInfo!=3DNULL)
{ =20
//(%C, %S, %lc, %ls, %wc, %ws, %wZ)=20
DbgPrint (“\n\tINQUESTFSD @
FatQueryDirectory->ADDRESS ---- pInfo %08lx”,pInfo);
DbgPrint(“\n\tINQUESTFSD @ FatQueryDirectory->END END
Name =3D %ws”,pInfo->FileName);
if (pInfo->NextEntryOffset =3D=3D 0 )
break;
// Increment the variables
pData +=3D pInfo->NextEntryOffset;
pInfo =3D (PFILE_BOTH_DIR_INFORMATION) pData;
Count++;
}
The above code works fine and prints the added items (Folders/files),
but the Explorer displays only one item(First item).=20
I’m going thru lot of solutions but doesn’t seems to be helping me out.
So… could somebody through some light on it and help me to come out of
this problem… plz… thanking you in anticipation…
Please advise… Thanks in advance.=20
Cheers
K.Raju
-----------------------------------------------------------
—
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to xxxxx@lists.osr.com