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.

23 lines
885 B

  1. #include "pstdef.h"
  2. // count the number of bytes needed to fully store the WSZ
  3. #define WSZ_BYTECOUNT(__z__) \
  4. ( (__z__ == NULL) ? 0 : (wcslen(__z__)+1)*sizeof(WCHAR) )
  5. // count the number of elements in the static array
  6. #define ARRAY_COUNT(__z__) \
  7. ( (__z__ == NULL) ? 0 : (sizeof( __z__ ) / sizeof( __z__[0] )) )
  8. // if in range of PST_E errors, pass through unmodified
  9. // otherwise, convert HRESULT to a Win32 error
  10. #define PSTERR_TO_HRESULT(__z__) \
  11. ( ((__z__ >= MIN_PST_ERROR) && (__z__ <= MAX_PST_ERROR)) ? __z__ : HRESULT_FROM_WIN32(__z__) )
  12. #define HRESULT_TO_PSTERR(__z__) \
  13. ( ((__z__ >= MIN_PST_ERROR) && (__z__ <= MAX_PST_ERROR)) ? __z__ : HRESULT_CODE(__z__) )
  14. // map exceptions to win32 errors (used internally)
  15. #define PSTMAP_EXCEPTION_TO_ERROR(__x__) \
  16. ((__x__ == 0xC0000005) ? 998 : PST_E_UNKNOWN_EXCEPTION)