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.

149 lines
4.2 KiB

  1. /*++
  2. Module Name:
  3. psslog.h
  4. Abstract:
  5. Header of the fax service provider PSS log.
  6. note: in every file you wish to log from, after including this file, you should
  7. define a unique FILE_ID. example:
  8. #include "psslog.h"
  9. #define FILE_ID FILE_ID_T30
  10. Author:
  11. Jonathan Barner (t-jonb) Feb, 2001
  12. Revision History:
  13. --*/
  14. #ifndef _PSSLOG_H_
  15. #define _PSSLOG_H_
  16. #define REGVAL_LOGGINGENABLED TEXT("LoggingEnabled")
  17. #define REGVAL_LOGGINGFOLDER_INCOMING TEXT("LoggingFolderIncoming")
  18. #define REGVAL_LOGGINGFOLDER_OUTGOING TEXT("LoggingFolderOutgoing")
  19. #define REGVAL_MAXLOGFILESIZE TEXT("MaxLogFileSize")
  20. #define REGVAL_MAXLOGFILECOUNT TEXT("MaxLogFileCount")
  21. #define REGVAL_LOGFILENUMBERINCOMING TEXT("LogFileNumberIncoming")
  22. #define REGVAL_LOGFILENUMBEROUTGOING TEXT("LogFileNumberOutgoing")
  23. // Default max file size is 100KB
  24. #define DEFAULT_MAXLOGFILESIZE (100*1024)
  25. #define DEFAULT_MAXLOGFILECOUNT_CLIENT (10)
  26. #define DEFAULT_MAXLOGFILECOUNT_SERVER (100)
  27. typedef enum
  28. {
  29. PSSLOG_NONE = 0,
  30. PSSLOG_ALL, // = 1
  31. PSSLOG_FAILED_ONLY // = 2
  32. } LoggingEnabledType;
  33. void OpenPSSLogFile(PThrdGlbl pTG, LPSTR szDeviceName);
  34. void ClosePSSLogFile(PThrdGlbl pTG, BOOL RetCode);
  35. #define PSS_WRN pTG, PSS_WRN_MSG, FILE_ID, __LINE__
  36. #define PSS_ERR pTG, PSS_ERR_MSG, FILE_ID, __LINE__
  37. #define PSS_MSG pTG, PSS_MSG_MSG, FILE_ID, __LINE__
  38. typedef enum {
  39. PSS_MSG_MSG, PSS_WRN_MSG, PSS_ERR_MSG
  40. } PSS_MESSAGE_TYPE;
  41. // example: PSSLogEntry(PSS_MSG, 0, "This is message number %d", 1)
  42. void PSSLogEntry(
  43. PThrdGlbl pTG,
  44. PSS_MESSAGE_TYPE const nMessageType,
  45. DWORD const dwFileID,
  46. DWORD const dwLine,
  47. DWORD dwIndentLevel,
  48. LPCTSTR pcszFormat,
  49. ... );
  50. // example: PSSLogEntryHex(PSS_MSG, 1, myBuffer, dwMyBufferLen, "This is my buffer, %d bytes,", dwMyBufferLen);
  51. // Output: [..] This is my buffer, 2 bytes, 0f a5
  52. void PSSLogEntryHex(
  53. PThrdGlbl pTG,
  54. PSS_MESSAGE_TYPE const nMessageType,
  55. DWORD const dwFileID,
  56. DWORD const dwLine,
  57. DWORD dwIndentLevel,
  58. LPB const lpb,
  59. DWORD const dwSize,
  60. LPCTSTR pcszFormat,
  61. ... );
  62. // example: PSSLogEntryStrings(PSS_MSG, 1, myStringArray, dwStringNum, "These are my %d strings: ", dwStringNum);
  63. // Output: [..] These are my 2 strings: string1, string2
  64. void PSSLogEntryStrings(
  65. PThrdGlbl pTG,
  66. PSS_MESSAGE_TYPE const nMessageType,
  67. DWORD const dwFileID,
  68. DWORD const dwLine,
  69. DWORD dwIndent,
  70. LPCTSTR const *lplpszStrings,
  71. DWORD const dwStringNum,
  72. LPCTSTR pcszFormat,
  73. ... );
  74. // cl2and20
  75. #define FILE_ID_CL2AND20 1
  76. #define FILE_ID_CLASS2 2
  77. #define FILE_ID_CLASS20 3
  78. // class1
  79. #define FILE_ID_CRC 4
  80. #define FILE_ID_DDI 5
  81. #define FILE_ID_DECODER 6
  82. #define FILE_ID_ENCODER 7
  83. #define FILE_ID_FRAMING 8
  84. // comm
  85. #define FILE_ID_FCOM 9
  86. #define FILE_ID_FDEBUG 10
  87. #define FILE_ID_FILTER 11
  88. #define FILE_ID_IDENTIFY 12
  89. #define FILE_ID_MODEM 13
  90. #define FILE_ID_NCUPARMS 14
  91. #define FILE_ID_TIMEOUTS 15
  92. // main
  93. #define FILE_ID_AWNSF 16
  94. #define FILE_ID_DIS 17
  95. #define FILE_ID_ECM 18
  96. #define FILE_ID_ERRSTAT 19
  97. #define FILE_ID_HDLC 20
  98. #define FILE_ID_MEMUTIL 21
  99. #define FILE_ID_NEGOT 22
  100. #define FILE_ID_PROTAPI 23
  101. #define FILE_ID_PSSLOG 24
  102. #define FILE_ID_RECV 25
  103. #define FILE_ID_RECVFR 26
  104. #define FILE_ID_REGISTRY 27
  105. #define FILE_ID_RX_THRD 28
  106. #define FILE_ID_SEND 29
  107. #define FILE_ID_SENDFR 30
  108. #define FILE_ID_T30 31
  109. #define FILE_ID_T30API 32
  110. #define FILE_ID_T30MAIN 33
  111. #define FILE_ID_T30U 34
  112. #define FILE_ID_T30UTIL 35
  113. #define FILE_ID_TX_THRD 36
  114. #define FILE_ID_WHATNEXT 37
  115. #define FILE_ID_PSSFRAME 38
  116. #endif // _PSSLOG_H_