| 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 |
| 7 |
use shared::lmcons::{EVLEN, NET_API_STATUS, SNLEN}; |
| 8 |
use shared::minwindef::{DWORD, LPVOID}; |
| 9 |
use um::winnt::{LPCWSTR, WCHAR}; |
| 10 |
extern "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 |
} |
| 23 |
STRUCT!{struct STD_ALERT { |
| 24 |
alrt_timestamp: DWORD, |
| 25 |
alrt_eventname: [WCHAR; EVLEN + 1], |
| 26 |
alrt_servicename: [WCHAR; SNLEN + 1], |
| 27 |
}} |
| 28 |
pub type PSTD_ALERT = *mut STD_ALERT; |
| 29 |
pub type LPSTD_ALERT = *mut STD_ALERT; |
| 30 |
STRUCT!{struct ADMIN_OTHER_INFO { |
| 31 |
alrtad_errcode: DWORD, |
| 32 |
alrtad_numstrings: DWORD, |
| 33 |
}} |
| 34 |
pub type PADMIN_OTHER_INFO = *mut ADMIN_OTHER_INFO; |
| 35 |
pub type LPADMIN_OTHER_INFO = *mut ADMIN_OTHER_INFO; |
| 36 |
STRUCT!{struct ERRLOG_OTHER_INFO { |
| 37 |
alrter_errcode: DWORD, |
| 38 |
alrter_offset: DWORD, |
| 39 |
}} |
| 40 |
pub type PERRLOG_OTHER_INFO = *mut ERRLOG_OTHER_INFO; |
| 41 |
pub type LPERRLOG_OTHER_INFO = *mut ERRLOG_OTHER_INFO; |
| 42 |
STRUCT!{struct PRINT_OTHER_INFO { |
| 43 |
alrtpr_jobid: DWORD, |
| 44 |
alrtpr_status: DWORD, |
| 45 |
alrtpr_submitted: DWORD, |
| 46 |
alrtpr_size: DWORD, |
| 47 |
}} |
| 48 |
pub type PPRINT_OTHER_INFO = *mut PRINT_OTHER_INFO; |
| 49 |
pub type LPPRINT_OTHER_INFO = *mut PRINT_OTHER_INFO; |
| 50 |
STRUCT!{struct USER_OTHER_INFO { |
| 51 |
alrtus_errcode: DWORD, |
| 52 |
alrtus_numstrings: DWORD, |
| 53 |
}} |
| 54 |
pub type PUSER_OTHER_INFO = *mut USER_OTHER_INFO; |
| 55 |
pub type LPUSER_OTHER_INFO = *mut USER_OTHER_INFO; |
| 56 |
pub const ALERTER_MAILSLOT: &'static str = "\\\\.\\MAILSLOT\\Alerter"; |
| 57 |
pub const ALERT_PRINT_EVENT: &'static str = "PRINTING"; |
| 58 |
pub const ALERT_MESSAGE_EVENT: &'static str = "MESSAGE"; |
| 59 |
pub const ALERT_ERRORLOG_EVENT: &'static str = "ERRORLOG"; |
| 60 |
pub const ALERT_ADMIN_EVENT: &'static str = "ADMIN"; |
| 61 |
pub const ALERT_USER_EVENT: &'static str = "USER"; |
| 62 |
pub const PRJOB_QSTATUS: DWORD = 0x3; |
| 63 |
pub const PRJOB_DEVSTATUS: DWORD = 0x1fc; |
| 64 |
pub const PRJOB_COMPLETE: DWORD = 0x4; |
| 65 |
pub const PRJOB_INTERV: DWORD = 0x8; |
| 66 |
pub const PRJOB_ERROR: DWORD = 0x10; |
| 67 |
pub const PRJOB_DESTOFFLINE: DWORD = 0x20; |
| 68 |
pub const PRJOB_DESTPAUSED: DWORD = 0x40; |
| 69 |
pub const PRJOB_NOTIFY: DWORD = 0x80; |
| 70 |
pub const PRJOB_DESTNOPAPER: DWORD = 0x100; |
| 71 |
pub const PRJOB_DELETED: DWORD = 0x8000; |
| 72 |
pub const PRJOB_QS_QUEUED: DWORD = 0; |
| 73 |
pub const PRJOB_QS_PAUSED: DWORD = 1; |
| 74 |
pub const PRJOB_QS_SPOOLING: DWORD = 2; |
| 75 |
pub const PRJOB_QS_PRINTING: DWORD = 3; |