protected:\r
};\r
\r
+extern HANDLE g_hHeap;\r
+\r
__inline void* __cdecl operator new(size_t size)\r
{\r
- return HeapAlloc(GetProcessHeap(), 0, size);\r
+ return HeapAlloc(g_hHeap, 0, size);\r
}\r
\r
__inline void __cdecl operator delete(void *pObj)\r
{\r
- HeapFree(GetProcessHeap(), 0, pObj);\r
+ HeapFree(h_gHeap, 0, pObj);\r
}\r
\r
HRESULT NDConvertWVStatus(HRESULT hr);\r
#include <stdio.h>\r
#include "nd_provider.h"\r
\r
+HANDLE g_hHeap;\r
\r
extern "C" {\r
\r
{\r
switch (dwReason) {\r
case DLL_PROCESS_ATTACH:\r
+ if (_DllMainCRTStartupForGS(hInstance, dwReason, lpReserved)) {\r
+ return FALSE;\r
+ }\r
+\r
+ g_hHeap = HeapCreate(0, 0, 0);\r
+ return (g_hHeap != NULL);\r
case DLL_PROCESS_DETACH:\r
+ if (g_hHeap != NULL) {\r
+ HeapDestroy(g_hHeap);\r
+ }\r
return _DllMainCRTStartupForGS(hInstance, dwReason, lpReserved);\r
default:\r
- return TRUE;\r
+ return FALSE;\r
}\r
}\r
\r