ReactOS  0.4.13-dev-39-g8b6696f
sdbpapi.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 private functions
5  * COPYRIGHT: Copyright 2013 Mislav Blažević
6  * Copyright 2015-2017 Mark Jansen (mark.jansen@reactos.org)
7  */
8 
9 #ifndef SDBPAPI_H
10 #define SDBPAPI_H
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 void SdbpHeapInit(void);
17 void SdbpHeapDeinit(void);
18 
19 #if SDBAPI_DEBUG_ALLOC
20 
21 LPVOID SdbpAlloc(SIZE_T size, int line, const char* file);
22 LPVOID SdbpReAlloc(LPVOID mem, SIZE_T size, SIZE_T oldSize, int line, const char* file);
23 void SdbpFree(LPVOID mem, int line, const char* file);
24 
25 #define SdbAlloc(size) SdbpAlloc(size, __LINE__, __FILE__)
26 #define SdbReAlloc(mem, size, oldSize) SdbpReAlloc(mem, size, oldSize, __LINE__, __FILE__)
27 #define SdbFree(mem) SdbpFree(mem, __LINE__, __FILE__)
28 
29 #else
30 
33 void SdbpFree(LPVOID mem);
34 
35 #define SdbAlloc(size) SdbpAlloc(size)
36 #define SdbReAlloc(mem, size, oldSize) SdbpReAlloc(mem, size, oldSize)
37 #define SdbFree(mem) SdbpFree(mem)
38 
39 #endif
40 
41 #if !defined(SDBWRITE_HOSTTOOL)
42 typedef struct tagMEMMAPPED {
49 
52 #endif
53 
54 
56 void WINAPI SdbpFlush(PDB pdb);
57 DWORD SdbpStrlen(PCWSTR string);
58 DWORD SdbpStrsize(PCWSTR string);
59 
62 
63 #ifndef WINAPIV
64 #define WINAPIV
65 #endif
66 
67 typedef enum _SHIM_LOG_LEVEL {
68  SHIM_ERR = 1,
69  SHIM_WARN = 2,
70  SHIM_INFO = 3,
72 
74 extern ULONG g_ShimDebugLevel;
75 
76 #define SHIM_ERR(fmt, ...) do { if (g_ShimDebugLevel) ShimDbgPrint(SHIM_ERR, __FUNCTION__, fmt, ##__VA_ARGS__ ); } while (0)
77 #define SHIM_WARN(fmt, ...) do { if (g_ShimDebugLevel) ShimDbgPrint(SHIM_WARN, __FUNCTION__, fmt, ##__VA_ARGS__ ); } while (0)
78 #define SHIM_INFO(fmt, ...) do { if (g_ShimDebugLevel) ShimDbgPrint(SHIM_INFO, __FUNCTION__, fmt, ##__VA_ARGS__ ); } while (0)
79 
80 #ifdef __cplusplus
81 } // extern "C"
82 #endif
83 
84 #endif // SDBPAPI_H
struct tagMEMMAPPED * PMEMMAPPED
void SdbpHeapDeinit(void)
Definition: sdbapi.c:42
const uint16_t * PCWSTR
Definition: typedefs.h:55
BOOL WINAPI SdbpCheckTagIDType(PDB pdb, TAGID tagid, WORD type)
Definition: sdbapi.c:261
BOOL WINAPI SdbpOpenMemMappedFile(LPCWSTR path, PMEMMAPPED mapping)
Definition: sdbapi.c:170
static PDB pdb
Definition: db.cpp:170
enum _SHIM_LOG_LEVEL SHIM_LOG_LEVEL
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
INT PATH_TYPE
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
Definition: ecma_167.h:138
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR Level
Definition: wmitypes.h:55
PBYTE view
Definition: sdbpapi.h:45
#define SHIM_INFO(fmt,...)
Definition: sdbpapi.h:78
void SdbpHeapInit(void)
Definition: sdbapi.c:34
#define write
Definition: acwin.h:73
BOOL WINAPI SdbpCheckTagType(TAG tag, WORD type)
Definition: sdbapi.c:254
_SHIM_LOG_LEVEL
Definition: sdbpapi.h:67
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPIV ShimDbgPrint(SHIM_LOG_LEVEL Level, PCSTR FunctionName, PCSTR Format,...)
Definition: apphelp.c:106
Definition: parser.c:48
ULONG g_ShimDebugLevel
Definition: apphelp.c:35
#define SHIM_ERR(fmt,...)
Definition: sdbpapi.h:76
DWORD SdbpStrsize(PCWSTR string)
Definition: sdbapi.c:157
LPVOID SdbpAlloc(SIZE_T size)
Definition: sdbapi.c:55
HANDLE section
Definition: sdbpapi.h:44
HANDLE file
Definition: sdbpapi.h:43
GLsizeiptr size
Definition: glext.h:5919
#define WINAPI
Definition: msvc.h:8
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLenum GLenum GLenum mapping
Definition: glext.h:9031
PDB WINAPI SdbpCreate(LPCWSTR path, PATH_TYPE type, BOOL write)
Definition: sdbapi.c:93
#define SHIM_WARN(fmt,...)
Definition: sdbpapi.h:77
#define WINAPIV
Definition: sdbpapi.h:64
void WINAPI SdbpFlush(PDB pdb)
Definition: sdbapi.c:140
ULONG_PTR SIZE_T
Definition: typedefs.h:78
void WINAPI SdbpCloseMemMappedFile(PMEMMAPPED mapping)
Definition: sdbapi.c:244
Definition: services.c:325
Definition: fs_rec.h:142
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char * FunctionName
Definition: acpixf.h:1252
LPVOID SdbpReAlloc(LPVOID mem, SIZE_T size, SIZE_T oldSize)
Definition: sdbapi.c:68
Definition: mem.c:156
unsigned int ULONG
Definition: retypes.h:1
const char * PCSTR
Definition: typedefs.h:51
DWORD TAGID
struct tagMEMMAPPED MEMMAPPED
SIZE_T mapped_size
Definition: sdbpapi.h:47
BYTE * PBYTE
Definition: pedump.c:66
SIZE_T size
Definition: sdbpapi.h:46
DWORD SdbpStrlen(PCWSTR string)
Definition: sdbapi.c:152
void SdbpFree(LPVOID mem)
Definition: sdbapi.c:81
Definition: fci.c:126