2 * Copyright 2017 Mark Jansen (mark.jansen@reactos.org)
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 /* This header is ReactOS specific */
24 /* Structure that allows dynamic growing.
25 Be aware, the data may move! */
34 typedef struct _SHIMINFO
*PSHIMINFO
;
35 typedef struct _SHIMMODULE
*PSHIMMODULE
;
37 /* Shims know this structure as HOOKAPI, with 2 reserved members (the last 2). */
38 typedef struct tagHOOKAPIEX
42 PVOID ReplacementFunction
;
43 PVOID OriginalFunction
;
46 } HOOKAPIEX
, *PHOOKAPIEX
;
48 C_ASSERT(sizeof(HOOKAPIEX
) == sizeof(HOOKAPI
));
49 C_ASSERT(offsetof(HOOKAPIEX
, pShimInfo
) == offsetof(HOOKAPI
, Reserved
));
51 typedef struct _INEXCLUDE
53 UNICODE_STRING Module
;
55 } INEXCLUDE
, *PINEXCLUDE
;
57 typedef struct _SHIMINFO
62 PSHIMMODULE pShimModule
;
63 ARRAY InExclude
; /* INEXCLUDE */
64 } SHIMINFO
, *PSHIMINFO
;
66 typedef struct _SHIMMODULE
71 PHOOKAPIEX (WINAPI
* pGetHookAPIs
)(LPCSTR szCommandLine
, LPCWSTR wszShimName
, PDWORD pdwHookCount
);
72 BOOL (WINAPI
* pNotifyShims
)(DWORD fdwReason
, PVOID ptr
);
74 ARRAY EnabledShims
; /* PSHIMINFO */
75 } SHIMMODULE
, *PSHIMMODULE
;
77 typedef struct _HOOKMODULEINFO
82 ARRAY HookApis
; /* PHOOKAPIEX */
84 } HOOKMODULEINFO
, *PHOOKMODULEINFO
;
87 #if SDBAPI_DEBUG_ALLOC
89 LPVOID
SdbpAlloc(SIZE_T size
, int line
, const char* file
);
90 LPVOID
SdbpReAlloc(LPVOID mem
, SIZE_T size
, SIZE_T oldSize
, int line
, const char* file
);
91 VOID
SdbpFree(LPVOID mem
, int line
, const char* file
);
93 #define SeiAlloc(size) SdbpAlloc(size, __LINE__, __FILE__)
94 #define SeiReAlloc(mem, size, oldSize) SdbpReAlloc(mem, size, oldSize, __LINE__, __FILE__)
95 #define SeiFree(mem) SdbpFree(mem, __LINE__, __FILE__)
99 LPVOID
SdbpAlloc(SIZE_T size
);
100 LPVOID
SdbpReAlloc(LPVOID mem
, SIZE_T size
, SIZE_T oldSize
);
101 VOID
SdbpFree(LPVOID mem
);
103 #define SeiAlloc(size) SdbpAlloc(size)
104 #define SeiReAlloc(mem, size, oldSize) SdbpReAlloc(mem, size, oldSize)
105 #define SeiFree(mem) SdbpFree(mem)