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.

90 lines
1.5 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation, 1997 - 1999
  3. Module Name:
  4. maperror.hxx
  5. Abstract:
  6. This file contains common error mapping routines for the SENS project.
  7. Author:
  8. Gopal Parupudi <GopalP>
  9. [Notes:]
  10. optional-notes
  11. Revision History:
  12. GopalP 3/6/1998 Start.
  13. --*/
  14. #ifndef __MAPERROR_HXX__
  15. #define __MAPERROR_HXX__
  16. DWORD
  17. MapLastError(
  18. DWORD dwInGLE
  19. )
  20. /*++
  21. Routine Description:
  22. This rountine maps the GLEs returned by the SENS Connecitivity engine to
  23. GLEs that describe the failure of the SENS APIs more accurately.
  24. Arguments:
  25. dwInGLE - The GLE that needs to be mapped
  26. Return Value:
  27. The mapped (and better) GLE.
  28. --*/
  29. {
  30. DWORD dwOutGLE;
  31. switch (dwInGLE)
  32. {
  33. //
  34. // When IP stack is not present, we typically get these errors.
  35. //
  36. case ERROR_INVALID_FUNCTION:
  37. case ERROR_NOT_SUPPORTED:
  38. dwOutGLE = ERROR_NO_NETWORK;
  39. break;
  40. //
  41. // Map common RPC failure codes to success
  42. //
  43. case RPC_S_SERVER_UNAVAILABLE:
  44. case RPC_S_SERVER_TOO_BUSY:
  45. case RPC_S_CALL_FALIED:
  46. case RPC_S_CALL_FALIED_DNE:
  47. dwOutGLE = ERROR_SUCCESS;
  48. break;
  49. //
  50. // No mapping by default.
  51. //
  52. default:
  53. dwOutGLE = dwInGLE;
  54. break;
  55. } // switch
  56. return dwOutGLE;
  57. }
  58. #endif // __MAPERROR_HXX__