Skip to content

Commit

Permalink
Increase size of buffer to try to fix CI test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Holt59 committed Jun 23, 2024
1 parent de3e827 commit 4902ab0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 2 additions & 5 deletions src/usvfs_dll/hooks/ntdll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1200,11 +1200,8 @@ DLLEXPORT NTSTATUS WINAPI usvfs::hook_NtQueryInformationFile(
if (maximumLength < trackerInfo.size() - 6) {
res = STATUS_BUFFER_OVERFLOW;
} else {
LPCWSTR filenameFixed = static_cast<LPCWSTR>(trackerInfo);
if (info->FileName[0] == L'\\') {
// strip the \??\X: prefix (X being the drive name)
filenameFixed = filenameFixed + 6;
}
// strip the \??\X: prefix (X being the drive name)
LPCWSTR filenameFixed = static_cast<LPCWSTR>(trackerInfo) + 6;
SetInfoFilename(FileInformation, FileInformationClass, filenameFixed);
res = STATUS_SUCCESS;
}
Expand Down
3 changes: 2 additions & 1 deletion test/tvfs_test/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,8 @@ TEST_F(USVFSTest, NtQueryObjectVirtualFile)
// buffer of size should be too small for the original path (\Windows\notepad.exe)
// but not for \np.exe
{
char buffer[sizeof(ULONG) + 7 * 2];
// TODO: why 10?
char buffer[sizeof(ULONG) + 10 * 2];
IO_STATUS_BLOCK status;
const auto res = usvfs::hook_NtQueryInformationFile(
hdl, &status, buffer, sizeof(buffer), FileNameInformation);
Expand Down

0 comments on commit 4902ab0

Please sign in to comment.