admin
base
com
developer
drivers
ds
enduser
inetcore
inetsrv
iis
intlwb
chs
chs2
cht
cht2
enu
kor
kor2
thai
thai2
sth
cbreaktree.hpp
cmn_createfilew.c
cmn_debug.h
cmn_outputsystemerr.c
common.h
cthaibreaktree.cpp
cthaibreaktree.hpp
cthaisenttrieiter.cpp
cthaisenttrieiter.hpp
cthaitrieiter.cpp
cthaitrieiter.hpp
cthaitrigrambreak.cpp
cthaitrigrambreak.h
cthaitrigramtrieiter.cpp
cthaitrigramtrieiter.hpp
cthwb.cpp
cthwb.hpp
ctrie.cpp
ctrie.hpp
dbgmemp.h
debug.c
lexheader.h
lexicon.h
lextable.cpp
lextable.hpp
makefile
mapio.c
memcore.c
misc.h
nlglib.h
precomp.h
proofbase.h
sources
thwbdef.hpp
thwbint.cpp
thwbint.h
thwbplat.h
trie.c
trie.h
vendor.h
wb_asserts.c
wb_asserts.h
wb
dirs
dirs
msmq
published
query
dirs
project.mk
loc
mergedcomponents
multimedia
net
printscan
public
published
sdktools
shell
termsrv
tools
windows
dirs
makefil0
74 lines
2.1 KiB
C
74 lines
2.1 KiB
C
/****************************** Module Header ******************************\
|
|
* Module Name: common.h
|
|
*
|
|
* Copyright (c) 1985-91, Microsoft Corporation
|
|
*
|
|
* History:
|
|
\***************************************************************************/
|
|
|
|
#ifndef _COMMON_
|
|
#define _COMMON_
|
|
|
|
extern HANDLE ghHeap;
|
|
|
|
#ifdef _DEBUG_PRINT
|
|
#define _DBGERROR 0x00000001
|
|
#define _DBGWARNING 0x00000002
|
|
#define _DBGVERBOSE 0x00000004
|
|
#define _DBGALL 0xFFFFFFFF
|
|
extern ULONG gThDebugFlag;
|
|
|
|
#define DBGERROR(_params_) {if (gThDebugFlag & _DBGERROR)DbgPrint _params_ ; }
|
|
#define DBGWARNING(_params_) {if (gThDebugFlag & _DBGWARNING)DbgPrint _params_ ; }
|
|
#define DBGVERBOSE(_params_) {if (gThDebugFlag & _DBGVERBOSE)DbgPrint _params_ ; }
|
|
#define DBGPRINT(_params_) DbgPrint _params_
|
|
#else
|
|
#define DBGERROR(_params_)
|
|
#define DBGWARNING(_params_)
|
|
#define DBGVERBOSE(_params_)
|
|
#define DBGPRINT(_params_)
|
|
#endif
|
|
|
|
// misc defines
|
|
//
|
|
#define SUCCESS(s) ((s) == ERROR_SUCCESS)
|
|
#define NO_SUCCESS(s) ((s) != ERROR_SUCCESS)
|
|
|
|
#define ThAlloc( cbSize ) HeapAlloc( ghHeap, HEAP_ZERO_MEMORY, (cbSize));
|
|
#define ThFree( pv ) HeapFree( ghHeap, 0, (pv));
|
|
#define ThReAlloc( pv, cbSize) HeapReAlloc( ghHeap, 0, (pv), (cbSize));
|
|
|
|
#ifdef _DEBUG
|
|
#define MAX_PROCINFO 16
|
|
|
|
typedef struct _tagBLOCKINFO {
|
|
struct _tagBLOCKINFO *pbiNext;
|
|
BYTE *pb; // Start of block
|
|
ULONG ulSize; // Length of block
|
|
BOOL fReferenced; // Ever referenced
|
|
PROCESS_INFORMATION ProcInfo[MAX_PROCINFO];
|
|
} BLOCKINFO, *PBLOCKINFO;
|
|
|
|
BOOL fCreateBlockInfo(BYTE *pbNew, ULONG cbSizeNew);
|
|
VOID FreeBlockInfo(BYTE *pbToFree);
|
|
VOID UpdateBlockInfo(BYTE *pbOld, BYTE *pbNew, ULONG cbSizeNew);
|
|
ULONG sizeofBlock(BYTE *pb);
|
|
|
|
VOID ClearMemoryRefs(VOID);
|
|
VOID NoteMemoryRef(VOID *pv);
|
|
VOID CheckMemoryRefs(VOID);
|
|
BOOL fValidPointer(VOID *pv, ULONG cbSize);
|
|
|
|
#define bThNewGarbage 0xA3
|
|
#define bThOldGarbage 0xA4
|
|
#define bThFreeGarbage 0xA5
|
|
#define bThDebugByte 0xE1
|
|
|
|
#define sizeofDebugByte 1
|
|
|
|
#else
|
|
#define sizeofDebugByte 0
|
|
#endif
|
|
|
|
#endif // _COMMON_
|