Commit 7c7e77da authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

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: 's avatarRémi Bernon <rbernon@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent e72c71d2
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment