1 // Copyright © 2015-2017 winapi-rs developers
2 // Licensed under the Apache License, Version 2.0
3 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
4 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
5 // All files in the project carrying such notice may not be copied, modified, or distributed
6 // except according to those terms.
7 //! This file contains structures for communication with the Alerter service
8 use shared::lmcons::{EVLEN, NET_API_STATUS, SNLEN};
9 use shared::minwindef::{DWORD, LPVOID};
10 use um::winnt::{LPCWSTR, WCHAR};
11 extern "system" {
NetAlertRaise( AlertType: LPCWSTR, Buffer: LPVOID, BufferSize: DWORD, ) -> NET_API_STATUS12     pub fn NetAlertRaise(
13         AlertType: LPCWSTR,
14         Buffer: LPVOID,
15         BufferSize: DWORD,
16     ) -> NET_API_STATUS;
NetAlertRaiseEx( AlertType: LPCWSTR, VariableInfo: LPVOID, VariableInfoSize: DWORD, ServiceName: LPCWSTR, ) -> NET_API_STATUS17     pub fn NetAlertRaiseEx(
18         AlertType: LPCWSTR,
19         VariableInfo: LPVOID,
20         VariableInfoSize: DWORD,
21         ServiceName: LPCWSTR,
22     ) -> NET_API_STATUS;
23 }
24 STRUCT!{struct STD_ALERT {
25     alrt_timestamp: DWORD,
26     alrt_eventname: [WCHAR; EVLEN + 1],
27     alrt_servicename: [WCHAR; SNLEN + 1],
28 }}
29 pub type PSTD_ALERT = *mut STD_ALERT;
30 pub type LPSTD_ALERT = *mut STD_ALERT;
31 STRUCT!{struct ADMIN_OTHER_INFO {
32     alrtad_errcode: DWORD,
33     alrtad_numstrings: DWORD,
34 }}
35 pub type PADMIN_OTHER_INFO = *mut ADMIN_OTHER_INFO;
36 pub type LPADMIN_OTHER_INFO = *mut ADMIN_OTHER_INFO;
37 STRUCT!{struct ERRLOG_OTHER_INFO {
38     alrter_errcode: DWORD,
39     alrter_offset: DWORD,
40 }}
41 pub type PERRLOG_OTHER_INFO = *mut ERRLOG_OTHER_INFO;
42 pub type LPERRLOG_OTHER_INFO = *mut ERRLOG_OTHER_INFO;
43 STRUCT!{struct PRINT_OTHER_INFO {
44     alrtpr_jobid: DWORD,
45     alrtpr_status: DWORD,
46     alrtpr_submitted: DWORD,
47     alrtpr_size: DWORD,
48 }}
49 pub type PPRINT_OTHER_INFO = *mut PRINT_OTHER_INFO;
50 pub type LPPRINT_OTHER_INFO = *mut PRINT_OTHER_INFO;
51 STRUCT!{struct USER_OTHER_INFO {
52     alrtus_errcode: DWORD,
53     alrtus_numstrings: DWORD,
54 }}
55 pub type PUSER_OTHER_INFO = *mut USER_OTHER_INFO;
56 pub type LPUSER_OTHER_INFO = *mut USER_OTHER_INFO;
57 pub const ALERTER_MAILSLOT: &'static str = "\\\\.\\MAILSLOT\\Alerter";
58 pub const ALERT_PRINT_EVENT: &'static str = "PRINTING";
59 pub const ALERT_MESSAGE_EVENT: &'static str = "MESSAGE";
60 pub const ALERT_ERRORLOG_EVENT: &'static str = "ERRORLOG";
61 pub const ALERT_ADMIN_EVENT: &'static str = "ADMIN";
62 pub const ALERT_USER_EVENT: &'static str = "USER";
63 pub const PRJOB_QSTATUS: DWORD = 0x3;
64 pub const PRJOB_DEVSTATUS: DWORD = 0x1fc;
65 pub const PRJOB_COMPLETE: DWORD = 0x4;
66 pub const PRJOB_INTERV: DWORD = 0x8;
67 pub const PRJOB_ERROR: DWORD = 0x10;
68 pub const PRJOB_DESTOFFLINE: DWORD = 0x20;
69 pub const PRJOB_DESTPAUSED: DWORD = 0x40;
70 pub const PRJOB_NOTIFY: DWORD = 0x80;
71 pub const PRJOB_DESTNOPAPER: DWORD = 0x100;
72 pub const PRJOB_DELETED: DWORD = 0x8000;
73 pub const PRJOB_QS_QUEUED: DWORD = 0;
74 pub const PRJOB_QS_PAUSED: DWORD = 1;
75 pub const PRJOB_QS_SPOOLING: DWORD = 2;
76 pub const PRJOB_QS_PRINTING: DWORD = 3;
77