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.

69 lines
2.4 KiB

  1. //=--------------------------------------------------------------------------=
  2. // InProcServer.H
  3. //=--------------------------------------------------------------------------=
  4. // Copyright 1995 Microsoft Corporation. All Rights Reserved.
  5. //
  6. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  7. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  8. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  9. // PARTICULAR PURPOSE.
  10. //=--------------------------------------------------------------------------=
  11. //
  12. // global header file that contains all the windows stuff, etc ... should
  13. // be pre-compiled to speed things up a little bit.
  14. //
  15. #ifndef _INPROCSERVER_H_
  16. #define INC_OLE2
  17. #include <windows.h>
  18. #include <stddef.h> // for offsetof()
  19. #include <olectl.h>
  20. // things that -everybody- wants [read: is going to get]
  21. //
  22. #include "Debug.H"
  23. //=--------------------------------------------------------------------------=
  24. // we don't want to use the CRTs, and would like some memory tracking in the
  25. // debug case, so we'll override these guys
  26. //=--------------------------------------------------------------------------=
  27. //
  28. void * _cdecl operator new(size_t size);
  29. void _cdecl operator delete(void *ptr);
  30. //=--------------------------------------------------------------------------=
  31. // Useful macros
  32. //=--------------------------------------------------------------------------=
  33. //
  34. // handy error macros, randing from cleaning up, to returning to clearing
  35. // rich error information as well.
  36. //
  37. #define RETURN_ON_FAILURE(hr) if (FAILED(hr)) return hr
  38. #define RETURN_ON_NULLALLOC(ptr) if (!(ptr)) return E_OUTOFMEMORY
  39. #define CLEANUP_ON_FAILURE(hr) if (FAILED(hr)) goto CleanUp
  40. #define CLEARERRORINFORET(hr) { SetErrorInfo(0, NULL); return hr; }
  41. #define CLEARERRORINFORET_ON_FAILURE(hr) if (FAILED(hr)) { SetErrorInfo(0, NULL); return hr; }
  42. #define CLEANUP_ON_ERROR(l) if (l != ERROR_SUCCESS) goto CleanUp
  43. // conversions
  44. //
  45. #define BOOL_TO_VARIANTBOOL(f) (f) ? VARIANT_TRUE : VARIANT_FALSE
  46. // for optimizing QI's
  47. //
  48. #define DO_GUIDS_MATCH(riid1, riid2) ((riid1.Data1 == riid2.Data1) && (riid1 == riid2))
  49. // Reference counting help.
  50. //
  51. #define RELEASE_OBJECT(ptr) if (ptr) { IUnknown *pUnk = (ptr); (ptr) = NULL; pUnk->Release(); }
  52. #define ADDREF_OBJECT(ptr) if (ptr) (ptr)->AddRef()
  53. #define _INPROCSERVER_H_
  54. #endif // _INPROCSERVER_H_