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.

34 lines
832 B

  1. #ifndef __ADS_MACRO__
  2. #define __ADS_MACRO__
  3. #define ALLOC_UNICODE_WITH_BAIL_ON_NULL(x, y) \
  4. x = AllocateUnicodeString(y); \
  5. if (!x && y) { \
  6. hr = E_FAIL; \
  7. goto error; \
  8. }
  9. #define BAIL_ON_NULL(p) \
  10. if (!(p)) { \
  11. goto error; \
  12. }
  13. #define BAIL_ON_FAILURE(hr) \
  14. if (FAILED(hr)) { \
  15. goto error; \
  16. }
  17. #define FREE_INTERFACE(pInterface) \
  18. if (pInterface) { \
  19. pInterface->Release(); \
  20. pInterface=NULL; \
  21. }
  22. #define FREE_BSTR(bstr) \
  23. if (bstr) { \
  24. SysFreeString(bstr); \
  25. bstr = NULL; \
  26. }
  27. #endif