home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / lmalert.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  3.8 KB  |  161 lines

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