Source code of Windows XP (NT5)
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.

61 lines
1.2 KiB

  1. /**
  2. * Precompiled header for AppAPP
  3. *
  4. * Copyright (c) 2000 Microsoft Corporation
  5. */
  6. #ifndef _PRECOMP_H_
  7. #define _PRECOMP_H_
  8. // Standard headers
  9. #define UNICODE
  10. #include <windows.h>
  11. #include <objbase.h>
  12. #include <httpext.h>
  13. #include <shlwapi.h>
  14. #include <malloc.h>
  15. HRESULT GetLastWin32Error();
  16. void *MemAlloc(size_t size);
  17. void *MemAllocClear(size_t size);
  18. void MemFree(void *pMem);
  19. void MemClearFn(void **ppMem);
  20. void *MemReAlloc(void *pMem, size_t NewSize);
  21. size_t MemGetSize(void *pv);
  22. void *MemDup(void *pMem, int cb);
  23. /*#ifdef ASSERT
  24. #undef ASSERT
  25. #endif
  26. #define ASSERT(x) do { if (!((DWORD)(x)|g_dwFALSE) && DbgpAssert(DbgComponent, #x, __FILE__, __LINE__, NULL)) DbgBreak(); } while (g_dwFALSE)
  27. */
  28. void ClearInterfaceFn(IUnknown ** ppUnk);
  29. void ReplaceInterfaceFn(IUnknown ** ppUnk, IUnknown * pUnk);
  30. template <class PI>
  31. inline void
  32. ClearInterface(PI * ppI)
  33. {
  34. #if DBG
  35. // IUnknown * pUnk = *ppI;
  36. // ASSERT((void *) pUnk == (void *) *ppI);
  37. #endif
  38. ClearInterfaceFn((IUnknown **) ppI);
  39. }
  40. template <class PI>
  41. inline void
  42. ReplaceInterface(PI * ppI, PI pI)
  43. {
  44. #if DBG
  45. // IUnknown * pUnk = *ppI;
  46. // ASSERT((void *) pUnk == (void *) *ppI);
  47. #endif
  48. ReplaceInterfaceFn((IUnknown **) ppI, pI);
  49. }
  50. #endif