[PATCH v10 0/2] MR1924: ntoskrnl.exe/tests: Add KeInitializeDpc tests.
-- v10: ntoskrnl.exe/tests: Add KeInitializeDpc tests. include: Update definition of KDPC. https://gitlab.winehq.org/wine/wine/-/merge_requests/1924
From: Etaash Mathamsetty <etaash.mathamsetty(a)gmail.com> --- include/ddk/wdm.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h index 45503f48a4e..0be909ae516 100644 --- a/include/ddk/wdm.h +++ b/include/ddk/wdm.h @@ -83,15 +83,21 @@ typedef struct _KSEMAPHORE { } KSEMAPHORE, *PKSEMAPHORE, *PRKSEMAPHORE; typedef struct _KDPC { - CSHORT Type; - UCHAR Number; - UCHAR Importance; - LIST_ENTRY DpcListEntry; + union { + ULONG TargetInfoAsUlong; + struct { + UCHAR Type; + UCHAR Importance; + volatile USHORT Number; + } DUMMYSTRUCTNAME; + } DUMMYUNIONNAME; + SINGLE_LIST_ENTRY DpcListEntry; + KAFFINITY ProcessorHistory; PKDEFERRED_ROUTINE DeferredRoutine; PVOID DeferredContext; PVOID SystemArgument1; PVOID SystemArgument2; - PULONG_PTR Lock; + volatile PVOID DpcData; } KDPC, *PKDPC, *RESTRICTED_POINTER PRKDPC; typedef enum _KDPC_IMPORTANCE { -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/1924
From: Etaash Mathamsetty <etaash.mathamsetty(a)gmail.com> --- dlls/ntoskrnl.exe/tests/driver.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/dlls/ntoskrnl.exe/tests/driver.c b/dlls/ntoskrnl.exe/tests/driver.c index bd388a6ec9e..91b0c2acaee 100644 --- a/dlls/ntoskrnl.exe/tests/driver.c +++ b/dlls/ntoskrnl.exe/tests/driver.c @@ -2119,9 +2119,26 @@ static void WINAPI test_dpc_func(PKDPC Dpc, void *context, void *cpu_count, static void test_dpc(void) { void (WINAPI *pKeGenericCallDpc)(PKDEFERRED_ROUTINE routine, void *context); + void (WINAPI *pKeInitializeDpc)(PKDPC dpc, PKDEFERRED_ROUTINE routine, void *context); struct test_dpc_func_context data; KAFFINITY cpu_mask; ULONG cpu_count; + struct _KDPC Dpc = {0}; + + pKeInitializeDpc = get_proc_address("KeInitializeDpc"); + if(!pKeInitializeDpc) + { + win_skip("KeInitializeDpc is not available.\n"); + return; + } + + pKeInitializeDpc(&Dpc, test_dpc_func, &data); + + ok(Dpc.Number == 0, "Got unexpected Dpc Number %u.\n", Dpc.Number); + todo_wine ok(Dpc.Type == 0x13, "Got unexpected Dpc Type %u.\n", Dpc.Type); + todo_wine ok(Dpc.Importance == MediumImportance, "Got unexpected Dpc Importance %u.\n", Dpc.Importance); + ok(Dpc.DeferredRoutine == test_dpc_func, "Got unexpected Dpc DeferredRoutine %p.\n", Dpc.DeferredRoutine); + ok(Dpc.DeferredContext == &data, "Got unexpected Dpc DeferredContext %p.\n", Dpc.DeferredContext); pKeGenericCallDpc = get_proc_address("KeGenericCallDpc"); if (!pKeGenericCallDpc) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/1924
participants (2)
-
Etaash Mathamsetty -
Etaash Mathamsetty (@etaash.mathamsetty)