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.

199 lines
4.3 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. al.h
  5. Abstract:
  6. Private header file for the NT Alerter service included by every module
  7. of the Alerter service.
  8. Author:
  9. Rita Wong (ritaw) 01-July-1991
  10. Revision History:
  11. --*/
  12. #ifndef _AL_INCLUDED_
  13. #define _AL_INCLUDED_
  14. #include <nt.h> // NT definitions
  15. #include <ntrtl.h> // NT runtime library definitions
  16. #include <nturtl.h>
  17. #include <windef.h> // Win32 type definitions
  18. #include <winbase.h> // Win32 base API prototypes
  19. #include <lmcons.h> // LAN Manager common definitions
  20. #include <lmerr.h> // LAN Manager network error definitions
  21. #include <lmapibuf.h> // NetApiBufferFree
  22. #include <lmerrlog.h> // NELOG_
  23. #include <lmalert.h> // LAN Manager alert structures
  24. #include <icanon.h> // I_NetXxxCanonicalize routines
  25. #include <netlib.h> // LAN Man utility routines
  26. #include <netlibnt.h> // NetpNtStatusToApiStatus
  27. #include <netdebug.h> // NetpDbgPrint
  28. #include <tstring.h> // Transitional string functions
  29. #define AL_NULL_CHAR '\0'
  30. #define AL_SPACE_CHAR ' '
  31. //
  32. // Debug trace level bits for turning on/off trace statements in the
  33. // Alerter service
  34. //
  35. //
  36. // Utility trace statements
  37. //
  38. #define ALERTER_DEBUG_UTIL 0x00000001
  39. //
  40. // Configuration trace statements
  41. //
  42. #define ALERTER_DEBUG_CONFIG 0x00000002
  43. //
  44. // Main service functionality
  45. //
  46. #define ALERTER_DEBUG_MAIN 0x00000004
  47. //
  48. // Format message trace statements
  49. //
  50. #define ALERTER_DEBUG_FORMAT 0x00000008
  51. //
  52. // All debug flags on
  53. //
  54. #define ALERTER_DEBUG_ALL 0xFFFFFFFF
  55. #if DBG
  56. #define STATIC
  57. extern DWORD AlerterTrace;
  58. #define DEBUG if (TRUE)
  59. #define IF_DEBUG(Function) if (AlerterTrace & ALERTER_DEBUG_ ## Function)
  60. #else
  61. #define STATIC static
  62. #define DEBUG if (FALSE)
  63. #define IF_DEBUG(Function) if (FALSE)
  64. #endif // DBG
  65. //-------------------------------------------------------------------//
  66. // //
  67. // Type definitions //
  68. // //
  69. //-------------------------------------------------------------------//
  70. typedef enum _AL_ERROR_CONDITION {
  71. AlErrorRegisterControlHandler = 0,
  72. AlErrorCreateMailslot,
  73. AlErrorGetComputerName,
  74. AlErrorNotifyServiceController,
  75. AlErrorSendMessage
  76. } AL_ERROR_CONDITION, *PAL_ERROR_CONDITION;
  77. //-------------------------------------------------------------------//
  78. // //
  79. // Function prototypes //
  80. // //
  81. //-------------------------------------------------------------------//
  82. //
  83. // From almain.c
  84. //
  85. VOID
  86. AlHandleError(
  87. IN AL_ERROR_CONDITION FailingCondition,
  88. IN NET_API_STATUS Status,
  89. IN LPTSTR MessageAlias OPTIONAL
  90. );
  91. //
  92. // From alformat.c
  93. //
  94. VOID
  95. AlAdminFormatAndSend(
  96. IN PSTD_ALERT Alert
  97. );
  98. VOID
  99. AlUserFormatAndSend(
  100. IN PSTD_ALERT Alert
  101. );
  102. VOID
  103. AlPrintFormatAndSend(
  104. IN PSTD_ALERT Alert
  105. );
  106. VOID
  107. AlFormatErrorMessage(
  108. IN NET_API_STATUS Status,
  109. IN LPTSTR MessageAlias,
  110. OUT LPTSTR ErrorMessage,
  111. IN DWORD ErrorMessageBufferSize
  112. );
  113. NET_API_STATUS
  114. AlCanonicalizeMessageAlias(
  115. LPTSTR MessageAlias
  116. );
  117. #if DBG
  118. VOID
  119. AlHexDump(
  120. LPBYTE Buffer,
  121. DWORD BufferSize
  122. );
  123. #endif
  124. //
  125. // From alconfig.c
  126. //
  127. NET_API_STATUS
  128. AlGetAlerterConfiguration(
  129. VOID
  130. );
  131. VOID
  132. AlLogEvent(
  133. DWORD MessageId,
  134. DWORD NumberOfSubStrings,
  135. LPWSTR *SubStrings
  136. );
  137. //-------------------------------------------------------------------//
  138. // //
  139. // Global variables //
  140. // //
  141. //-------------------------------------------------------------------//
  142. extern LPSTR AlertNamesA;
  143. extern LPTSTR AlertNamesW;
  144. extern LPSTR AlLocalComputerNameA;
  145. extern LPTSTR AlLocalComputerNameW;
  146. #endif // ifdef _AL_INCLUDED_