ReactOS  0.4.15-dev-1039-gb9754fa
common.c File Reference
#include "loadconfig.h"
Include dependency graph for common.c:

Go to the source code of this file.

Functions

BOOL check_loadconfig ()
 

Variables

const IMAGE_LOAD_CONFIG_DIRECTORY _load_config_used
 

Function Documentation

◆ check_loadconfig()

BOOL check_loadconfig ( )

Definition at line 35 of file common.c.

36 {
37  BOOL Result;
38  PPEB Peb = NtCurrentPeb();
39  ULONG ConfigSize = 0;
40  ULONG MinimalSize;
42 
43  // Validate the required flag for the 'stacktrace' test
44  ok(Peb->NtGlobalFlag & FLG_USER_STACK_TRACE_DB, "NtGlobalFlag: 0x%lx\n", Peb->NtGlobalFlag);
46 
47  // Now validate our LOAD_CONFIG entry
49  TRUE,
51  &ConfigSize);
52 
53  MinimalSize = FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, SecurityCookie) + sizeof(LoadConfig->SecurityCookie);
54  if (!LoadConfig || ConfigSize < MinimalSize)
55  {
56  ok(0, "Invalid IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG: %p, %lu (%lu)\n",
57  LoadConfig, ConfigSize, MinimalSize);
58  }
59  else
60  {
61  ok(LoadConfig->GlobalFlagsSet & FLG_USER_STACK_TRACE_DB,
62  "Invalid GlobalFlagsSet: %lx\n", LoadConfig->GlobalFlagsSet);
63  ok(!(LoadConfig->GlobalFlagsClear & FLG_USER_STACK_TRACE_DB),
64  "Invalid GlobalFlagsClear: %lx\n", LoadConfig->GlobalFlagsClear);
65  ok(LoadConfig->Size == sizeof(IMAGE_LOAD_CONFIG_DIRECTORY),
66  "Unexpected size difference: %lu vs %u\n", LoadConfig->Size, sizeof(IMAGE_LOAD_CONFIG_DIRECTORY));
67  }
68 
69  return Result;
70 }
PPEB Peb
Definition: dllmain.c:27
#define TRUE
Definition: types.h:120
PVOID ImageBaseAddress
Definition: ntddk_ex.h:245
PIMAGE_LOAD_CONFIG_DIRECTORY32 PIMAGE_LOAD_CONFIG_DIRECTORY
Definition: ntimage.h:156
ULONG NtGlobalFlag
Definition: ntddk_ex.h:270
#define IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG
Definition: compat.h:153
unsigned int BOOL
Definition: ntddk_ex.h:94
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
static VOID LoadConfig(HWND hwndDlg, PPOWER_SCHEMES_PAGE_DATA pPageData, PPOWER_SCHEME pScheme)
Definition: powershemes.c:237
#define RtlImageDirectoryEntryToData
Definition: compat.h:557
#define NtCurrentPeb()
Definition: FLS.c:20
#define ok(value,...)
Definition: atltest.h:57
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
unsigned int ULONG
Definition: retypes.h:1
#define FLG_USER_STACK_TRACE_DB
Definition: pstypes.h:67

Referenced by START_TEST().

Variable Documentation

◆ _load_config_used

Initial value:
=
{
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
}
IMAGE_LOAD_CONFIG_DIRECTORY32 IMAGE_LOAD_CONFIG_DIRECTORY
Definition: ntimage.h:155
#define FLG_USER_STACK_TRACE_DB
Definition: pstypes.h:67

Definition at line 12 of file common.c.