winapi_ui_automation/um/
lmalert.rs

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