https://git.reactos.org/?p=reactos.git;a=commitdiff;h=804b7830b7af7642f3c71…
commit 804b7830b7af7642f3c7100599ca319c4e7f8170
Author: Mark Jansen <mark.jansen(a)reactos.org>
AuthorDate: Tue Apr 21 22:10:49 2020 +0200
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sun Apr 26 13:44:02 2020 +0200
[NTDLL_APITEST] Add test for RTL_DEBUG_QUERY_MODULES
---
.../rostests/apitests/ntdll/RtlDebugInformation.c | 41 +++++++++++++++++++++-
1 file changed, 40 insertions(+), 1 deletion(-)
diff --git a/modules/rostests/apitests/ntdll/RtlDebugInformation.c
b/modules/rostests/apitests/ntdll/RtlDebugInformation.c
index 19d73211e54..c87c58a4d6c 100644
--- a/modules/rostests/apitests/ntdll/RtlDebugInformation.c
+++ b/modules/rostests/apitests/ntdll/RtlDebugInformation.c
@@ -81,8 +81,47 @@ static void Test_Buffersizes()
}
}
+
+static void Test_ProcessModules(void)
+{
+ PRTL_DEBUG_INFORMATION Buffer;
+ NTSTATUS Status;
+ ULONG RequiredSize = 0;
+ PRTL_PROCESS_MODULES ExpectedModules;
+
+ Buffer = RtlCreateQueryDebugBuffer(0, FALSE);
+ ok(Buffer != NULL, "Unable to create default buffer\n");
+ if (!Buffer)
+ return;
+
+ Status = LdrQueryProcessModuleInformation(NULL, 0, &RequiredSize);
+ ok_hex(Status, STATUS_INFO_LENGTH_MISMATCH);
+
+ RequiredSize;
+ ExpectedModules = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, RequiredSize);
+
+ Status = LdrQueryProcessModuleInformation(ExpectedModules, RequiredSize,
&RequiredSize);
+ ok_hex(Status, STATUS_SUCCESS);
+ if (NT_SUCCESS(Status))
+ {
+
+ Status = RtlQueryProcessDebugInformation(GetCurrentProcessId(),
RTL_DEBUG_QUERY_MODULES, Buffer);
+ ok_hex(Status, STATUS_SUCCESS);
+ if (SUCCEEDED(Status))
+ {
+ ok(!memcmp(ExpectedModules, Buffer->Modules, RequiredSize),
"Unexpected difference!\n");
+ }
+ }
+ if (ExpectedModules)
+ HeapFree(GetProcessHeap(), 0, ExpectedModules);
+
+ Status = RtlDestroyQueryDebugBuffer(Buffer);
+ ok_hex(Status, STATUS_SUCCESS);
+}
+
+
START_TEST(RtlDebugInformation)
{
Test_Buffersizes();
- skip("No test for remote debug information yet!\n");
+ Test_ProcessModules();
}