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.

155 lines
3.5 KiB

  1. /*++ BUILD Version: 0003 // Increment this if a change has global effects
  2. Copyright (c) 1991-1995 Microsoft Corporation
  3. Module Name:
  4. alert.h
  5. Abstract:
  6. This file contains structures for communication with the Alerter
  7. service.
  8. Environment:
  9. User Mode - Win32
  10. Notes:
  11. You must include LmCons.H before this file, since this file depends
  12. on values defined in LmCons.H.
  13. ALERT.H includes ALERTMSG.H which defines the alert message numbers
  14. --*/
  15. #ifndef _ALERT_
  16. #define _ALERT_
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. //
  21. // Function Prototypes
  22. //
  23. NET_API_STATUS NET_API_FUNCTION
  24. NetAlertRaise(
  25. IN LPTSTR AlertEventName,
  26. IN LPVOID Buffer,
  27. IN DWORD BufferSize
  28. );
  29. NET_API_STATUS NET_API_FUNCTION
  30. NetAlertRaiseEx(
  31. IN LPTSTR AlertEventName,
  32. IN LPVOID VariableInfo,
  33. IN DWORD VariableInfoSize,
  34. IN LPTSTR ServiceName
  35. );
  36. //
  37. // Data Structures
  38. //
  39. typedef struct _STD_ALERT {
  40. DWORD alrt_timestamp;
  41. TCHAR alrt_eventname[EVLEN + 1];
  42. TCHAR alrt_servicename[SNLEN + 1];
  43. }STD_ALERT, *PSTD_ALERT, *LPSTD_ALERT;
  44. typedef struct _ADMIN_OTHER_INFO {
  45. DWORD alrtad_errcode;
  46. DWORD alrtad_numstrings;
  47. }ADMIN_OTHER_INFO, *PADMIN_OTHER_INFO, *LPADMIN_OTHER_INFO;
  48. typedef struct _ERRLOG_OTHER_INFO {
  49. DWORD alrter_errcode;
  50. DWORD alrter_offset;
  51. }ERRLOG_OTHER_INFO, *PERRLOG_OTHER_INFO, *LPERRLOG_OTHER_INFO;
  52. typedef struct _PRINT_OTHER_INFO {
  53. DWORD alrtpr_jobid;
  54. DWORD alrtpr_status;
  55. DWORD alrtpr_submitted;
  56. DWORD alrtpr_size;
  57. }PRINT_OTHER_INFO, *PPRINT_OTHER_INFO, *LPPRINT_OTHER_INFO;
  58. typedef struct _USER_OTHER_INFO {
  59. DWORD alrtus_errcode;
  60. DWORD alrtus_numstrings;
  61. }USER_OTHER_INFO, *PUSER_OTHER_INFO, *LPUSER_OTHER_INFO;
  62. //
  63. // Special Values and Constants
  64. //
  65. //
  66. // Name of mailslot to send alert notifications
  67. //
  68. #define ALERTER_MAILSLOT TEXT("\\\\.\\MAILSLOT\\Alerter")
  69. //
  70. // The following macro gives a pointer to the other_info data.
  71. // It takes an alert structure and returns a pointer to structure
  72. // beyond the standard portion.
  73. //
  74. #define ALERT_OTHER_INFO(x) ((LPBYTE)(x) + sizeof(STD_ALERT))
  75. //
  76. // The following macro gives a pointer to the variable-length data.
  77. // It takes a pointer to one of the other-info structs and returns a
  78. // pointer to the variable data portion.
  79. //
  80. #define ALERT_VAR_DATA(p) ((LPBYTE)(p) + sizeof(*p))
  81. //
  82. // Names of standard Microsoft-defined alert events.
  83. //
  84. #define ALERT_PRINT_EVENT TEXT("PRINTING")
  85. #define ALERT_MESSAGE_EVENT TEXT("MESSAGE")
  86. #define ALERT_ERRORLOG_EVENT TEXT("ERRORLOG")
  87. #define ALERT_ADMIN_EVENT TEXT("ADMIN")
  88. #define ALERT_USER_EVENT TEXT("USER")
  89. //
  90. // Bitmap masks for prjob_status field of PRINTJOB.
  91. //
  92. // 2-7 bits also used in device status
  93. #define PRJOB_QSTATUS 0x3 // Bits 0,1
  94. #define PRJOB_DEVSTATUS 0x1fc // 2-8 bits
  95. #define PRJOB_COMPLETE 0x4 // Bit 2
  96. #define PRJOB_INTERV 0x8 // Bit 3
  97. #define PRJOB_ERROR 0x10 // Bit 4
  98. #define PRJOB_DESTOFFLINE 0x20 // Bit 5
  99. #define PRJOB_DESTPAUSED 0x40 // Bit 6
  100. #define PRJOB_NOTIFY 0x80 // BIT 7
  101. #define PRJOB_DESTNOPAPER 0x100 // BIT 8
  102. #define PRJOB_DELETED 0x8000 // BIT 15
  103. //
  104. // Values of PRJOB_QSTATUS bits in prjob_status field of PRINTJOB.
  105. //
  106. #define PRJOB_QS_QUEUED 0
  107. #define PRJOB_QS_PAUSED 1
  108. #define PRJOB_QS_SPOOLING 2
  109. #define PRJOB_QS_PRINTING 3
  110. #ifdef __cplusplus
  111. }
  112. #endif
  113. #endif // _ALERT_