ReactOS 0.4.16-dev-197-g92996da
RtlDebugInformation.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS api tests
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Test for RTL_DEBUG_INFORMATION
5 * COPYRIGHT: Copyright 2020 Mark Jansen (mark.jansen@reactos.org)
6 */
7
8#include "precomp.h"
9
10#ifndef _WIN64
12#endif
13
14static void Test_Buffersizes()
15{
18
20 ok(Buffer != NULL, "Unable to create default buffer\n");
21 if (!Buffer)
22 return;
23
24 ok_ptr(Buffer->ViewBaseClient, Buffer);
25 ok_hex(Buffer->Flags, 0);
26 ok(Buffer->OffsetFree == sizeof(*Buffer) || Buffer->OffsetFree == 0x60, "Expected %u or %u, got %lu\n", sizeof(*Buffer), 0x60, Buffer->OffsetFree);
27 ok_hex(Buffer->CommitSize, 0x1000);
28 ok_hex(Buffer->ViewSize, 0x400000);
29
32
34 ok(Buffer != NULL, "Unable to create default buffer\n");
35 if (!Buffer)
36 return;
37
38 ok_ptr(Buffer->ViewBaseClient, Buffer);
39 ok_hex(Buffer->Flags, 0);
40 ok(Buffer->OffsetFree == sizeof(*Buffer) || Buffer->OffsetFree == 0x60, "Expected %u or %u, got %lu\n", sizeof(*Buffer), 0x60, Buffer->OffsetFree);
41 ok_hex(Buffer->CommitSize, 0x1000);
42 ok_hex(Buffer->ViewSize, 0x1000);
43
46
48 ok(Buffer != NULL, "Unable to create default buffer\n");
49 if (!Buffer)
50 return;
51
52 ok_ptr(Buffer->ViewBaseClient, Buffer);
53 ok_hex(Buffer->Flags, 0);
54 ok(Buffer->OffsetFree == sizeof(*Buffer) || Buffer->OffsetFree == 0x60, "Expected %u or %u, got %lu\n", sizeof(*Buffer), 0x60, Buffer->OffsetFree);
55 ok_hex(Buffer->CommitSize, 0x1000);
56 ok_hex(Buffer->ViewSize, 0x1000);
57
60
62 ok(Buffer != NULL, "Unable to create default buffer\n");
63 if (!Buffer)
64 return;
65
66 ok_ptr(Buffer->ViewBaseClient, Buffer);
67 ok_hex(Buffer->Flags, 0);
68 ok(Buffer->OffsetFree == sizeof(*Buffer) || Buffer->OffsetFree == 0x60, "Expected %u or %u, got %lu\n", sizeof(*Buffer), 0x60, Buffer->OffsetFree);
69 ok_hex(Buffer->CommitSize, 0x1000);
70 ok_hex(Buffer->ViewSize, 0x2000);
71
74
76 ok(Buffer == NULL, "Got a valid thing?\n");
77 if (Buffer)
78 {
81 }
82}
83
84
85static void Test_ProcessModules(void)
86{
90 PRTL_PROCESS_MODULES ExpectedModules;
91
93 ok(Buffer != NULL, "Unable to create default buffer\n");
94 if (!Buffer)
95 return;
96
99
102
105 if (NT_SUCCESS(Status))
106 {
107
110 if (SUCCEEDED(Status))
111 {
112 ok(!memcmp(ExpectedModules, Buffer->Modules, RequiredSize), "Unexpected difference!\n");
113 }
114 }
115 if (ExpectedModules)
116 HeapFree(GetProcessHeap(), 0, ExpectedModules);
117
120}
121
122
123START_TEST(RtlDebugInformation)
124{
127}
static void Test_Buffersizes()
static void Test_ProcessModules(void)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define ok_hex(expression, result)
Definition: atltest.h:94
#define ok(value,...)
Definition: atltest.h:57
#define START_TEST(x)
Definition: atltest.h:75
#define ok_ptr(expression, result)
Definition: atltest.h:108
LONG NTSTATUS
Definition: precomp.h:26
Definition: bufpool.h:45
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
Status
Definition: gdiplustypes.h:25
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define C_ASSERT(e)
Definition: intsafe.h:73
NTSTATUS NTAPI LdrQueryProcessModuleInformation(_Out_writes_bytes_to_(Size, *ReturnedSize) PRTL_PROCESS_MODULES ModuleInformation, _In_ ULONG Size, _Out_opt_ PULONG ReturnedSize)
Definition: ldrapi.c:1076
NTSYSAPI NTSTATUS NTAPI RtlDestroyQueryDebugBuffer(IN PRTL_DEBUG_INFORMATION DebugBuffer)
NTSYSAPI NTSTATUS NTAPI RtlQueryProcessDebugInformation(_In_ ULONG ProcessId, _In_ ULONG DebugInfoClassMask, _Inout_ PRTL_DEBUG_INFORMATION DebugBuffer)
NTSYSAPI PRTL_DEBUG_INFORMATION NTAPI RtlCreateQueryDebugBuffer(_In_ ULONG Size, _In_ BOOLEAN EventPair)
Definition: dbgbuffer.c:66
#define RTL_DEBUG_QUERY_MODULES
Definition: rtltypes.h:366
#define STATUS_SUCCESS
Definition: shellext.h:65
uint32_t ULONG
Definition: typedefs.h:59
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ ULONG _Out_ PVOID _Out_ PULONG RequiredSize
Definition: wdfdevice.h:4439
DWORD WINAPI GetCurrentProcessId(void)
Definition: proc.c:1158