Skip to content

Commit

Permalink
One day my CI will pass.
Browse files Browse the repository at this point in the history
  • Loading branch information
Holt59 committed Jun 23, 2024
1 parent 4902ab0 commit 8de38f6
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions test/tvfs_test/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,10 +427,18 @@ TEST_F(USVFSTest, NtQueryObjectVirtualFile)
// buffer of size should be too small for the original path (\Windows\notepad.exe)
// but not for \np.exe
{
// TODO: why 10?
char buffer[sizeof(ULONG) + 10 * 2];
// the required size should be sizeof(ULONG) + 7 * 2 but apparently that is
// not enough for the CI so using 16 * 2 which should be large enough for
// the hooked version, but still too short for the non-hooked one
char buffer[sizeof(ULONG) + 16 * 2];
IO_STATUS_BLOCK status;
const auto res = usvfs::hook_NtQueryInformationFile(
NTSTATUS res;

res = ::NtQueryInformationFile(
hdl, &status, buffer, sizeof(buffer), FileNameInformation);
ASSERT_EQ(STATUS_BUFFER_OVERFLOW, res);

res = usvfs::hook_NtQueryInformationFile(
hdl, &status, buffer, sizeof(buffer), FileNameInformation);
ASSERT_EQ(STATUS_SUCCESS, status.Status);

Expand Down

0 comments on commit 8de38f6

Please sign in to comment.