| 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 |
use shared::lmcons::NET_API_STATUS; |
| 7 |
use shared::minwindef::{DWORD, LPBYTE}; |
| 8 |
use um::winnt::{LARGE_INTEGER, LPCWSTR}; |
| 9 |
extern "system" { |
| 10 |
pub fn NetStatisticsGet( |
| 11 |
ServerName: LPCWSTR, |
| 12 |
Service: LPCWSTR, |
| 13 |
Level: DWORD, |
| 14 |
Options: DWORD, |
| 15 |
Buffer: *mut LPBYTE, |
| 16 |
) -> NET_API_STATUS; |
| 17 |
} |
| 18 |
STRUCT!{struct STAT_WORKSTATION_0 { |
| 19 |
StatisticsStartTime: LARGE_INTEGER, |
| 20 |
BytesReceived: LARGE_INTEGER, |
| 21 |
SmbsReceived: LARGE_INTEGER, |
| 22 |
PagingReadBytesRequested: LARGE_INTEGER, |
| 23 |
NonPagingReadBytesRequested: LARGE_INTEGER, |
| 24 |
CacheReadBytesRequested: LARGE_INTEGER, |
| 25 |
NetworkReadBytesRequested: LARGE_INTEGER, |
| 26 |
BytesTransmitted: LARGE_INTEGER, |
| 27 |
SmbsTransmitted: LARGE_INTEGER, |
| 28 |
PagingWriteBytesRequested: LARGE_INTEGER, |
| 29 |
NonPagingWriteBytesRequested: LARGE_INTEGER, |
| 30 |
CacheWriteBytesRequested: LARGE_INTEGER, |
| 31 |
NetworkWriteBytesRequested: LARGE_INTEGER, |
| 32 |
InitiallyFailedOperations: DWORD, |
| 33 |
FailedCompletionOperations: DWORD, |
| 34 |
ReadOperations: DWORD, |
| 35 |
RandomReadOperations: DWORD, |
| 36 |
ReadSmbs: DWORD, |
| 37 |
LargeReadSmbs: DWORD, |
| 38 |
SmallReadSmbs: DWORD, |
| 39 |
WriteOperations: DWORD, |
| 40 |
RandomWriteOperations: DWORD, |
| 41 |
WriteSmbs: DWORD, |
| 42 |
LargeWriteSmbs: DWORD, |
| 43 |
SmallWriteSmbs: DWORD, |
| 44 |
RawReadsDenied: DWORD, |
| 45 |
RawWritesDenied: DWORD, |
| 46 |
NetworkErrors: DWORD, |
| 47 |
Sessions: DWORD, |
| 48 |
FailedSessions: DWORD, |
| 49 |
Reconnects: DWORD, |
| 50 |
CoreConnects: DWORD, |
| 51 |
Lanman20Connects: DWORD, |
| 52 |
Lanman21Connects: DWORD, |
| 53 |
LanmanNtConnects: DWORD, |
| 54 |
ServerDisconnects: DWORD, |
| 55 |
HungSessions: DWORD, |
| 56 |
UseCount: DWORD, |
| 57 |
FailedUseCount: DWORD, |
| 58 |
CurrentCommands: DWORD, |
| 59 |
}} |
| 60 |
pub type PSTAT_WORKSTATION_0 = *mut STAT_WORKSTATION_0; |
| 61 |
pub type LPSTAT_WORKSTATION_0 = *mut STAT_WORKSTATION_0; |
| 62 |
STRUCT!{struct STAT_SERVER_0 { |
| 63 |
sts0_start: DWORD, |
| 64 |
sts0_fopens: DWORD, |
| 65 |
sts0_devopens: DWORD, |
| 66 |
sts0_jobsqueued: DWORD, |
| 67 |
sts0_sopens: DWORD, |
| 68 |
sts0_stimedout: DWORD, |
| 69 |
sts0_serrorout: DWORD, |
| 70 |
sts0_pwerrors: DWORD, |
| 71 |
sts0_permerrors: DWORD, |
| 72 |
sts0_syserrors: DWORD, |
| 73 |
sts0_bytessent_low: DWORD, |
| 74 |
sts0_bytessent_high: DWORD, |
| 75 |
sts0_bytesrcvd_low: DWORD, |
| 76 |
sts0_bytesrcvd_high: DWORD, |
| 77 |
sts0_avresponse: DWORD, |
| 78 |
sts0_reqbufneed: DWORD, |
| 79 |
sts0_bigbufneed: DWORD, |
| 80 |
}} |
| 81 |
pub type PSTAT_SERVER_0 = *mut STAT_SERVER_0; |
| 82 |
pub type LPSTAT_SERVER_0 = *mut STAT_SERVER_0; |
| 83 |
pub const STATSOPT_CLR: DWORD = 1; |
| 84 |
pub const STATS_NO_VALUE: DWORD = -1i32 as u32; |
| 85 |
pub const STATS_OVERFLOW: DWORD = -2i32 as u32; |