Rémi Bernon : ntoskrnl.exe/tests: Only count test driver load notify.
Module: wine Branch: master Commit: 7c7e77da9d4d133e992fbbde1f1f27b0c2c8fe5b URL: https://source.winehq.org/git/wine.git/?a=commit;h=7c7e77da9d4d133e992fbbde1... Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Jul 5 11:38:23 2021 +0200 ntoskrnl.exe/tests: Only count test driver load notify. Sometimes Windows loads other drivers when we don't expect it, and this causes spurious failures. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntoskrnl.exe/tests/driver.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dlls/ntoskrnl.exe/tests/driver.c b/dlls/ntoskrnl.exe/tests/driver.c index 94139b4b654..225699df402 100644 --- a/dlls/ntoskrnl.exe/tests/driver.c +++ b/dlls/ntoskrnl.exe/tests/driver.c @@ -313,8 +313,7 @@ static WCHAR test_load_image_name[MAX_PATH]; static void WINAPI test_load_image_notify_routine(UNICODE_STRING *image_name, HANDLE process_id, IMAGE_INFO *image_info) { - if (test_load_image_notify_count == -1 - || (image_name->Buffer && wcsstr(image_name->Buffer, L".tmp"))) + if (image_name->Buffer && wcsstr(image_name->Buffer, L".tmp")) { ++test_load_image_notify_count; test_image_info = *image_info; @@ -380,7 +379,7 @@ static void test_load_driver(void) || !wcscmp(test_load_image_name, full_name->Name.Buffer), "Expected image path name %ls, got %ls.\n", full_name->Name.Buffer, test_load_image_name); - test_load_image_notify_count = -1; + test_load_image_notify_count = 0; ret = ZwLoadDriver(&name); ok(ret == STATUS_IMAGE_ALREADY_LOADED, "got %#x\n", ret); @@ -395,7 +394,7 @@ static void test_load_driver(void) ret = PsRemoveLoadImageNotifyRoutine(test_load_image_notify_routine); ok(ret == STATUS_PROCEDURE_NOT_FOUND, "Got unexpected status %#x.\n", ret); - ok(test_load_image_notify_count == -1, "Got unexpected test_load_image_notify_count %u.\n", + ok(test_load_image_notify_count == 0, "Got unexpected test_load_image_notify_count %u.\n", test_load_image_notify_count); RtlFreeUnicodeString(&image_path); }
participants (1)
-
Alexandre Julliard