source: Daodan/MSYS2/mingw32/i686-w64-mingw32/include/svrapi.h@ 1167

Last change on this file since 1167 was 1166, checked in by rossy, 3 years ago

Daodan: Replace MinGW build env with an up-to-date MSYS2 env

File size: 13.5 KB
Line 
1/**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the mingw-w64 runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6#ifndef SVRAPI_INCLUDED
7#define SVRAPI_INCLUDED
8
9#include <lmcons.h>
10#include <lmerr.h>
11
12#ifndef RC_INVOKED
13#pragma pack(1)
14#endif
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20#ifndef _SVRAPI_
21#define API_FUNCTION DECLSPEC_IMPORT API_RET_TYPE WINAPI
22#else
23#define API_FUNCTION API_RET_TYPE WINAPI
24#endif
25
26 extern API_FUNCTION NetAccessAdd(const char *pszServer,short sLevel,char *pbBuffer,unsigned short cbBuffer);
27 extern API_FUNCTION NetAccessCheck (char *pszReserved,char *pszUserName,char *pszResource,unsigned short usOperation,unsigned short *pusResult);
28 extern API_FUNCTION NetAccessDel(const char *pszServer,char *pszResource);
29 extern API_FUNCTION NetAccessEnum(const char *pszServer,char *pszBasePath,short fsRecursive,short sLevel,char *pbBuffer,unsigned short cbBuffer,unsigned short *pcEntriesRead,unsigned short *pcTotalAvail);
30 extern API_FUNCTION NetAccessGetInfo(const char *pszServer,char *pszResource,short sLevel,char *pbBuffer,unsigned short cbBuffer,unsigned short *pcbTotalAvail);
31 extern API_FUNCTION NetAccessSetInfo(const char *pszServer,char *pszResource,short sLevel,char *pbBuffer,unsigned short cbBuffer,short sParmNum);
32 extern API_FUNCTION NetAccessGetUserPerms (char *pszServer,char *pszUgName,char *pszResource,unsigned short *pusPerms);
33
34 struct access_list {
35 char acl_ugname[LM20_UNLEN+1];
36 char acl_ugname_pad_1;
37 short acl_access;
38 };
39
40 struct access_list_2 {
41 char *acl2_ugname;
42 unsigned short acl2_access;
43 };
44
45 struct access_list_12 {
46 char *acl12_ugname;
47 unsigned short acl12_access;
48 };
49
50 struct access_info_0 {
51 char *acc0_resource_name;
52 };
53
54 struct access_info_1 {
55 char *acc1_resource_name;
56 short acc1_attr;
57 short acc1_count;
58 };
59
60 struct access_info_2 {
61 char *acc2_resource_name;
62 short acc2_attr;
63 short acc2_count;
64 };
65
66 struct access_info_10 {
67 char *acc10_resource_name;
68 };
69
70 struct access_info_12 {
71 char *acc12_resource_name;
72 short acc12_attr;
73 short acc12_count;
74 };
75
76#define MAXPERMENTRIES 64
77
78#define ACCESS_NONE 0
79#define ACCESS_ALL (ACCESS_READ|ACCESS_WRITE|ACCESS_CREATE|ACCESS_EXEC|ACCESS_DELETE|ACCESS_ATRIB|ACCESS_PERM|ACCESS_FINDFIRST)
80
81#define ACCESS_READ 0x1
82#define ACCESS_WRITE 0x2
83#define ACCESS_CREATE 0x4
84#define ACCESS_EXEC 0x8
85#define ACCESS_DELETE 0x10
86#define ACCESS_ATRIB 0x20
87#define ACCESS_PERM 0x40
88#define ACCESS_FINDFIRST 0x80
89#define ACCESS_GROUP 0x8000
90#define ACCESS_AUDIT 0x1
91#define ACCESS_ATTR_PARMNUM 2
92#define ACCESS_LETTERS "RWCXDAP "
93
94 extern API_FUNCTION NetShareAdd(const char *pszServer,short sLevel,const char *pbBuffer,unsigned short cbBuffer);
95 extern API_FUNCTION NetShareDel(const char *pszServer,const char *pszNetName,unsigned short usReserved);
96 extern API_FUNCTION NetShareEnum(const char *pszServer,short sLevel,char *pbBuffer,unsigned short cbBuffer,unsigned short *pcEntriesRead,unsigned short *pcTotalAvail);
97 extern API_FUNCTION NetShareGetInfo(const char *pszServer,const char *pszNetName,short sLevel,char *pbBuffer,unsigned short cbBuffer,unsigned short *pcbTotalAvail);
98 extern API_FUNCTION NetShareSetInfo(const char *pszServer,const char *pszNetName,short sLevel,const char *pbBuffer,unsigned short cbBuffer,short sParmNum);
99
100 struct share_info_0 {
101 char shi0_netname[LM20_NNLEN+1];
102 };
103
104 struct share_info_1 {
105 char shi1_netname[LM20_NNLEN+1];
106 char shi1_pad1;
107 unsigned short shi1_type;
108 char *shi1_remark;
109 };
110
111 struct share_info_2 {
112 char shi2_netname[LM20_NNLEN+1];
113 char shi2_pad1;
114 unsigned short shi2_type;
115 char *shi2_remark;
116 unsigned short shi2_permissions;
117 unsigned short shi2_max_uses;
118 unsigned short shi2_current_uses;
119 char *shi2_path;
120 char shi2_passwd[SHPWLEN+1];
121 char shi2_pad2;
122 };
123
124 struct share_info_50 {
125 char shi50_netname[LM20_NNLEN+1];
126 unsigned char shi50_type;
127 unsigned short shi50_flags;
128 char *shi50_remark;
129 char *shi50_path;
130 char shi50_rw_password[SHPWLEN+1];
131 char shi50_ro_password[SHPWLEN+1];
132 };
133
134#define SHI50F_RDONLY 0x0001
135#define SHI50F_FULL 0x0002
136#define SHI50F_DEPENDSON (SHI50F_RDONLY|SHI50F_FULL)
137#define SHI50F_ACCESSMASK (SHI50F_RDONLY|SHI50F_FULL)
138
139#define SHI50F_PERSIST 0x0100
140
141#define SHI50F_SYSTEM 0x0200
142
143#ifndef PARMNUM_ALL
144#define PARMNUM_ALL 0
145#endif
146
147#define SHI_REMARK_PARMNUM 4
148#define SHI_PERMISSIONS_PARMNUM 5
149#define SHI_MAX_USES_PARMNUM 6
150#define SHI_PASSWD_PARMNUM 9
151
152#define SHI1_NUM_ELEMENTS 4
153#define SHI2_NUM_ELEMENTS 10
154
155#define STYPE_DISKTREE 0
156#define STYPE_PRINTQ 1
157#define STYPE_DEVICE 2
158#define STYPE_IPC 3
159
160#define SHI_USES_UNLIMITED -1
161
162 extern API_FUNCTION NetSessionDel(const char *pszServer,const char *pszClientName,short sReserved);
163 extern API_FUNCTION NetSessionEnum(const char *pszServer,short sLevel,char *pbBuffer,unsigned short cbBuffer,unsigned short *pcEntriesRead,unsigned short *pcTotalAvail);
164 extern API_FUNCTION NetSessionGetInfo(const char *pszServer,const char *pszClientName,short sLevel,char *pbBuffer,unsigned short cbBuffer,unsigned short *pcbTotalAvail);
165
166 struct session_info_0 {
167 char *sesi0_cname;
168 };
169
170 struct session_info_1 {
171 char *sesi1_cname;
172 char *sesi1_username;
173 unsigned short sesi1_num_conns;
174 unsigned short sesi1_num_opens;
175 unsigned short sesi1_num_users;
176 unsigned __LONG32 sesi1_time;
177 unsigned __LONG32 sesi1_idle_time;
178 unsigned __LONG32 sesi1_user_flags;
179 };
180
181 struct session_info_2 {
182 char *sesi2_cname;
183 char *sesi2_username;
184 unsigned short sesi2_num_conns;
185 unsigned short sesi2_num_opens;
186 unsigned short sesi2_num_users;
187 unsigned __LONG32 sesi2_time;
188 unsigned __LONG32 sesi2_idle_time;
189 unsigned __LONG32 sesi2_user_flags;
190 char *sesi2_cltype_name;
191 };
192
193 struct session_info_10 {
194 char *sesi10_cname;
195 char *sesi10_username;
196 unsigned __LONG32 sesi10_time;
197 unsigned __LONG32 sesi10_idle_time;
198 };
199
200 struct session_info_50 {
201 char *sesi50_cname;
202 char *sesi50_username;
203 unsigned __LONG32 sesi50_key;
204 unsigned short sesi50_num_conns;
205 unsigned short sesi50_num_opens;
206 unsigned __LONG32 sesi50_time;
207 unsigned __LONG32 sesi50_idle_time;
208 unsigned char sesi50_protocol;
209 unsigned char pad1;
210 };
211
212#define SESS_GUEST 1
213#define SESS_NOENCRYPTION 2
214
215#define SESI1_NUM_ELEMENTS 8
216#define SESI2_NUM_ELEMENTS 9
217
218 extern API_FUNCTION NetConnectionEnum(const char *pszServer,const char *pszQualifier,short sLevel,char *pbBuffer,unsigned short cbBuffer,unsigned short *pcEntriesRead,unsigned short *pcTotalAvail);
219
220 struct connection_info_0 {
221 unsigned short coni0_id;
222 };
223
224 struct connection_info_1 {
225 unsigned short coni1_id;
226 unsigned short coni1_type;
227 unsigned short coni1_num_opens;
228 unsigned short coni1_num_users;
229 unsigned __LONG32 coni1_time;
230 char *coni1_username;
231 char *coni1_netname;
232 };
233
234 struct connection_info_50 {
235 unsigned short coni50_type;
236 unsigned short coni50_num_opens;
237 unsigned __LONG32 coni50_time;
238 char *coni50_netname;
239 char *coni50_username;
240 };
241
242 extern API_FUNCTION NetFileClose2(const char *pszServer,unsigned __LONG32 ulFileId);
243 extern API_FUNCTION NetFileEnum(const char *pszServer,const char *pszBasePath,short sLevel,char *pbBuffer,unsigned short cbBuffer,unsigned short *pcEntriesRead,unsigned short *pcTotalAvail);
244
245 struct file_info_0 {
246 unsigned short fi0_id;
247 };
248
249 struct file_info_1 {
250 unsigned short fi1_id;
251 unsigned short fi1_permissions;
252 unsigned short fi1_num_locks;
253 char *fi1_pathname;
254 char *fi1_username;
255 };
256
257 struct file_info_2 {
258 unsigned __LONG32 fi2_id;
259 };
260
261 struct file_info_3 {
262 unsigned __LONG32 fi3_id;
263 unsigned short fi3_permissions;
264 unsigned short fi3_num_locks;
265 char *fi3_pathname;
266 char *fi3_username;
267 };
268
269 struct file_info_50 {
270 unsigned __LONG32 fi50_id;
271 unsigned short fi50_permissions;
272 unsigned short fi50_num_locks;
273 char *fi50_pathname;
274 char *fi50_username;
275 char *fi50_sharename;
276 };
277
278 struct res_file_enum_2 {
279 unsigned short res_pad;
280 unsigned short res_fs;
281 unsigned __LONG32 res_pro;
282 };
283
284#define PERM_FILE_READ 0x1
285#define PERM_FILE_WRITE 0x2
286#define PERM_FILE_CREATE 0x4
287
288 typedef struct res_file_enum_2 FRK;
289
290#define FRK_INIT(f) { (f).res_pad = 0; (f).res_fs = 0; (f).res_pro = 0; }
291
292 extern API_FUNCTION NetServerGetInfo(const char *pszServer,short sLevel,char *pbBuffer,unsigned short cbBuffer,unsigned short *pcbTotalAvail);
293
294 struct server_info_0 {
295 char sv0_name[CNLEN + 1];
296 };
297
298 struct server_info_1 {
299 char sv1_name[CNLEN + 1];
300 unsigned char sv1_version_major;
301 unsigned char sv1_version_minor;
302 unsigned __LONG32 sv1_type;
303 char *sv1_comment;
304 };
305
306 struct server_info_50 {
307 char sv50_name[CNLEN + 1];
308 unsigned char sv50_version_major;
309 unsigned char sv50_version_minor;
310 unsigned __LONG32 sv50_type;
311 char *sv50_comment;
312 unsigned short sv50_security;
313 unsigned short sv50_auditing;
314 char *sv50_container;
315 char *sv50_ab_server;
316 char *sv50_ab_dll;
317 };
318
319 struct server_info_2 {
320 char sv2_name[CNLEN + 1];
321 unsigned char sv2_version_major;
322 unsigned char sv2_version_minor;
323 unsigned __LONG32 sv2_type;
324 char *sv2_comment;
325 unsigned __LONG32 sv2_ulist_mtime;
326 unsigned __LONG32 sv2_glist_mtime;
327 unsigned __LONG32 sv2_alist_mtime;
328 unsigned short sv2_users;
329 unsigned short sv2_disc;
330 char *sv2_alerts;
331 unsigned short sv2_security;
332 unsigned short sv2_auditing;
333 unsigned short sv2_numadmin;
334 unsigned short sv2_lanmask;
335 unsigned short sv2_hidden;
336 unsigned short sv2_announce;
337 unsigned short sv2_anndelta;
338 char sv2_guestacct[LM20_UNLEN + 1];
339 unsigned char sv2_pad1;
340 char *sv2_userpath;
341 unsigned short sv2_chdevs;
342 unsigned short sv2_chdevq;
343 unsigned short sv2_chdevjobs;
344 unsigned short sv2_connections;
345 unsigned short sv2_shares;
346 unsigned short sv2_openfiles;
347 unsigned short sv2_sessopens;
348 unsigned short sv2_sessvcs;
349 unsigned short sv2_sessreqs;
350 unsigned short sv2_opensearch;
351 unsigned short sv2_activelocks;
352 unsigned short sv2_numreqbuf;
353 unsigned short sv2_sizreqbuf;
354 unsigned short sv2_numbigbuf;
355 unsigned short sv2_numfiletasks;
356 unsigned short sv2_alertsched;
357 unsigned short sv2_erroralert;
358 unsigned short sv2_logonalert;
359 unsigned short sv2_accessalert;
360 unsigned short sv2_diskalert;
361 unsigned short sv2_netioalert;
362 unsigned short sv2_maxauditsz;
363 char *sv2_srvheuristics;
364 };
365
366 struct server_info_3 {
367 char sv3_name[CNLEN + 1];
368 unsigned char sv3_version_major;
369 unsigned char sv3_version_minor;
370 unsigned __LONG32 sv3_type;
371 char *sv3_comment;
372 unsigned __LONG32 sv3_ulist_mtime;
373 unsigned __LONG32 sv3_glist_mtime;
374 unsigned __LONG32 sv3_alist_mtime;
375 unsigned short sv3_users;
376 unsigned short sv3_disc;
377 char *sv3_alerts;
378 unsigned short sv3_security;
379 unsigned short sv3_auditing;
380 unsigned short sv3_numadmin;
381 unsigned short sv3_lanmask;
382 unsigned short sv3_hidden;
383 unsigned short sv3_announce;
384 unsigned short sv3_anndelta;
385 char sv3_guestacct[LM20_UNLEN + 1];
386 unsigned char sv3_pad1;
387 char *sv3_userpath;
388 unsigned short sv3_chdevs;
389 unsigned short sv3_chdevq;
390 unsigned short sv3_chdevjobs;
391 unsigned short sv3_connections;
392 unsigned short sv3_shares;
393 unsigned short sv3_openfiles;
394 unsigned short sv3_sessopens;
395 unsigned short sv3_sessvcs;
396 unsigned short sv3_sessreqs;
397 unsigned short sv3_opensearch;
398 unsigned short sv3_activelocks;
399 unsigned short sv3_numreqbuf;
400 unsigned short sv3_sizreqbuf;
401 unsigned short sv3_numbigbuf;
402 unsigned short sv3_numfiletasks;
403 unsigned short sv3_alertsched;
404 unsigned short sv3_erroralert;
405 unsigned short sv3_logonalert;
406 unsigned short sv3_accessalert;
407 unsigned short sv3_diskalert;
408 unsigned short sv3_netioalert;
409 unsigned short sv3_maxauditsz;
410 char *sv3_srvheuristics;
411 unsigned __LONG32 sv3_auditedevents;
412 unsigned short sv3_autoprofile;
413 char *sv3_autopath;
414 };
415
416#define MAJOR_VERSION_MASK 0x0F
417
418#define SV_TYPE_WORKSTATION 0x00000001
419#define SV_TYPE_SERVER 0x00000002
420#define SV_TYPE_SQLSERVER 0x00000004
421#define SV_TYPE_DOMAIN_CTRL 0x00000008
422#define SV_TYPE_DOMAIN_BAKCTRL 0x00000010
423#define SV_TYPE_TIME_SOURCE 0x00000020
424#define SV_TYPE_AFP 0x00000040
425#define SV_TYPE_NOVELL 0x00000080
426#define SV_TYPE_DOMAIN_MEMBER 0x00000100
427#define SV_TYPE_PRINTQ_SERVER 0x00000200
428#define SV_TYPE_DIALIN_SERVER 0x00000400
429#define SV_TYPE_ALL 0xFFFFFFFF
430
431#define SV_NODISC 0xFFFF
432
433#define SV_USERSECURITY 1
434#define SV_SHARESECURITY 0
435
436#define SV_SECURITY_SHARE 0
437#define SV_SECURITY_WINNT 1
438#define SV_SECURITY_WINNTAS 2
439#define SV_SECURITY_NETWARE 3
440
441#define SV_HIDDEN 1
442#define SV_VISIBLE 0
443
444#define SVI1_NUM_ELEMENTS 5
445#define SVI2_NUM_ELEMENTS 44
446#define SVI3_NUM_ELEMENTS 45
447
448#define SW_AUTOPROF_LOAD_MASK 0x1
449#define SW_AUTOPROF_SAVE_MASK 0x2
450
451 extern API_FUNCTION NetSecurityGetInfo(const char *pszServer,short sLevel,char *pbBuffer,unsigned short cbBuffer,unsigned short *pcbTotalAvail);
452
453 struct security_info_1 {
454 unsigned __LONG32 sec1_security;
455 char *sec1_container;
456 char *sec1_ab_server;
457 char *sec1_ab_dll;
458 };
459
460#define SEC_SECURITY_SHARE SV_SECURITY_SHARE
461#define SEC_SECURITY_WINNT SV_SECURITY_WINNT
462#define SEC_SECURITY_WINNTAS SV_SECURITY_WINNTAS
463#define SEC_SECURITY_NETWARE SV_SECURITY_NETWARE
464
465#ifdef __cplusplus
466}
467#endif
468
469#ifndef RC_INVOKED
470#pragma pack()
471#endif
472#endif
Note: See TracBrowser for help on using the repository browser.