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.

31 lines
2.0 KiB

  1. // Execute the given call and check that the return code must be S_OK
  2. #define CHECK_SUCCESS( Call ) \
  3. { \
  4. hr = Call; \
  5. if (hr != S_OK) \
  6. Error(1, L"\nError in %S(%d): \n\t- Call %S not succeeded. \n" \
  7. L"\t Error code = 0x%08lx. Error description = %s\n", \
  8. __FILE__, __LINE__, #Call, hr, GetStringFromFailureType(hr)); \
  9. }
  10. #define CHECK_NOFAIL( Call ) \
  11. { \
  12. hr = Call; \
  13. if (FAILED(hr)) \
  14. Error(1, L"\nError in %S(%d): \n\t- Call %S not succeeded. \n" \
  15. L"\t Error code = 0x%08lx. Error description = %s\n", \
  16. __FILE__, __LINE__, #Call, hr, GetStringFromFailureType(hr)); \
  17. }
  18. void Error(INT nReturnCode, const WCHAR* pwszMsgFormat, ...);
  19. LPCWSTR GetStringFromFailureType(HRESULT hrStatus);
  20. LPCWSTR WszFromRestoreTarget(VSS_RESTORE_TARGET rt);
  21. LPCWSTR WszFromFileRestoreStatus(VSS_FILE_RESTORE_STATUS rs);
  22. void PrintPartialFiles(IVssComponent *pComponent);
  23. void PrintDifferencedFiles(IVssComponent* pComponent);
  24. void PrintNewTargets(IVssComponent *pComponent);
  25. void PrintDirectedTargets(IVssComponent *pComponent);
  26. void PrintRestoreSubcomponents(IVssComponent *pComponent);