ReactOS  0.4.14-dev-1034-g1e60116
shimeng.h
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Application compatibility module
3  * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4  * PURPOSE: Shim engine structures
5  * COPYRIGHT: Copyright 2017 Mark Jansen (mark.jansen@reactos.org)
6  */
7 
8 #ifndef SHIMENG_H
9 #define SHIMENG_H
10 
11 /* This header is ReactOS specific */
12 
13 /* Structure that allows dynamic growing.
14  Be aware, the data may move! */
15 typedef struct _ARRAY
16 {
21 } ARRAY, *PARRAY;
22 
23 typedef struct _SHIMINFO *PSHIMINFO;
24 typedef struct _SHIMMODULE *PSHIMMODULE;
25 
26 typedef struct tagHOOKAPIEX *PHOOKAPIEX;
27 
28 /* Shims know this structure as HOOKAPI, with 2 reserved members (the last 2). */
29 typedef struct tagHOOKAPIEX
30 {
37 } HOOKAPIEX;
38 
39 C_ASSERT(sizeof(HOOKAPIEX) == sizeof(HOOKAPI));
41 
42 typedef struct _INEXCLUDE
43 {
47 
48 typedef struct _SHIMINFO
49 {
54  ARRAY InExclude; /* INEXCLUDE */
56 
57 typedef struct _SHIMMODULE
58 {
61 
63  BOOL (WINAPI* pNotifyShims)(DWORD fdwReason, PVOID ptr);
64 
65  ARRAY EnabledShims; /* PSHIMINFO */
67 
68 typedef struct _HOOKMODULEINFO
69 {
72 
73  ARRAY HookApis; /* PHOOKAPIEX */
74 
76 
77 typedef struct _FLAGINFO
78 {
83 
84 
85 #if SDBAPI_DEBUG_ALLOC
86 
87 LPVOID SdbpAlloc(SIZE_T size, int line, const char* file);
88 LPVOID SdbpReAlloc(LPVOID mem, SIZE_T size, SIZE_T oldSize, int line, const char* file);
89 VOID SdbpFree(LPVOID mem, int line, const char* file);
90 
91 #define SeiAlloc(size) SdbpAlloc(size, __LINE__, __FILE__)
92 #define SeiReAlloc(mem, size, oldSize) SdbpReAlloc(mem, size, oldSize, __LINE__, __FILE__)
93 #define SeiFree(mem) SdbpFree(mem, __LINE__, __FILE__)
94 
95 #else
96 
100 
101 #define SeiAlloc(size) SdbpAlloc(size)
102 #define SeiReAlloc(mem, size, oldSize) SdbpReAlloc(mem, size, oldSize)
103 #define SeiFree(mem) SdbpFree(mem)
104 
105 #endif
106 
107 #endif // SHIMENG_H
C_ASSERT(sizeof(HOOKAPIEX)==sizeof(HOOKAPI))
const uint16_t * PCWSTR
Definition: typedefs.h:56
struct _SHIMMODULE SHIMMODULE
UNICODE_STRING Name
Definition: shimeng.h:70
ARRAY HookApis
Definition: shimeng.h:73
struct tagHOOKAPIEX HOOKAPIEX
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
DWORD Size__
Definition: shimeng.h:18
ULONG ProcessParameters_Flags
Definition: shimeng.h:81
struct _SHIMINFO * PSHIMINFO
Definition: shimeng.h:23
ULARGE_INTEGER AppCompatFlags
Definition: shimeng.h:79
struct tagHOOKAPIEX * PHOOKAPIEX
Definition: shimeng.h:26
PVOID BaseAddress
Definition: shimeng.h:60
struct _INEXCLUDE * PINEXCLUDE
DWORD dwHookCount
Definition: shimeng.h:52
PVOID BaseAddress
Definition: shimeng.h:71
PVOID ptr
Definition: shimeng.h:63
struct _ARRAY * PARRAY
struct _FLAGINFO FLAGINFO
PHOOKAPIEX pHookApi
Definition: shimeng.h:51
struct _SHIMINFO SHIMINFO
unsigned int BOOL
Definition: ntddk_ex.h:94
UNICODE_STRING Name
Definition: shimeng.h:59
#define offsetof(TYPE, MEMBER)
Definition: parser.c:48
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
const char * LPCSTR
Definition: xmlstorage.h:183
VOID SdbpFree(LPVOID mem)
Definition: sdbapi.c:81
LPVOID SdbpAlloc(SIZE_T size)
Definition: sdbapi.c:55
PSHIMMODULE pShimModule
Definition: shimeng.h:53
PHOOKAPIEX(WINAPI *pGetHookAPIs)(LPCSTR szCommandLine
GLsizeiptr size
Definition: glext.h:5919
LPCWSTR wszShimName
Definition: shimeng.h:62
UNICODE_STRING Module
Definition: shimeng.h:44
struct _SHIMMODULE * PSHIMMODULE
Definition: shimeng.h:24
#define WINAPI
Definition: msvc.h:6
unsigned long DWORD
Definition: ntddk_ex.h:95
PCWSTR ShimName
Definition: shimeng.h:50
struct _ARRAY ARRAY
struct _FLAGINFO * PFLAGINFO
static tGETHOOKAPIS pGetHookAPIs
Definition: dispmode.c:26
BOOL Include
Definition: shimeng.h:45
PVOID OriginalFunction
Definition: shimeng.h:34
LPCWSTR PDWORD pdwHookCount
Definition: shimeng.h:62
struct _HOOKMODULEINFO HOOKMODULEINFO
ULARGE_INTEGER AppCompatFlagsUser
Definition: shimeng.h:80
PCSTR LibraryName
Definition: shimeng.h:31
LPVOID SdbpReAlloc(LPVOID mem, SIZE_T size, SIZE_T oldSize)
Definition: sdbapi.c:68
BOOL(WINAPI *pNotifyShims)(DWORD fdwReason
PVOID Data__
Definition: shimeng.h:17
ARRAY EnabledShims
Definition: shimeng.h:65
PCSTR FunctionName
Definition: shimeng.h:32
ULONG_PTR SIZE_T
Definition: typedefs.h:79
PHOOKAPIEX ApiLink
Definition: shimeng.h:36
PSHIMINFO pShimInfo
Definition: shimeng.h:35
DWORD ItemSize__
Definition: shimeng.h:20
ARRAY InExclude
Definition: shimeng.h:54
PVOID ReplacementFunction
Definition: shimeng.h:33
DWORD * PDWORD
Definition: pedump.c:68
struct _INEXCLUDE INEXCLUDE
Definition: mem.c:156
Definition: shimeng.h:15
unsigned int ULONG
Definition: retypes.h:1
const char * PCSTR
Definition: typedefs.h:52
struct _HOOKMODULEINFO * PHOOKMODULEINFO
DWORD MaxSize__
Definition: shimeng.h:19
Definition: fci.c:126