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.

66 lines
979 B

  1. #include "precomp.h"
  2. DWORD
  3. SPDDestroyClientContextHandle(
  4. DWORD dwStatus,
  5. HANDLE hFilter
  6. )
  7. {
  8. DWORD dwError = 0;
  9. switch (dwStatus) {
  10. case RPC_S_SERVER_UNAVAILABLE:
  11. case RPC_S_CALL_FAILED:
  12. case RPC_S_CALL_FAILED_DNE:
  13. case RPC_S_UNKNOWN_IF:
  14. RpcTryExcept {
  15. RpcSsDestroyClientContext(&hFilter);
  16. } RpcExcept(I_RpcExceptionFilter(RpcExceptionCode())) {
  17. dwError = TranslateExceptionCode(RpcExceptionCode());
  18. BAIL_ON_WIN32_ERROR(dwError);
  19. } RpcEndExcept
  20. break;
  21. default:
  22. dwError = dwStatus;
  23. break;
  24. }
  25. error:
  26. return (dwError);
  27. }
  28. int
  29. RPC_ENTRY
  30. I_RpcExceptionFilter(
  31. unsigned long uExceptionCode
  32. )
  33. {
  34. int i = 0;
  35. for (i = 0; i < FATAL_EXCEPTIONS_ARRAY_SIZE; i ++) {
  36. if (uExceptionCode == guFatalExceptions[i]) {
  37. return EXCEPTION_CONTINUE_SEARCH;
  38. }
  39. }
  40. return EXCEPTION_EXECUTE_HANDLER;
  41. }