diff --git a/src/sys/dirctl.c b/src/sys/dirctl.c index 872aac37..33254544 100644 --- a/src/sys/dirctl.c +++ b/src/sys/dirctl.c @@ -865,6 +865,8 @@ NTSTATUS FspFsvolDirectoryControlPrepare( PVOID Address; PEPROCESS Process; + ASSERT(FspProcessBufferSizeMax >= Request->Req.QueryDirectory.Length); + Result = FspProcessBufferAcquire(Request->Req.QueryDirectory.Length, &Cookie, &Address); if (!NT_SUCCESS(Result)) return Result; diff --git a/src/sys/driver.h b/src/sys/driver.h index ebe29371..31948e7d 100644 --- a/src/sys/driver.h +++ b/src/sys/driver.h @@ -1127,7 +1127,7 @@ enum FspFsvolDeviceSecurityCacheCapacity = 100, FspFsvolDeviceSecurityCacheItemSizeMax = 4096, FspFsvolDeviceDirInfoCacheCapacity = 100, - FspFsvolDeviceDirInfoCacheItemSizeMax = FSP_FSCTL_ALIGN_UP(16384, PAGE_SIZE), + FspFsvolDeviceDirInfoCacheItemSizeMax = FSP_FSCTL_ALIGN_UP(FspProcessBufferSizeMax, PAGE_SIZE), FspFsvolDeviceStreamInfoCacheCapacity = 100, FspFsvolDeviceStreamInfoCacheItemSizeMax = FSP_FSCTL_ALIGN_UP(16384, PAGE_SIZE), FspFsvolDeviceEaCacheCapacity = 100, diff --git a/tst/winfsp-tests/dirctl-test.c b/tst/winfsp-tests/dirctl-test.c index 246e23ef..dc101d9c 100644 --- a/tst/winfsp-tests/dirctl-test.c +++ b/tst/winfsp-tests/dirctl-test.c @@ -46,7 +46,7 @@ static void querydir_dotest(ULONG Flags, PWSTR Prefix, ULONG FileInfoTimeout, UL ASSERT(Success); } - for (int j = 1; 100 >= j; j++) + for (int j = 1; 400 >= j; j++) { StringCbPrintfW(FilePath, sizeof FilePath, L"%s%s\\fileABCDEFGHIJKLMNOPQRSTUVXWYZfile%d", Prefix ? L"" : L"\\\\?\\GLOBALROOT", Prefix ? Prefix : memfs_volumename(memfs), j); @@ -90,7 +90,7 @@ static void querydir_dotest(ULONG Flags, PWSTR Prefix, ULONG FileInfoTimeout, UL } while (FindNextFileW(Handle, &FindData)); ASSERT(ERROR_NO_MORE_FILES == GetLastError()); - ASSERT(110 == FileCount); + ASSERT(410 == FileCount); Success = FindClose(Handle); ASSERT(Success); @@ -194,8 +194,8 @@ static void querydir_dotest(ULONG Flags, PWSTR Prefix, ULONG FileInfoTimeout, UL } while (FindNextFileW(Handle, &FindData)); ASSERT(ERROR_NO_MORE_FILES == GetLastError()); - ASSERT(100 == FileCount); - ASSERT(101 * 100 / 2 == FileTotal); + ASSERT(400 == FileCount); + ASSERT(401 * 400 / 2 == FileTotal); Success = FindClose(Handle); ASSERT(Success); @@ -224,7 +224,7 @@ static void querydir_dotest(ULONG Flags, PWSTR Prefix, ULONG FileInfoTimeout, UL ASSERT(Success); } - for (int j = 1; 100 >= j; j++) + for (int j = 1; 400 >= j; j++) { StringCbPrintfW(FilePath, sizeof FilePath, L"%s%s\\fileABCDEFGHIJKLMNOPQRSTUVXWYZfile%d", Prefix ? L"" : L"\\\\?\\GLOBALROOT", Prefix ? Prefix : memfs_volumename(memfs), j);