00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _NTWRAPPER_H
00019 #define _NTWRAPPER_H
00020
00021 namespace std {
00022 struct nothrow_t;
00023 };
00024
00025 #include "config.h"
00026
00027 #define _CRTDBG_ALLOC_MEM_DF 0x01
00028
00029 #define _HEAPOK (-2)
00030 #define _HEAPEND (-5)
00031
00032 typedef void(*_CRT_ALLOC_HOOK)(void);
00033 typedef void(*_CRT_DUMP_CLIENT)(void);
00034 typedef int _HEAPINFO;
00035 typedef int _CrtMemState;
00036
00037 extern "C" {
00038
00039 #ifdef _DEBUG
00040
00041 void * lh__calloc_dbg(size_t num, size_t size, int blockType, const char *filename, int linenumber);
00042 int lh__CrtCheckMemory(void);
00043 void lh__CrtDoForAllClientObjects(void (*pfn)(void *, void *), void *context);
00044 int lh__CrtDumpMemoryLeaks(void);
00045 int lh__CrtIsMemoryBlock(const void *userData, unsigned int size, long *requestNumber, char **filename, int *linenumber);
00046 int lh__CrtIsValidHeapPointer(const void *userData);
00047 void lh__CrtMemCheckpoint(_CrtMemState *state);
00048 int lh__CrtMemDifference(_CrtMemState *stateDiff, const _CrtMemState *oldState, const _CrtMemState *newState);
00049 void lh__CrtMemDumpAllObjectsSince(const _CrtMemState *state);
00050 void lh__CrtMemDumpStatistics(const _CrtMemState *state);
00051 _CRT_ALLOC_HOOK
00052 lh__CrtSetAllocHook(_CRT_ALLOC_HOOK allocHook);
00053 long lh__CrtSetBreakAlloc(long lBreakAlloc);
00054 int lh__CrtSetDbgFlag(int newFlag);
00055 _CRT_DUMP_CLIENT
00056 lh__CrtSetDumpClient(_CRT_DUMP_CLIENT dumpClient);
00057 void * lh__expand_dbg(void *userData, size_t newSize, int blockType, const char *filename, int linenumber);
00058 void lh__free_dbg(void *userData, int blockType);
00059 void * lh__malloc_dbg(size_t size, int blockType, const char *filename, int linenumber);
00060 size_t lh__msize_dbg(void *memblock, int blockType);
00061 void * lh__realloc_dbg(void *userData, size_t newSize, int blockType, const char *filename, int linenumber);
00062 void * lh_nh_malloc_dbg(size_t sz, size_t, int, int, const char *, int);
00063
00064 #endif // ? _DEBUG
00065
00066 void * lh__expand(void *memblock, size_t size);
00067 int lh__heapchk(void);
00068 int lh__heapmin(void);
00069 int lh__heapset(unsigned int fill);
00070 int lh__heapwalk(_HEAPINFO *entryinfo);
00071 size_t lh__msize(void *memblock);
00072 void * lh_calloc(size_t nelem, size_t elsize);
00073 void lh_free (void * ptr);
00074 void * lh_malloc (size_t sz);
00075 void * lh_realloc(void * ptr, size_t sz);
00076
00077 void * lh_new_nothrow(unsigned int,struct std::nothrow_t const &);
00078 void * lh_debug_operator_new (unsigned int cb, int, const char *, int);
00079 void lh_debug_operator_delete (void * p, int, const char *, int);
00080
00081
00082 }
00083
00084 #endif // _NTWRAPPER_H