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.

180 lines
4.5 KiB

  1. /*++ BUILD Version: 0003 // Increment this if a change has global effects
  2. Copyright (c) 1991-1993 Microsoft Corporation
  3. Module Name:
  4. alert.h
  5. Abstract:
  6. This file contains structures for communication with the Alerter
  7. service.
  8. Author:
  9. Dan Lafferty (danl) 12-Mar-1991
  10. Environment:
  11. User Mode - Win32
  12. Notes:
  13. You must include LmCons.H before this file, since this file depends
  14. on values defined in LmCons.H.
  15. ALERT.H includes ALERTMSG.H which defines the alert message numbers
  16. Revision History:
  17. 12-Mar-1991 danl
  18. Created from LM2.0 header files and NT-LAN API Spec.
  19. 14-Mar-1991 JohnRo
  20. Temporarily commented-out include of "alertmsg.h".
  21. 22-July-1991 ritaw
  22. Removed NetAlert API prototypes.
  23. STD_ALERT structure holds offsets to strings rather than string
  24. pointers.
  25. Renamed file from lmalert.h back to alert.h and put in the net inc
  26. directory since this file is private to LAN Man components.
  27. 24-July-1990 ritaw
  28. Due to LAN Man 2.0 assumptions, the event and service names of the
  29. STD_ALERT structure must be embedded strings. All LAN Man 2.0 code
  30. which write to alert structures can be ported without additional
  31. changes.
  32. 04-Apr-1992 JohnRo
  33. Added NetAlertRaise and NetAlertRaiseEx APIs.
  34. Changed ALERT_xxx_EVENT equates to be TCHAR strings.
  35. Fixed definition of LPSTD_ALERT (used by NetAlertRaise API).
  36. --*/
  37. #ifndef _ALERT_
  38. #define _ALERT_
  39. #ifdef __cplusplus
  40. extern "C" {
  41. #endif
  42. //
  43. // Function Prototypes
  44. //
  45. NET_API_STATUS NET_API_FUNCTION
  46. NetAlertRaise(
  47. IN LPTSTR AlertEventName,
  48. IN LPVOID Buffer,
  49. IN DWORD BufferSize
  50. );
  51. NET_API_STATUS NET_API_FUNCTION
  52. NetAlertRaiseEx(
  53. IN LPTSTR AlertEventName,
  54. IN LPVOID VariableInfo,
  55. IN DWORD VariableInfoSize,
  56. IN LPTSTR ServiceName
  57. );
  58. //
  59. // Data Structures
  60. //
  61. typedef struct _STD_ALERT {
  62. DWORD alrt_timestamp;
  63. TCHAR alrt_eventname[EVLEN + 1];
  64. TCHAR alrt_servicename[SNLEN + 1];
  65. }STD_ALERT, *PSTD_ALERT, *LPSTD_ALERT;
  66. typedef struct _ADMIN_OTHER_INFO {
  67. DWORD alrtad_errcode;
  68. DWORD alrtad_numstrings;
  69. }ADMIN_OTHER_INFO, *PADMIN_OTHER_INFO, *LPADMIN_OTHER_INFO;
  70. typedef struct _ERRLOG_OTHER_INFO {
  71. DWORD alrter_errcode;
  72. DWORD alrter_offset;
  73. }ERRLOG_OTHER_INFO, *PERRLOG_OTHER_INFO, *LPERRLOG_OTHER_INFO;
  74. typedef struct _PRINT_OTHER_INFO {
  75. DWORD alrtpr_jobid;
  76. DWORD alrtpr_status;
  77. DWORD alrtpr_submitted;
  78. DWORD alrtpr_size;
  79. }PRINT_OTHER_INFO, *PPRINT_OTHER_INFO, *LPPRINT_OTHER_INFO;
  80. typedef struct _USER_OTHER_INFO {
  81. DWORD alrtus_errcode;
  82. DWORD alrtus_numstrings;
  83. }USER_OTHER_INFO, *PUSER_OTHER_INFO, *LPUSER_OTHER_INFO;
  84. //
  85. // Special Values and Constants
  86. //
  87. //
  88. // Name of mailslot to send alert notifications
  89. //
  90. #define ALERTER_MAILSLOT TEXT("\\\\.\\MAILSLOT\\Alerter")
  91. //
  92. // The following macro gives a pointer to the other_info data.
  93. // It takes an alert structure and returns a pointer to structure
  94. // beyond the standard portion.
  95. //
  96. #define ALERT_OTHER_INFO(x) ((LPBYTE)(x) + sizeof(STD_ALERT))
  97. //
  98. // The following macro gives a pointer to the variable-length data.
  99. // It takes a pointer to one of the other-info structs and returns a
  100. // pointer to the variable data portion.
  101. //
  102. #define ALERT_VAR_DATA(p) ((LPBYTE)(p) + sizeof(*p))
  103. //
  104. // Names of standard Microsoft-defined alert events.
  105. //
  106. #define ALERT_PRINT_EVENT TEXT("PRINTING")
  107. #define ALERT_MESSAGE_EVENT TEXT("MESSAGE")
  108. #define ALERT_ERRORLOG_EVENT TEXT("ERRORLOG")
  109. #define ALERT_ADMIN_EVENT TEXT("ADMIN")
  110. #define ALERT_USER_EVENT TEXT("USER")
  111. //
  112. // Bitmap masks for prjob_status field of PRINTJOB.
  113. //
  114. // 2-7 bits also used in device status
  115. #define PRJOB_QSTATUS 0x3 // Bits 0,1
  116. #define PRJOB_DEVSTATUS 0x1fc // 2-8 bits
  117. #define PRJOB_COMPLETE 0x4 // Bit 2
  118. #define PRJOB_INTERV 0x8 // Bit 3
  119. #define PRJOB_ERROR 0x10 // Bit 4
  120. #define PRJOB_DESTOFFLINE 0x20 // Bit 5
  121. #define PRJOB_DESTPAUSED 0x40 // Bit 6
  122. #define PRJOB_NOTIFY 0x80 // BIT 7
  123. #define PRJOB_DESTNOPAPER 0x100 // BIT 8
  124. #define PRJOB_DELETED 0x8000 // BIT 15
  125. //
  126. // Values of PRJOB_QSTATUS bits in prjob_status field of PRINTJOB.
  127. //
  128. #define PRJOB_QS_QUEUED 0
  129. #define PRJOB_QS_PAUSED 1
  130. #define PRJOB_QS_SPOOLING 2
  131. #define PRJOB_QS_PRINTING 3
  132. #ifdef __cplusplus
  133. }
  134. #endif
  135. #endif // _ALERT_