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.

20 lines
968 B

  1. #ifndef FUSION_MSI_CA_INC_MACROS_H
  2. #define FUSION_MSI_CA_INC_MACROS_H
  3. #define SETFAIL_AND_EXIT do { hr = E_FAIL; goto Exit;} while (0);
  4. #if !defined(NUMBER_OF)
  5. #define NUMBER_OF(x) (sizeof(x)/sizeof(x[0]))
  6. #endif
  7. #define SAFE_RELEASE_COMPOINTER(x) do {if (x != NULL) x->Release();} while(0)
  8. #define IFFALSE_EXIT(x) do {if (!(x)) {hr = HRESULT_FROM_WIN32(::GetLastError()); goto Exit;}} while(0)
  9. #define IFFAILED_EXIT(x) do {if ((hr = (x)) != ERROR_SUCCESS) goto Exit;} while(0)
  10. #define IF_NOTSUCCESS_SET_HRERR_EXIT(x) do {UINT __t ; __t = (x); if (__t != ERROR_SUCCESS) {hr = HRESULT_FROM_WIN32(__t); goto Exit;}} while(0)
  11. #define SET_HRERR_AND_EXIT(err) do { hr = HRESULT_FROM_WIN32(err); goto Exit;} while (0)
  12. #define PARAMETER_CHECK_NTC(x) do { if (!(x)) { hr = E_INVALIDARG; goto Exit;}} while (0)
  13. #define INTERNAL_ERROR_CHECK_NTC(x) do { if (!(x)) { hr = HRESULT_FROM_WIN32(ERROR_INTERNAL_ERROR); goto Exit;}} while (0)
  14. #endif