ReactOS  0.4.15-dev-1070-ge1a01de
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 
75  Buffer = RtlCreateQueryDebugBuffer(0x7fffffff, FALSE);
76  ok(Buffer == NULL, "Got a valid thing?\n");
77  if (Buffer)
78  {
81  }
82 }
LONG NTSTATUS
Definition: precomp.h:26
#define ok_ptr(expression, result)
Definition: atltest.h:108
NTSYSAPI PRTL_DEBUG_INFORMATION NTAPI RtlCreateQueryDebugBuffer(_In_ ULONG Size, _In_ BOOLEAN EventPair)
Definition: dbgbuffer.c:66
#define ok_hex(expression, result)
Definition: atltest.h:94
#define FALSE
Definition: types.h:117
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
NTSYSAPI NTSTATUS NTAPI RtlDestroyQueryDebugBuffer(IN PRTL_DEBUG_INFORMATION DebugBuffer)
Status
Definition: gdiplustypes.h:24
#define ok(value,...)
Definition: atltest.h:57
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
return STATUS_SUCCESS
Definition: btrfs.c:3014

Referenced by START_TEST().

◆ Test_ProcessModules()

static void Test_ProcessModules ( void  )
static

Definition at line 85 of file RtlDebugInformation.c.

86 {
89  ULONG RequiredSize = 0;
90  PRTL_PROCESS_MODULES ExpectedModules;
91 
93  ok(Buffer != NULL, "Unable to create default buffer\n");
94  if (!Buffer)
95  return;
96 
99 
100  RequiredSize;
101  ExpectedModules = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, RequiredSize);
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 STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
LONG NTSTATUS
Definition: precomp.h:26
_Inout_ PRTL_BUFFER _In_ SIZE_T RequiredSize
NTSYSAPI PRTL_DEBUG_INFORMATION NTAPI RtlCreateQueryDebugBuffer(_In_ ULONG Size, _In_ BOOLEAN EventPair)
Definition: dbgbuffer.c:66
#define ok_hex(expression, result)
Definition: atltest.h:94
#define FALSE
Definition: types.h:117
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define RTL_DEBUG_QUERY_MODULES
Definition: rtltypes.h:364
#define GetProcessHeap()
Definition: compat.h:484
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
NTSTATUS NTAPI LdrQueryProcessModuleInformation(IN PRTL_PROCESS_MODULES ModuleInformation, IN ULONG Size, OUT PULONG ReturnedSize OPTIONAL)
Definition: ldrapi.c:1107
NTSYSAPI NTSTATUS NTAPI RtlDestroyQueryDebugBuffer(IN PRTL_DEBUG_INFORMATION DebugBuffer)
Status
Definition: gdiplustypes.h:24
NTSYSAPI NTSTATUS NTAPI RtlQueryProcessDebugInformation(_In_ ULONG ProcessId, _In_ ULONG DebugInfoClassMask, _Inout_ PRTL_DEBUG_INFORMATION DebugBuffer)
#define ok(value,...)
Definition: atltest.h:57
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
unsigned int ULONG
Definition: retypes.h:1
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
return STATUS_SUCCESS
Definition: btrfs.c:3014
#define HeapFree(x, y, z)
Definition: compat.h:483
DWORD WINAPI GetCurrentProcessId(VOID)
Definition: proc.c:1158
#define SUCCEEDED(hr)
Definition: intsafe.h:49

Referenced by START_TEST().