From b4453c89cc14e3dc6d3149312950cf2eafd34ad3 Mon Sep 17 00:00:00 2001 From: Bill Zissimopoulos Date: Thu, 30 Jun 2022 13:32:31 +0100 Subject: [PATCH] tst: winfsp-tests: RejectIrpPriorToTransact0 test fixes --- tst/winfsp-tests/mount-test.c | 9 ++++++++- tst/winfsp-tests/timeout-test.c | 5 +++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/tst/winfsp-tests/mount-test.c b/tst/winfsp-tests/mount-test.c index d97cb575..13e74a8c 100644 --- a/tst/winfsp-tests/mount-test.c +++ b/tst/winfsp-tests/mount-test.c @@ -215,6 +215,9 @@ void mount_volume_transact_dotest(PWSTR DeviceName, PWSTR Prefix) ASSERT(0 == wcsncmp(L"\\Device\\Volume{", VolumeName, 15)); ASSERT(INVALID_HANDLE_VALUE != VolumeHandle); + Result = FspFsctlTransact(VolumeHandle, 0, 0, 0, 0, FALSE); + ASSERT(NT_SUCCESS(Result)); + StringCbPrintfW(FilePath, sizeof FilePath, L"%s%s\\file0", Prefix ? L"" : L"\\\\?\\GLOBALROOT", Prefix ? Prefix : VolumeName); Thread = (HANDLE)_beginthreadex(0, 0, mount_volume_transact_dotest_thread, FilePath, 0, 0); @@ -246,6 +249,8 @@ void mount_volume_transact_dotest(PWSTR DeviceName, PWSTR Prefix) ASSERT(0 != Request->Hint); ASSERT(FspFsctlTransactCreateKind == Request->Kind || FspFsctlTransactQueryVolumeInformationKind == Request->Kind); + /* since we made RejectIrpPriorToTransact0 mandatory the assertions below do not hold */ +#if 0 if (FspFsctlTransactCreateKind == Request->Kind) { ASSERT(FILE_CREATE == ((Request->Req.Create.CreateOptions >> 24) & 0xff)); @@ -265,6 +270,7 @@ void mount_volume_transact_dotest(PWSTR DeviceName, PWSTR Prefix) ASSERT((wcslen((PVOID)Request->Buffer) + 1) * sizeof(WCHAR) == Request->FileName.Size); ASSERT(0 == mywcscmp((PVOID)Request->Buffer, -1, L"\\file0", -1)); } +#endif ASSERT(FspFsctlTransactCanProduceResponse(Response, ResponseBufEnd)); @@ -294,7 +300,8 @@ void mount_volume_transact_dotest(PWSTR DeviceName, PWSTR Prefix) GetExitCodeThread(Thread, &ExitCode); CloseHandle(Thread); - ASSERT(ERROR_ACCESS_DENIED == ExitCode || ERROR_OPERATION_ABORTED == ExitCode); + ASSERT(0 != ExitCode); + //ASSERT(ERROR_ACCESS_DENIED == ExitCode || ERROR_OPERATION_ABORTED == ExitCode); } void mount_volume_transact_test(void) diff --git a/tst/winfsp-tests/timeout-test.c b/tst/winfsp-tests/timeout-test.c index 1f5cee52..d63a0c7b 100644 --- a/tst/winfsp-tests/timeout-test.c +++ b/tst/winfsp-tests/timeout-test.c @@ -187,6 +187,8 @@ void timeout_transact_dotest(PWSTR DeviceName, PWSTR Prefix) ASSERT(0 == wcsncmp(L"\\Device\\Volume{", VolumeName, 15)); ASSERT(INVALID_HANDLE_VALUE != VolumeHandle); + Result = FspFsctlTransact(VolumeHandle, 0, 0, 0, 0, FALSE); + ASSERT(NT_SUCCESS(Result)); FSP_FSCTL_DECLSPEC_ALIGN UINT8 RequestBuf[FSP_FSCTL_TRANSACT_BATCH_BUFFER_SIZEMIN]; FSP_FSCTL_DECLSPEC_ALIGN UINT8 ResponseBuf[FSP_FSCTL_TRANSACT_RSP_SIZEMAX]; @@ -223,6 +225,8 @@ void timeout_transact_dotest(PWSTR DeviceName, PWSTR Prefix) ASSERT(0 != Request->Hint); ASSERT(FspFsctlTransactCreateKind == Request->Kind || FspFsctlTransactQueryVolumeInformationKind == Request->Kind); + /* since we made RejectIrpPriorToTransact0 mandatory the assertions below do not hold */ +#if 0 if (FspFsctlTransactCreateKind == Request->Kind) { ASSERT(FILE_CREATE == ((Request->Req.Create.CreateOptions >> 24) & 0xff)); @@ -239,6 +243,7 @@ void timeout_transact_dotest(PWSTR DeviceName, PWSTR Prefix) ASSERT(!Request->Req.Create.OpenTargetDirectory); ASSERT(!Request->Req.Create.CaseSensitive); } +#endif ResponseBufSize = 0; RequestBufSize = sizeof RequestBuf;