8bed7b64b292e3afe2e3db90ab232b4f796d35d0
2 * Copyright 2013 Mislav Blažević
3 * Copyright 2015 Mark Jansen
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
27 typedef enum _SHIM_LOG_LEVEL
{
34 BOOL WINAPIV
ShimDbgPrint(SHIM_LOG_LEVEL Level
, PCSTR FunctionName
, PCSTR Format
, ...);
35 extern ULONG g_ShimDebugLevel
;
37 #define SHIM_ERR(fmt, ...) do { if (g_ShimDebugLevel) ShimDbgPrint(SHIM_ERR, __FUNCTION__, fmt, ##__VA_ARGS__ ); } while (0)
38 #define SHIM_WARN(fmt, ...) do { if (g_ShimDebugLevel) ShimDbgPrint(SHIM_WARN, __FUNCTION__, fmt, ##__VA_ARGS__ ); } while (0)
39 #define SHIM_INFO(fmt, ...) do { if (g_ShimDebugLevel) ShimDbgPrint(SHIM_INFO, __FUNCTION__, fmt, ##__VA_ARGS__ ); } while (0)
43 void SdbpHeapInit(void);
44 void SdbpHeapDeinit(void);
45 #if SDBAPI_DEBUG_ALLOC
47 LPVOID
SdbpAlloc(SIZE_T size
, int line
, const char* file
);
48 LPVOID
SdbpReAlloc(LPVOID mem
, SIZE_T size
, int line
, const char* file
);
49 void SdbpFree(LPVOID mem
, int line
, const char* file
);
51 #define SdbAlloc(size) SdbpAlloc(size, __LINE__, __FILE__)
52 #define SdbReAlloc(mem, size) SdbpReAlloc(mem, size, __LINE__, __FILE__)
53 #define SdbFree(mem) SdbpFree(mem, __LINE__, __FILE__)
57 LPVOID
SdbpAlloc(SIZE_T size
);
58 LPVOID
SdbpReAlloc(LPVOID mem
, SIZE_T size
);
59 void SdbpFree(LPVOID mem
);
61 #define SdbAlloc(size) SdbpAlloc(size)
62 #define SdbReAlloc(mem, size) SdbpReAlloc(mem, size)
63 #define SdbFree(mem) SdbpFree(mem)