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.

158 lines
3.7 KiB

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