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