Skip to content

Commit

Permalink
squash! fscache: teach fscache to use NtQueryDirectoryFile
Browse files Browse the repository at this point in the history
The NtQueryDirectoryFile() call works best (and on Windows 8.1 and
earlier, it works *only*) with buffer sizes up to 64kB. Which is 32k
wide characters, so let's use that as our buffer size.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Jan 29, 2019
1 parent 9e107c9 commit 32e6742
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion compat/win32/fscache.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ struct fscache {
unsigned int opendir_requests;
unsigned int fscache_requests;
unsigned int fscache_misses;
WCHAR buffer[64 * 1024];
/*
* 32k wide characters translates to 64kB, which is the maximum that
* Windows 8.1 and earlier can handle. On network drives, not only
* the client's Windows version matters, but also the server's,
* therefore we need to keep this to 64kB.
*/
WCHAR buffer[32 * 1024];
};
static struct trace_key trace_fscache = TRACE_KEY_INIT(FSCACHE);

Expand Down

0 comments on commit 32e6742

Please sign in to comment.