ReactOS 0.4.15-dev-7924-g5949c20
RtlDebugInformation.c File Reference
#include "precomp.h"
Include dependency graph for RtlDebugInformation.c:

Go to the source code of this file.

Functions

 C_ASSERT (sizeof(RTL_DEBUG_INFORMATION)==0x68)
 
static void Test_Buffersizes ()
 
static void Test_ProcessModules (void)
 
 START_TEST (RtlDebugInformation)
 

Function Documentation

◆ C_ASSERT()

C_ASSERT ( sizeof(RTL_DEBUG_INFORMATION = =0x68)

◆ START_TEST()

START_TEST ( RtlDebugInformation  )

Definition at line 123 of file RtlDebugInformation.c.

124{
127}
static void Test_Buffersizes()
static void Test_ProcessModules(void)

◆ Test_Buffersizes()

static void Test_Buffersizes ( )
static

Definition at line 14 of file RtlDebugInformation.c.

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}
#define ok_hex(expression, result)
Definition: atltest.h:94
#define ok(value,...)
Definition: atltest.h:57
#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
Status
Definition: gdiplustypes.h:25
NTSYSAPI NTSTATUS NTAPI RtlDestroyQueryDebugBuffer(IN PRTL_DEBUG_INFORMATION DebugBuffer)
NTSYSAPI PRTL_DEBUG_INFORMATION NTAPI RtlCreateQueryDebugBuffer(_In_ ULONG Size, _In_ BOOLEAN EventPair)
Definition: dbgbuffer.c:66
#define STATUS_SUCCESS
Definition: shellext.h:65

Referenced by START_TEST().

◆ Test_ProcessModules()

static void Test_ProcessModules ( void  )
static

Definition at line 85 of file RtlDebugInformation.c.

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}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#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
#define SUCCEEDED(hr)
Definition: intsafe.h:50
NTSTATUS NTAPI LdrQueryProcessModuleInformation(_Out_writes_bytes_to_(Size, *ReturnedSize) PRTL_PROCESS_MODULES ModuleInformation, _In_ ULONG Size, _Out_opt_ PULONG ReturnedSize)
Definition: ldrapi.c:1116
NTSYSAPI NTSTATUS NTAPI RtlQueryProcessDebugInformation(_In_ ULONG ProcessId, _In_ ULONG DebugInfoClassMask, _Inout_ PRTL_DEBUG_INFORMATION DebugBuffer)
#define RTL_DEBUG_QUERY_MODULES
Definition: rtltypes.h:366
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

Referenced by START_TEST().