1 /***********************************************************************\
2 *                               lmstats.d                               *
3 *                                                                       *
4 *                       Windows API header module                       *
5 *                                                                       *
6 *                 Translated from MinGW Windows headers                 *
7 *                                                                       *
8 *                       Placed into public domain                       *
9 \***********************************************************************/
10 module win32.lmstats;
11 version(Windows):
12 pragma(lib, "netapi32");
13 
14 private import win32.lmcons, win32.windef;
15 
16 const ULONG
17 	STATSOPT_CLR   = 1,
18 	STATS_NO_VALUE = -1,
19 	STATS_OVERFLOW = -2;
20 
21 struct STAT_SERVER_0{
22 	DWORD sts0_start;
23 	DWORD sts0_fopens;
24 	DWORD sts0_devopens;
25 	DWORD sts0_jobsqueued;
26 	DWORD sts0_sopens;
27 	DWORD sts0_stimedout;
28 	DWORD sts0_serrorout;
29 	DWORD sts0_pwerrors;
30 	DWORD sts0_permerrors;
31 	DWORD sts0_syserrors;
32 	DWORD sts0_bytessent_low;
33 	DWORD sts0_bytessent_high;
34 	DWORD sts0_bytesrcvd_low;
35 	DWORD sts0_bytesrcvd_high;
36 	DWORD sts0_avresponse;
37 	DWORD sts0_reqbufneed;
38 	DWORD sts0_bigbufneed;
39 }
40 alias STAT_SERVER_0* PSTAT_SERVER_0, LPSTAT_SERVER_0;
41 
42 // #ifdef LM20_WORKSTATION_STATISTICS
43 // typedef struct _STAT_WORKSTATION_0 {
44 // 	DWORD stw0_start;
45 // 	DWORD stw0_numNCB_r;
46 // 	DWORD stw0_numNCB_s;
47 // 	DWORD stw0_numNCB_a;
48 // 	DWORD stw0_fiNCB_r;
49 // 	DWORD stw0_fiNCB_s;
50 // 	DWORD stw0_fiNCB_a;
51 // 	DWORD stw0_fcNCB_r;
52 // 	DWORD stw0_fcNCB_s;
53 // 	DWORD stw0_fcNCB_a;
54 // 	DWORD stw0_sesstart;
55 // 	DWORD stw0_sessfailcon;
56 // 	DWORD stw0_sessbroke;
57 // 	DWORD stw0_uses;
58 // 	DWORD stw0_usefail;
59 // 	DWORD stw0_autorec;
60 // 	DWORD stw0_bytessent_r_lo;
61 // 	DWORD stw0_bytessent_r_hi;
62 // 	DWORD stw0_bytesrcvd_r_lo;
63 // 	DWORD stw0_bytesrcvd_r_hi;
64 // 	DWORD stw0_bytessent_s_lo;
65 // 	DWORD stw0_bytessent_s_hi;
66 // 	DWORD stw0_bytesrcvd_s_lo;
67 // 	DWORD stw0_bytesrcvd_s_hi;
68 // 	DWORD stw0_bytessent_a_lo;
69 // 	DWORD stw0_bytessent_a_hi;
70 // 	DWORD stw0_bytesrcvd_a_lo;
71 // 	DWORD stw0_bytesrcvd_a_hi;
72 // 	DWORD stw0_reqbufneed;
73 // 	DWORD stw0_bigbufneed;
74 // } STAT_WORKSTATION_0,*PSTAT_WORKSTATION_0,*LPSTAT_WORKSTATION_0;
75 // #else
76 
77 struct STAT_WORKSTATION_0{
78 	LARGE_INTEGER StatisticsStartTime;
79 	LARGE_INTEGER BytesReceived;
80 	LARGE_INTEGER SmbsReceived;
81 	LARGE_INTEGER PagingReadBytesRequested;
82 	LARGE_INTEGER NonPagingReadBytesRequested;
83 	LARGE_INTEGER CacheReadBytesRequested;
84 	LARGE_INTEGER NetworkReadBytesRequested;
85 	LARGE_INTEGER BytesTransmitted;
86 	LARGE_INTEGER SmbsTransmitted;
87 	LARGE_INTEGER PagingWriteBytesRequested;
88 	LARGE_INTEGER NonPagingWriteBytesRequested;
89 	LARGE_INTEGER CacheWriteBytesRequested;
90 	LARGE_INTEGER NetworkWriteBytesRequested;
91 	DWORD InitiallyFailedOperations;
92 	DWORD FailedCompletionOperations;
93 	DWORD ReadOperations;
94 	DWORD RandomReadOperations;
95 	DWORD ReadSmbs;
96 	DWORD LargeReadSmbs;
97 	DWORD SmallReadSmbs;
98 	DWORD WriteOperations;
99 	DWORD RandomWriteOperations;
100 	DWORD WriteSmbs;
101 	DWORD LargeWriteSmbs;
102 	DWORD SmallWriteSmbs;
103 	DWORD RawReadsDenied;
104 	DWORD RawWritesDenied;
105 	DWORD NetworkErrors;
106 	DWORD Sessions;
107 	DWORD FailedSessions;
108 	DWORD Reconnects;
109 	DWORD CoreConnects;
110 	DWORD Lanman20Connects;
111 	DWORD Lanman21Connects;
112 	DWORD LanmanNtConnects;
113 	DWORD ServerDisconnects;
114 	DWORD HungSessions;
115 	DWORD UseCount;
116 	DWORD FailedUseCount;
117 	DWORD CurrentCommands;
118 }
119 alias STAT_WORKSTATION_0* PSTAT_WORKSTATION_0, LPSTAT_WORKSTATION_0;
120 
121 extern (Windows):
122 NET_API_STATUS NetStatisticsGet(LPWSTR,LPWSTR,DWORD,DWORD,PBYTE*);