home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / lmalert.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  4KB  |  156 lines

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