1 /***********************************************************************\
2 *                               lmalert.d                               *
3 *                                                                       *
4 *                       Windows API header module                       *
5 *                                                                       *
6 *                 Translated from MinGW Windows headers                 *
7 *                                                                       *
8 *                       Placed into public domain                       *
9 \***********************************************************************/
10 module win32.lmalert;
11 version(Windows):
12 pragma(lib, "netapi32");
13 
14 private import win32.lmcons, win32.windef;
15 
16 const TCHAR[]
17 	ALERTER_MAILSLOT     = `\\.\MAILSLOT\Alerter`,
18 	ALERT_PRINT_EVENT    = "PRINTING",
19 	ALERT_MESSAGE_EVENT  = "MESSAGE",
20 	ALERT_ERRORLOG_EVENT = "ERRORLOG",
21 	ALERT_ADMIN_EVENT    = "ADMIN",
22 	ALERT_USER_EVENT     = "USER";
23 //MACRO #define ALERT_OTHER_INFO(x) ((PBYTE)(x)+sizeof(STD_ALERT))
24 
25 //MACRO #define ALERT_VAR_DATA(p) ((PBYTE)(p)+sizeof(*p))
26 
27 const PRJOB_QSTATUS     = 3;
28 const PRJOB_DEVSTATUS   = 508;
29 const PRJOB_COMPLETE    = 4;
30 const PRJOB_INTERV      = 8;
31 const PRJOB_            = 16;
32 const PRJOB_DESTOFFLINE = 32;
33 const PRJOB_DESTPAUSED  = 64;
34 const PRJOB_NOTIFY      = 128;
35 const PRJOB_DESTNOPAPER = 256;
36 const PRJOB_DELETED     = 32768;
37 const PRJOB_QS_QUEUED   = 0;
38 const PRJOB_QS_PAUSED   = 1;
39 const PRJOB_QS_SPOOLING = 2;
40 const PRJOB_QS_PRINTING = 3;
41 
42 struct ADMIN_OTHER_INFO{
43 	DWORD alrtad_errcode;
44 	DWORD alrtad_numstrings;
45 }
46 alias ADMIN_OTHER_INFO* PADMIN_OTHER_INFO, LPADMIN_OTHER_INFO;
47 
48 struct STD_ALERT{
49 	DWORD alrt_timestamp;
50 	TCHAR alrt_eventname[EVLEN+1];
51 	TCHAR alrt_servicename[SNLEN+1];
52 }
53 alias STD_ALERT* PSTD_ALERT, LPSTD_ALERT;
54 
55 struct ERRLOG_OTHER_INFO{
56 	DWORD alrter_errcode;
57 	DWORD alrter_offset;
58 }
59 alias ERRLOG_OTHER_INFO* PERRLOG_OTHER_INFO, LPERRLOG_OTHER_INFO;
60 
61 struct PRINT_OTHER_INFO{
62 	DWORD alrtpr_jobid;
63 	DWORD alrtpr_status;
64 	DWORD alrtpr_submitted;
65 	DWORD alrtpr_size;
66 }
67 alias PRINT_OTHER_INFO* PPRINT_OTHER_INFO, LPPRINT_OTHER_INFO;
68 
69 struct USER_OTHER_INFO{
70 	DWORD alrtus_errcode;
71 	DWORD alrtus_numstrings;
72 }
73 alias USER_OTHER_INFO* PUSER_OTHER_INFO, LPUSER_OTHER_INFO;
74 
75 extern (Windows) {
76 NET_API_STATUS NetAlertRaise(LPCWSTR,PVOID,DWORD);
77 NET_API_STATUS NetAlertRaiseEx(LPCWSTR,PVOID,DWORD,LPCWSTR);
78 }