Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
898 B

  1. #if !defined(WIN16)
  2. extern HANDLE g_hDLLHeap; // private Win32 heap
  3. #define MyAlloc(n) ((LPTSTR)HeapAlloc(g_hDLLHeap, HEAP_ZERO_MEMORY, sizeof(TCHAR)*(n)))
  4. #define MyFree(pv) HeapFree(g_hDLLHeap, 0, pv)
  5. #define MyRealloc(pv, n) ((LPTSTR)HeapReAlloc(g_hDLLHeap, HEAP_ZERO_MEMORY, (pv), sizeof(TCHAR)*(n)))
  6. #define MyHeapSize(pv) HeapSize(g_hDLLHeap, 0, pv)
  7. LPTSTR MyStrDup(LPTSTR);
  8. #ifdef DEBUG
  9. #define MyAssert(f) ((f) ? 0 : MyAssertProc(__FILE__, __LINE__, #f))
  10. #define MyTrace(x) { MyDprintf x; }
  11. #define MyDbgSz(x) { puts x; OutputDebugString x; }
  12. int MyAssertProc(LPTSTR, int, LPTSTR);
  13. void CDECL MyDprintf(LPCSTR pcsz, ...);
  14. #else // DEBUG
  15. # define MyTrace(x)
  16. # define MyDbgSz(x)
  17. # define MyAssert(f)
  18. #endif // DEBUG
  19. #define W32toHR(x) HRESULT_FROM_WIN32(x)
  20. #endif // !WIN16
  21. #define ARRAYSIZE(a) (sizeof(a)/sizeof((a)[0]))