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 /* 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
));
52 typedef struct _SHIMINFO
56 PSHIMMODULE pShimModule
;
57 } SHIMINFO
, *PSHIMINFO
;
59 typedef struct _SHIMMODULE
64 PHOOKAPIEX (WINAPI
* pGetHookAPIs
)(LPCSTR szCommandLine
, LPCWSTR wszShimName
, PDWORD pdwHookCount
);
65 BOOL (WINAPI
* pNotifyShims
)(DWORD fdwReason
, PVOID ptr
);
67 ARRAY EnabledShims
; /* PSHIMINFO */
68 } SHIMMODULE
, *PSHIMMODULE
;
70 typedef struct _HOOKMODULEINFO
75 ARRAY HookApis
; /* PHOOKAPIEX */
77 } HOOKMODULEINFO
, *PHOOKMODULEINFO
;
80 #if SDBAPI_DEBUG_ALLOC
82 LPVOID
SdbpAlloc(SIZE_T size
, int line
, const char* file
);
83 LPVOID
SdbpReAlloc(LPVOID mem
, SIZE_T size
, SIZE_T oldSize
, int line
, const char* file
);
84 VOID
SdbpFree(LPVOID mem
, int line
, const char* file
);
86 #define SeiAlloc(size) SdbpAlloc(size, __LINE__, __FILE__)
87 #define SeiReAlloc(mem, size, oldSize) SdbpReAlloc(mem, size, oldSize, __LINE__, __FILE__)
88 #define SeiFree(mem) SdbpFree(mem, __LINE__, __FILE__)
92 LPVOID
SdbpAlloc(SIZE_T size
);
93 LPVOID
SdbpReAlloc(LPVOID mem
, SIZE_T size
, SIZE_T oldSize
);
94 VOID
SdbpFree(LPVOID mem
);
96 #define SeiAlloc(size) SdbpAlloc(size)
97 #define SeiReAlloc(mem, size, oldSize) SdbpReAlloc(mem, size, oldSize)
98 #define SeiFree(mem) SdbpFree(mem)