home *** CD-ROM | disk | FTP | other *** search
/ C Programming Starter Kit 2.0 / SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso / bc45 / msinc.pak / LMALERT.H < prev    next >
C/C++ Source or Header  |  1997-07-23  |  5KB  |  187 lines

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