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