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.

76 lines
2.1 KiB

  1. /*++
  2. Copyright (c) 1998 Intel Corporation
  3. Module Name:
  4. error.c
  5. Abstract:
  6. Revision History
  7. --*/
  8. #include "lib.h"
  9. struct {
  10. EFI_STATUS Code;
  11. CHAR16 *Desc;
  12. } ErrorCodeTable[] = {
  13. EFI_SUCCESS, L"Success",
  14. EFI_LOAD_ERROR, L"Load Error",
  15. EFI_INVALID_PARAMETER, L"Invalid Parameter",
  16. EFI_UNSUPPORTED, L"Unsupported",
  17. EFI_BAD_BUFFER_SIZE, L"Bad Buffer Size",
  18. EFI_BUFFER_TOO_SMALL, L"Buffer Too Small",
  19. EFI_NOT_READY, L"Not Ready",
  20. EFI_DEVICE_ERROR, L"Device Error",
  21. EFI_WRITE_PROTECTED, L"Write Protected",
  22. EFI_OUT_OF_RESOURCES, L"Out of Resources",
  23. EFI_VOLUME_CORRUPTED, L"Volume Corrupt",
  24. EFI_VOLUME_FULL, L"Volume Full",
  25. EFI_NO_MEDIA, L"No Media",
  26. EFI_MEDIA_CHANGED, L"Media changed",
  27. EFI_NOT_FOUND, L"Not Found",
  28. EFI_ACCESS_DENIED, L"Access Denied",
  29. EFI_NO_RESPONSE, L"No Response",
  30. EFI_NO_MAPPING, L"No mapping",
  31. EFI_TIMEOUT, L"Time out",
  32. EFI_NOT_STARTED, L"Not started",
  33. EFI_ALREADY_STARTED, L"Already started",
  34. EFI_ABORTED, L"Aborted",
  35. EFI_ICMP_ERROR, L"ICMP Error",
  36. EFI_TFTP_ERROR, L"TFTP Error",
  37. EFI_PROTOCOL_ERROR, L"Protocol Error",
  38. /* warnings */
  39. EFI_WARN_UNKOWN_GLYPH, L"Warning Unknown Glyph",
  40. EFI_WARN_DELETE_FAILURE, L"Warning Delete Failure",
  41. EFI_WARN_WRITE_FAILURE, L"Warning Write Failure",
  42. EFI_WARN_BUFFER_TOO_SMALL, L"Warning Buffer Too Small",
  43. 0, NULL
  44. } ;
  45. VOID
  46. StatusToString (
  47. OUT CHAR16 *Buffer,
  48. IN EFI_STATUS Status
  49. )
  50. {
  51. UINTN Index;
  52. for (Index = 0; ErrorCodeTable[Index].Desc; Index +=1) {
  53. if (ErrorCodeTable[Index].Code == Status) {
  54. StrCpy (Buffer, ErrorCodeTable[Index].Desc);
  55. return;
  56. }
  57. }
  58. SPrint (Buffer, 0, L"%X", Status);
  59. }