|
|
1.1 root 1: /*++
2:
3: Copyright (c) 1991 Microsoft Corporation
4:
5: Module Name:
6:
7: winnetwk.h
8:
9: Abstract:
10:
11: Standard WINNET Header File for NT-WIN32
12:
13: Author:
14:
15: Dan Lafferty (danl) 08-Oct-1991
16:
17: Environment:
18:
19: User Mode -Win32
20:
21: Notes:
22:
23: optional-notes
24:
25: Revision History:
26:
27: 08-Oct-1991 danl
28: created from winnet 3.10.05 version.
29:
30: 10-Dec-1991 Johnl
31: Updated to conform to Win32 Net API Spec. vers 0.4
32:
33: 01-Apr-1992 JohnL
34: Changed CONNECTION_REMEMBERED flag to CONNECT_UPDATE_PROFILE
35: Updated WNetCancelConnection2 to match spec.
36:
37: 23-Apr-1992 Johnl
38: Added error code mappings. Changed byte counts to character counts.
39:
40: 27-May-1992 ChuckC
41: Made into .x file.
42:
43: --*/
44:
45: #ifndef _WINNETWK_
46: #define _WINNETWK_
47:
48: //
49: // RESOURCE ENUMERATION
50: //
51:
52: #define RESOURCE_CONNECTED 0x00000001
53: #define RESOURCE_GLOBALNET 0x00000002
54: #define RESOURCE_REMEMBERED 0x00000003
55:
56: #define RESOURCETYPE_ANY 0x00000000
57: #define RESOURCETYPE_DISK 0x00000001
58: #define RESOURCETYPE_PRINT 0x00000002
59:
60: #define RESOURCEUSAGE_CONNECTABLE 0x00000001
61: #define RESOURCEUSAGE_CONTAINER 0x00000002
62: #define RESOURCEUSAGE_RESERVED 0x80000000
63:
1.1.1.2 ! root 64: #define RESOURCEDISPLAYTYPE_GENERIC 0x00000000
! 65: #define RESOURCEDISPLAYTYPE_DOMAIN 0x00000001
! 66: #define RESOURCEDISPLAYTYPE_SERVER 0x00000002
! 67: #define RESOURCEDISPLAYTYPE_SHARE 0x00000003
! 68:
1.1 root 69: typedef struct _NETRESOURCEA {
70: DWORD dwScope;
71: DWORD dwType;
1.1.1.2 ! root 72: DWORD dwDisplayType;
1.1 root 73: DWORD dwUsage;
74: LPSTR lpLocalName;
75: LPSTR lpRemoteName;
76: LPSTR lpComment ;
77: LPSTR lpProvider;
78: }NETRESOURCEA, *LPNETRESOURCEA;
79: typedef struct _NETRESOURCEW {
80: DWORD dwScope;
81: DWORD dwType;
1.1.1.2 ! root 82: DWORD dwDisplayType;
1.1 root 83: DWORD dwUsage;
84: LPWSTR lpLocalName;
85: LPWSTR lpRemoteName;
86: LPWSTR lpComment ;
87: LPWSTR lpProvider;
88: }NETRESOURCEW, *LPNETRESOURCEW;
89: #ifdef UNICODE
90: #define NETRESOURCE NETRESOURCEW
91: #define LPNETRESOURCE LPNETRESOURCEW
92: #else
93: #define NETRESOURCE NETRESOURCEA
94: #define LPNETRESOURCE LPNETRESOURCEA
95: #endif // UNICODE
96:
97:
98: //
99: // CONNECTIONS
100: //
101:
102: #define CONNECT_UPDATE_PROFILE 0x00000001
103:
104: DWORD APIENTRY
105: WNetAddConnectionA (
106: LPSTR lpRemoteName,
107: LPSTR lpPassword,
108: LPSTR lpLocalName
109: );
110: DWORD APIENTRY
111: WNetAddConnectionW (
112: LPWSTR lpRemoteName,
113: LPWSTR lpPassword,
114: LPWSTR lpLocalName
115: );
116: #ifdef UNICODE
117: #define WNetAddConnection WNetAddConnectionW
118: #else
119: #define WNetAddConnection WNetAddConnectionA
120: #endif // !UNICODE
121:
122:
123: DWORD APIENTRY
124: WNetAddConnection2A (
125: LPNETRESOURCEA lpNetResource,
126: LPSTR lpPassword,
127: LPSTR lpUserName,
128: DWORD dwFlags
129: );
130: DWORD APIENTRY
131: WNetAddConnection2W (
132: LPNETRESOURCEW lpNetResource,
133: LPWSTR lpPassword,
134: LPWSTR lpUserName,
135: DWORD dwFlags
136: );
137: #ifdef UNICODE
138: #define WNetAddConnection2 WNetAddConnection2W
139: #else
140: #define WNetAddConnection2 WNetAddConnection2A
141: #endif // !UNICODE
142:
143: DWORD APIENTRY
144: WNetCancelConnectionA (
145: LPSTR lpName,
146: BOOL fForce
147: );
148: DWORD APIENTRY
149: WNetCancelConnectionW (
150: LPWSTR lpName,
151: BOOL fForce
152: );
153: #ifdef UNICODE
154: #define WNetCancelConnection WNetCancelConnectionW
155: #else
156: #define WNetCancelConnection WNetCancelConnectionA
157: #endif // !UNICODE
158:
159: DWORD APIENTRY
160: WNetCancelConnection2A (
161: LPSTR lpName,
162: DWORD dwFlags,
163: BOOL fForce
164: );
165: DWORD APIENTRY
166: WNetCancelConnection2W (
167: LPWSTR lpName,
168: DWORD dwFlags,
169: BOOL fForce
170: );
171: #ifdef UNICODE
172: #define WNetCancelConnection2 WNetCancelConnection2W
173: #else
174: #define WNetCancelConnection2 WNetCancelConnection2A
175: #endif // !UNICODE
176:
177:
178: DWORD APIENTRY
179: WNetGetConnectionA (
180: LPSTR lpLocalName,
181: LPSTR lpRemoteName,
182: LPDWORD lpnLength
183: );
184: DWORD APIENTRY
185: WNetGetConnectionW (
186: LPWSTR lpLocalName,
187: LPWSTR lpRemoteName,
188: LPDWORD lpnLength
189: );
190: #ifdef UNICODE
191: #define WNetGetConnection WNetGetConnectionW
192: #else
193: #define WNetGetConnection WNetGetConnectionA
194: #endif // !UNICODE
195:
196:
197: DWORD APIENTRY
198: WNetOpenEnumA (
199: DWORD dwScope,
200: DWORD dwType,
201: DWORD dwUsage,
202: LPNETRESOURCEA lpNetResource,
203: LPHANDLE lphEnum
204: );
205: DWORD APIENTRY
206: WNetOpenEnumW (
207: DWORD dwScope,
208: DWORD dwType,
209: DWORD dwUsage,
210: LPNETRESOURCEW lpNetResource,
211: LPHANDLE lphEnum
212: );
213: #ifdef UNICODE
214: #define WNetOpenEnum WNetOpenEnumW
215: #else
216: #define WNetOpenEnum WNetOpenEnumA
217: #endif // !UNICODE
218:
219: DWORD APIENTRY
220: WNetEnumResourceA (
221: HANDLE hEnum,
222: LPDWORD lpcCount,
223: LPVOID lpBuffer,
224: LPDWORD lpBufferSize
225: );
226: DWORD APIENTRY
227: WNetEnumResourceW (
228: HANDLE hEnum,
229: LPDWORD lpcCount,
230: LPVOID lpBuffer,
231: LPDWORD lpBufferSize
232: );
233: #ifdef UNICODE
234: #define WNetEnumResource WNetEnumResourceW
235: #else
236: #define WNetEnumResource WNetEnumResourceA
237: #endif // !UNICODE
238:
239: DWORD APIENTRY
240: WNetCloseEnum (
241: HANDLE hEnum
242: );
243:
244: //
245: // OTHER
246: //
247:
248: DWORD APIENTRY
249: WNetGetUserA (
250: LPSTR lpName,
251: LPSTR lpUserName,
252: LPDWORD lpnLength
253: );
254: DWORD APIENTRY
255: WNetGetUserW (
256: LPWSTR lpName,
257: LPWSTR lpUserName,
258: LPDWORD lpnLength
259: );
260: #ifdef UNICODE
261: #define WNetGetUser WNetGetUserW
262: #else
263: #define WNetGetUser WNetGetUserA
264: #endif // !UNICODE
265:
266: //
267: // BROWSE DIALOG
268: //
269:
270: DWORD APIENTRY WNetConnectionDialog(
271: HWND hwnd,
272: DWORD dwType
273: );
274:
275: //
276: // ERRORS
277: //
278:
279: DWORD APIENTRY
280: WNetGetLastErrorA (
281: LPDWORD lpError,
282: LPSTR lpErrorBuf,
283: DWORD nErrorBufSize,
284: LPSTR lpNameBuf,
285: DWORD nNameBufSize
286: );
287: DWORD APIENTRY
288: WNetGetLastErrorW (
289: LPDWORD lpError,
290: LPWSTR lpErrorBuf,
291: DWORD nErrorBufSize,
292: LPWSTR lpNameBuf,
293: DWORD nNameBufSize
294: );
295: #ifdef UNICODE
296: #define WNetGetLastError WNetGetLastErrorW
297: #else
298: #define WNetGetLastError WNetGetLastErrorA
299: #endif // !UNICODE
300:
301: //
302: // STATUS CODES
303: //
304: // This section is provided for backward compatibility. Use of the ERROR_*
305: // codes is preferred. The WN_* error codes may not be available in future
306: // releases.
307: //
308:
309: // General
310:
311: #define WN_SUCCESS NO_ERROR
312: #define WN_NOT_SUPPORTED ERROR_NOT_SUPPORTED
313: #define WN_NET_ERROR ERROR_UNEXP_NET_ERR
314: #define WN_MORE_DATA ERROR_MORE_DATA
315: #define WN_BAD_POINTER ERROR_INVALID_ADDRESS
316: #define WN_BAD_VALUE ERROR_INVALID_PARAMETER
317: #define WN_BAD_PASSWORD ERROR_INVALID_PASSWORD
318: #define WN_ACCESS_DENIED ERROR_ACCESS_DENIED
319: #define WN_FUNCTION_BUSY ERROR_BUSY
320: #define WN_WINDOWS_ERROR ERROR_UNEXP_NET_ERR
321: #define WN_BAD_USER ERROR_BAD_USERNAME
322: #define WN_OUT_OF_MEMORY ERROR_NOT_ENOUGH_MEMORY
323: #define WN_NO_NETWORK ERROR_NO_NETWORK
324: #define WN_EXTENDED_ERROR ERROR_EXTENDED_ERROR
325:
326: // Connection
327:
328: #define WN_NOT_CONNECTED ERROR_NOT_CONNECTED
329: #define WN_OPEN_FILES ERROR_OPEN_FILES
330: #define WN_DEVICE_IN_USE ERROR_DEVICE_IN_USE
331: #define WN_BAD_NETNAME ERROR_BAD_NET_NAME
332: #define WN_BAD_LOCALNAME ERROR_BAD_DEVICE
333: #define WN_ALREADY_CONNECTED ERROR_ALREADY_ASSIGNED
334: #define WN_DEVICE_ERROR ERROR_GEN_FAILURE
335: #define WN_CONNECTION_CLOSED ERROR_CONNECTION_UNAVAIL
336: #define WN_NO_NET_OR_BAD_PATH ERROR_NO_NET_OR_BAD_PATH
337: #define WN_BAD_PROVIDER ERROR_BAD_PROVIDER
338: #define WN_CANNOT_OPEN_PROFILE ERROR_CANNOT_OPEN_PROFILE
339: #define WN_BAD_PROFILE ERROR_BAD_PROFILE
340:
341: // Enumeration
342:
343: #define WN_BAD_HANDLE ERROR_INVALID_HANDLE
344: #define WN_NO_MORE_ENTRIES ERROR_NO_MORE_ITEMS
345: #define WN_NOT_CONTAINER ERROR_NOT_CONTAINER
346:
347: #define WN_NO_ERROR NO_ERROR
348:
349: #endif // _WINNETWK_
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.