Each individual buffer is OK. So file info is passed correctly to the
called (via the SMB layer).
The problem is that IRP_MJ_DIRECTORY_CONTROL tries to tell my FSD to
restart the search, but does it in an odd way, w/o setting
SL_RESTART_SCAN.
Anyway, after writing the orig post, I’ve discovered that after several
buffers IRP_MJ_DIRECTORY_CONTROL is called with SL_INDEX_SPECIFIED set,
but still with SL_RESTART_SCAN off. A bit of a contradiction.
Then I looked at how FAT handles it. Here is a code fragment:
// Determine where to start the scan. Highest priority is given
// to the file index. Lower priority is the restart flag. If
// neither of these is specified, then the Vbo offset field in
the
// Ccb is used.
if (IndexSpecified) {
CurrentVbo = FileIndex + sizeof( DIRENT );
} else if (RestartScan) {
CurrentVbo = 0;
} else {
CurrentVbo = Ccb->OffsetToStartSearchFrom;
}
So I think I know what to do. When there’s an inconsistency between the
SL_INDEX_SPECIFIED and the SL_RESTART_SCAN flags, SL_INDEX_SPECIFIED
should have precedence.
Thanks for looking at this problem.
Chuck Shavit
Can you trace to how many files are needed for it to happen? What is the
minimum? If you go from there, it could be incorrect setting of sizes,
lengths, NextEntryOffset and such. What about Irp->IoStatus.Information field?
xxxxx@magicsquare.com wrote:
> Hi,
>
> I have an FSD that works fine locally. It mounts the files as a HD
> volume. To test it, I use a directory with hundreds of files, and they
> list correctly from Win32 (e.g., Explorer displays correctly all the files
> in the folder).
>
> My problem is when these files are accessed from another machine via SMB.
> I “share” the folder on the local machine, and access it from a remote
> machine. When I do that, some of the files are missing from an Explorer
> display of the folder.
>
> I traced this to the IRP_MJ_DIRECTORY_CONTROL request executed locally
> when the remote machine’s Explorer lists the directory. Here is what
> happens:
>
> - the first IRP_MJ_DIRECTORY_CONTROL does not specify SL_RESTART_SCAN
> (which I believe is contrary to the IFS doc) and specified FileName of
> “*”. As a result, the FSD fills the 4K buf with as much file data as can
> fit.
>
> - A couple of IRP_MJ_DIRECTORY_CONTROL requests follow, each with
> SL_RESTART_SCAN=0 and a NULL FileName. The FSD fills these buffers with
> more files, as it should.
>
> - Now comes the surprise, which I’ve seen only when SMB is involved.
> The next IRP_MJ_DIRECTORY_CONTROL request specifies a FileName which is
> the last file listed in the previous 4K buf. However, SL_RESTART_SCAN is
> off, so per the IFS doc the FileName is disregarded and the directory
> listing continues from the last file of the last buffer.
>
> Turns out that the file specified in FileName in the last bullet is
> missing from Explorer’s listing.
>
> Had anyone seen this? What should the FSD do?
>
> Thanks
> Chuck Shavit
>
> —
> You are currently subscribed to ntfsd as: xxxxx@alfasp.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
–
Kind regards, Dejan M. www.alfasp.com
E-mail: xxxxx@alfasp.com
Alfa Transparent File Encryptor - Transparent file encryption services.
Alfa File Protector - File protection and hiding library for Win32 developers.
Alfa File Monitor - File monitoring library for Win32 developers.