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.

151 lines
4.0 KiB

  1. /* ----------------------------------------------------------------------
  2. Copyright (c) 1994-1995, Microsoft Corporation
  3. All rights reserved
  4. ftDebug.cpp
  5. ---------------------------------------------------------------------- */
  6. #include "mbftpch.h"
  7. #ifdef DEBUG /* THIS WHOLE FILE */
  8. #define STRING_CASE(val) case val: pcsz = #val; break
  9. HDBGZONE ghZoneMbft = NULL;
  10. static PTSTR _rgszZonesMbft[] = {
  11. TEXT("T.127"),
  12. TEXT("Send"), // 0x0001 _TRACE_SEND
  13. TEXT("Mcs"), // 0x0002 _TRACE_MCS
  14. TEXT("Receive"), // 0x0004 _TRACE_RECEIVE
  15. TEXT("State"), // 0x0008 _TRACE_STATE
  16. TEXT("Init"), // 0x0010 _TRACE_INIT
  17. TEXT("Gcc"), // 0x0020 _TRACE_GCC
  18. TEXT("Pdu"), // 0x0040 _TRACE_PDU
  19. TEXT("Delete"), // 0x0080 _TRACE_DELETE
  20. TEXT("Api"), // 0x0100 _TRACE_API
  21. TEXT("Compress"), // 0x0200 _TRACE_COMPRESS
  22. TEXT("Debug"), // 0x0400 _TRACE_OTHER
  23. };
  24. ///////////////////////////////////////////////////////////////////////////
  25. VOID InitDebug(void)
  26. {
  27. DBGINIT(&ghZoneMbft, _rgszZonesMbft);
  28. InitDebugModule(TEXT("FT"));
  29. }
  30. VOID DeInitDebugMbft(void)
  31. {
  32. ExitDebugModule();
  33. DBGDEINIT(&ghZoneMbft);
  34. }
  35. void DbgMsgMbft(PCHAR pszFormat,...)
  36. {
  37. va_list arglist;
  38. va_start(arglist, pszFormat);
  39. DbgPrintf("mbft", pszFormat, arglist);
  40. va_end(arglist);
  41. }
  42. PCSTR FAR PASCAL GetMbftRcString(DWORD dwRc)
  43. {
  44. PCSTR pcsz;
  45. static char sz[128] = {0};
  46. switch (dwRc)
  47. {
  48. default:
  49. {
  50. wsprintf(sz, "iMBFT err (%d)", dwRc);
  51. return sz;
  52. }
  53. STRING_CASE(iMBFT_OK);
  54. STRING_CASE(iMBFT_FIRST_ERROR);
  55. STRING_CASE(iMBFT_NOT_INITIALIZED);
  56. STRING_CASE(iMBFT_ALREADY_INITIALIZED);
  57. STRING_CASE(iMBFT_INVALID_SESSION_ID);
  58. STRING_CASE(iMBFT_INVALID_ATTACHMENT_HANDLE);
  59. STRING_CASE(iMBFT_NO_MORE_RECIPIENTS);
  60. STRING_CASE(iMBFT_NO_MORE_FILES);
  61. STRING_CASE(iMBFT_INVALID_EVENT_HANDLE);
  62. STRING_CASE(iMBFT_INVALID_FILE_HANDLE);
  63. STRING_CASE(iMBFT_INSUFFICIENT_DISK_SPACE);
  64. STRING_CASE(iMBFT_FILE_NOT_FOUND);
  65. STRING_CASE(iMBFT_FILE_IO_ERROR);
  66. STRING_CASE(iMBFT_MEMORY_ALLOCATION_ERROR);
  67. STRING_CASE(iMBFT_ASN1_ENCODING_ERROR);
  68. STRING_CASE(iMBFT_RECIPIENT_NOT_FOUND);
  69. STRING_CASE(iMBFT_SENDER_ABORTED);
  70. STRING_CASE(iMBFT_RECEIVER_ABORTED);
  71. STRING_CASE(iMBFT_RECEIVER_REJECTED);
  72. STRING_CASE(iMBFT_INVALID_PARAMETERS);
  73. STRING_CASE(iMBFT_COMPRESSION_ERROR);
  74. STRING_CASE(iMBFT_DECOMPRESSION_ERROR);
  75. STRING_CASE(iMBFT_INVALID_PATH);
  76. STRING_CASE(iMBFT_FILE_ACCESS_DENIED);
  77. STRING_CASE(iMBFT_FILE_HARD_IO_ERROR);
  78. STRING_CASE(iMBFT_FILE_SHARING_VIOLATION);
  79. STRING_CASE(iMBFT_DIRECTORY_FULL_ERROR);
  80. STRING_CASE(iMBFT_TOO_MANY_OPEN_FILES);
  81. STRING_CASE(iMBFT_OPERATION_IN_PROGRESS);
  82. STRING_CASE(iMBFT_INSUFFICIENT_PRIVILEGE);
  83. STRING_CASE(iMBFT_CONDUCTOR_ABORTED);
  84. STRING_CASE(iMBFT_PACKET_SIZE_ERROR);
  85. STRING_CASE(iMBFT_UNKNOWN_ERROR);
  86. }
  87. return pcsz;
  88. }
  89. LPCTSTR GetMcsErrorString(MCSError mcsError)
  90. {
  91. LPCTSTR pcsz;
  92. static CHAR sz[MAX_PATH];
  93. switch (mcsError)
  94. {
  95. default:
  96. wsprintf(sz, "MCSError %d", mcsError);
  97. pcsz = sz;
  98. return pcsz;
  99. STRING_CASE(MCS_NO_ERROR);
  100. STRING_CASE(MCS_COMMAND_NOT_SUPPORTED);
  101. STRING_CASE(MCS_NOT_INITIALIZED);
  102. STRING_CASE(MCS_ALREADY_INITIALIZED);
  103. STRING_CASE(MCS_NO_TRANSPORT_STACKS);
  104. STRING_CASE(MCS_DOMAIN_ALREADY_EXISTS);
  105. STRING_CASE(MCS_NO_SUCH_DOMAIN);
  106. STRING_CASE(MCS_USER_NOT_ATTACHED);
  107. STRING_CASE(MCS_NO_SUCH_USER);
  108. STRING_CASE(MCS_TRANSMIT_BUFFER_FULL);
  109. STRING_CASE(MCS_NO_SUCH_CONNECTION);
  110. STRING_CASE(MCS_DOMAIN_NOT_HIERARCHICAL);
  111. STRING_CASE(MCS_INVALID_ADDRESS_PREFIX);
  112. STRING_CASE(MCS_ALLOCATION_FAILURE);
  113. STRING_CASE(MCS_INVALID_PARAMETER);
  114. STRING_CASE(MCS_CALLBACK_NOT_PROCESSED);
  115. STRING_CASE(MCS_DOMAIN_MERGING);
  116. // STRING_CASE(MCS_INVALID_TRANSPORT);
  117. // STRING_CASE(MCS_TRANSPORT_ALREADY_LOADED);
  118. // STRING_CASE(MCS_TRANSPORT_BUSY);
  119. STRING_CASE(MCS_TRANSPORT_NOT_READY);
  120. STRING_CASE(MCS_DOMAIN_PARAMETERS_UNACCEPTABLE);
  121. }
  122. return pcsz;
  123. }
  124. #endif /* DEBUG */