Release 950522
[wine.git] / misc / network.c
blobfd10f6500662495b360e70d321095b5e3321fee6
1 /*
2 * Network functions
3 */
5 #include <ctype.h>
6 #include "stdio.h"
7 #include "windows.h"
8 #include "user.h"
10 #include "msdos.h"
11 #include "dos_fs.h"
13 #define WN_SUCCESS 0x0000
14 #define WN_NOT_SUPPORTED 0x0001
15 #define WN_NET_ERROR 0x0002
16 #define WN_MORE_DATA 0x0003
17 #define WN_BAD_POINTER 0x0004
18 #define WN_BAD_VALUE 0x0005
19 #define WN_BAD_PASSWORD 0x0006
20 #define WN_ACCESS_DENIED 0x0007
21 #define WN_FUNCTION_BUSY 0x0008
22 #define WN_WINDOWS_ERROR 0x0009
23 #define WN_BAD_USER 0x000A
24 #define WN_OUT_OF_MEMORY 0x000B
25 #define WN_CANCEL 0x000C
26 #define WN_CONTINUE 0x000D
27 #define WN_NOT_CONNECTED 0x0030
28 #define WN_OPEN_FILES 0x0031
29 #define WN_BAD_NETNAME 0x0032
30 #define WN_BAD_LOCALNAME 0x0033
31 #define WN_ALREADY_CONNECTED 0x0034
32 #define WN_DEVICE_ERROR 0x0035
33 #define WN_CONNECTION_CLOSED 0x0036
35 typedef LPSTR LPNETRESOURCE;
37 /**************************************************************************
38 * WNetErrorText [USER.499]
40 int WNetErrorText(WORD nError,LPSTR lpszText,WORD cbText)
42 printf("EMPTY STUB !!! WNetErrorText(%x,%p,%x)\n",
43 nError,lpszText,cbText);
44 return FALSE;
47 /**************************************************************************
48 * WNetOpenJob [USER.501]
50 int WNetOpenJob(LPSTR szQueue,LPSTR szJobTitle,WORD nCopies,LPWORD pfh)
52 printf("EMPTY STUB !!! WNetOpenJob('%s','%s',%x,%p)\n",
53 szQueue,szJobTitle,nCopies,pfh);
54 return WN_NET_ERROR;
57 /**************************************************************************
58 * WNetCloseJob [USER.502]
60 int WNetCloseJob(WORD fh,LPWORD pidJob,LPSTR szQueue)
62 printf("EMPTY STUB !!! WNetCloseJob(%x,%p,'%s')\n",
63 fh,pidJob,szQueue);
64 return WN_NET_ERROR;
67 /**************************************************************************
68 * WNetAbortJob [USER.503]
70 int WNetAbortJob(LPSTR szQueue,WORD wJobId)
72 printf("EMPTY STUB !!! WNetAbortJob('%s',%x)\n",
73 szQueue,wJobId);
74 return WN_NET_ERROR;
77 /**************************************************************************
78 * WNetHoldJob [USER.504]
80 int WNetHoldJob(LPSTR szQueue,WORD wJobId)
82 printf("EMPTY STUB !!! WNetHoldJob('%s',%x)\n",
83 szQueue,wJobId);
84 return WN_NET_ERROR;
87 /**************************************************************************
88 * WNetReleaseJob [USER.505]
90 int WNetReleaseJob(LPSTR szQueue,WORD wJobId)
92 printf("EMPTY STUB !!! WNetReleaseJob('%s',%x)\n",
93 szQueue,wJobId);
94 return WN_NET_ERROR;
97 /**************************************************************************
98 * WNetCancelJob [USER.506]
100 int WNetCancelJob(LPSTR szQueue,WORD wJobId)
102 printf("EMPTY STUB !!! WNetCancelJob('%s',%x)\n",
103 szQueue,wJobId);
104 return WN_NET_ERROR;
107 /**************************************************************************
108 * WNetSetJobCopies [USER.507]
110 int WNetSetJobCopies(LPSTR szQueue,WORD wJobId,WORD nCopies)
112 printf("EMPTY STUB !!! WNetSetJobCopies('%s',%x,%x)\n",
113 szQueue,wJobId,nCopies);
114 return WN_NET_ERROR;
117 /**************************************************************************
118 * WNetWatchQueue [USER.508]
120 int WNetWatchQueue(HWND hWnd,LPSTR szLocal,LPSTR szUser,WORD nQueue)
122 printf("EMPTY STUB !!! WNetWatchQueue(%x,'%s','%s',%x)\n",
123 hWnd,szLocal,szUser,nQueue);
124 return WN_NET_ERROR;
127 /**************************************************************************
128 * WNetUnwatchQueue [USER.509]
130 int WNetUnwatchQueue(LPSTR szQueue)
132 printf("EMPTY STUB !!! WNetUnwatchQueue('%s')\n", szQueue);
133 return WN_NET_ERROR;
136 /**************************************************************************
137 * WNetLockQueueData [USER.510]
139 int WNetLockQueueData(LPSTR szQueue,LPSTR szUser,void *lplpQueueStruct)
141 printf("EMPTY STUB !!! WNetLockQueueData('%s','%s',%p)\n",
142 szQueue,szUser,lplpQueueStruct);
143 return WN_NET_ERROR;
146 /**************************************************************************
147 * WNetUnlockQueueData [USER.511]
149 int WNetUnlockQueueData(LPSTR szQueue)
151 printf("EMPTY STUB !!! WNetUnlockQueueData('%s')\n",szQueue);
152 return WN_NET_ERROR;
155 /**************************************************************************
156 * WNetGetConnection [USER.512]
158 int WNetGetConnection(LPSTR lpLocalName,
159 LPSTR lpRemoteName, UINT FAR *cbRemoteName)
161 int drive, rc;
163 if(lpLocalName[1] == ':')
165 drive = toupper(lpLocalName[0]) - 'A';
166 if(!DOS_ValidDrive(drive))
167 rc = WN_NOT_CONNECTED;
168 else
170 if(strlen(DOS_GetRedirectedDir(drive)) + 1 > *cbRemoteName)
171 rc = WN_MORE_DATA;
172 else
174 strcpy(lpRemoteName, DOS_GetRedirectedDir(drive));
175 *cbRemoteName = strlen(lpRemoteName) + 1;
176 rc = WN_SUCCESS;
180 else
181 rc = WN_BAD_LOCALNAME;
183 return rc;
186 /**************************************************************************
187 * WNetGetCaps [USER.513]
189 int WNetGetCaps(WORD capability)
191 return 0;
194 /**************************************************************************
195 * WNetDeviceMode [USER.514]
197 int WNetDeviceMode(HWND hWndOwner)
199 printf("EMPTY STUB !!! WNetDeviceMode(%x)\n",hWndOwner);
200 return WN_NET_ERROR;
203 /**************************************************************************
204 * WNetBrowseDialog [USER.515]
206 int WNetBrowseDialog(HWND hParent,WORD nType,LPSTR szPath)
208 printf("EMPTY STUB !!! WNetBrowseDialog(%x,%x,'%s')\n",
209 hParent,nType,szPath);
210 return WN_NET_ERROR;
213 /**************************************************************************
214 * WNetGetUser [USER.516]
216 UINT WNetGetUser(LPSTR lpLocalName, LPSTR lpUserName, DWORD *lpSize)
218 printf("EMPTY STUB !!! WNetGetUser('%s', %p, %p);\n",
219 lpLocalName, lpUserName, lpSize);
220 return WN_NET_ERROR;
223 /**************************************************************************
224 * WNetAddConnection [USER.517]
226 UINT WNetAddConnection(LPSTR lpNetPath, LPSTR lpPassWord, LPSTR lpLocalName)
228 printf("EMPTY STUB !!! WNetAddConnection('%s', %p, '%s');\n",
229 lpNetPath, lpPassWord, lpLocalName);
230 return WN_NET_ERROR;
234 /**************************************************************************
235 * WNetCancelConnection [USER.518]
237 UINT WNetCancelConnection(LPSTR lpName, BOOL bForce)
239 printf("EMPTY STUB !!! WNetCancelConnection('%s', %04X);\n",
240 lpName, bForce);
241 return WN_NET_ERROR;
244 /**************************************************************************
245 * WNetGetError [USER.519]
247 int WNetGetError(LPWORD nError)
249 printf("EMPTY STUB !!! WNetGetError(%p)\n",nError);
250 return WN_NET_ERROR;
253 /**************************************************************************
254 * WNetGetErrorText [USER.520]
256 int WNetGetErrorText(WORD nError, LPSTR lpBuffer, LPWORD nBufferSize)
258 printf("EMPTY STUB !!! WNetGetErrorText(%x,%p,%p)\n",
259 nError,lpBuffer,nBufferSize);
260 return WN_NET_ERROR;
263 /**************************************************************************
264 * WNetRestoreConnection [USER.523]
266 int WNetRestoreConnection(HWND hwndOwner,LPSTR lpszDevice)
268 printf("EMPTY STUB !!! WNetRestoreConnection(%x,'%s')\n",
269 hwndOwner,lpszDevice);
270 return WN_NET_ERROR;
273 /**************************************************************************
274 * WNetWriteJob [USER.524]
276 int WNetWriteJob(WORD hJob,void *lpData,LPWORD lpcbData)
278 printf("EMPTY STUB !!! WNetWriteJob(%x,%p,%p)\n",
279 hJob,lpData,lpcbData);
280 return WN_NET_ERROR;
283 /**************************************************************************
284 * WnetConnectDialog [USER.525]
286 UINT WNetConnectDialog(HWND hWndParent, WORD iType)
288 printf("EMPTY STUB !!! WNetConnectDialog(%4X, %4X)\n", hWndParent, iType);
289 return WN_SUCCESS;
292 /**************************************************************************
293 * WNetDisconnectDialog [USER.526]
295 int WNetDisconnectDialog(HWND hwndOwner, WORD iType)
297 printf("EMPTY STUB !!! WNetDisconnectDialog(%x,%x)\n",
298 hwndOwner,iType);
299 return WN_NET_ERROR;
302 /**************************************************************************
303 * WnetConnectionDialog [USER.527]
305 UINT WNetConnectionDialog(HWND hWndParent, WORD iType)
307 printf("EMPTY STUB !!! WNetConnectionDialog(%4X, %4X)\n",
308 hWndParent, iType);
309 return WN_SUCCESS;
312 /**************************************************************************
313 * WNetViewQueueDialog [USER.528]
315 int WNetViewQueueDialog(HWND hwndOwner,LPSTR lpszQueue)
317 printf("EMPTY STUB !!! WNetViewQueueDialog(%x,'%s')\n",
318 hwndOwner,lpszQueue);
319 return WN_NET_ERROR;
322 /**************************************************************************
323 * WNetPropertyDialog [USER.529]
325 int WNetPropertyDialog(HWND hwndParent,WORD iButton,
326 WORD nPropSel,LPSTR lpszName,WORD nType)
328 printf("EMPTY STUB !!! WNetPropertyDialog(%x,%x,%x,'%s',%x)\n",
329 hwndParent,iButton,nPropSel,lpszName,nType);
330 return WN_NET_ERROR;
333 /**************************************************************************
334 * WNetGetDirectoryType [USER.530]
336 int WNetGetDirectoryType(LPSTR lpName,void *lpType)
338 printf("EMPTY STUB !!! WNetGetDirectoryType('%s',%p)\n",
339 lpName,lpType);
340 return WN_NET_ERROR;
343 /**************************************************************************
344 * WNetDirectoryNotify [USER.531]
346 int WNetDirectoryNotify(HWND hwndOwner,void *lpDir,WORD wOper)
348 printf("EMPTY STUB !!! WNetDirectoryNotify(%x,%p,%x)\n",
349 hwndOwner,lpDir,wOper);
350 return WN_NET_ERROR;
353 /**************************************************************************
354 * WNetGetPropertyText [USER.532]
356 int WNetGetPropertyText(HWND hwndParent,WORD iButton,WORD nPropSel,
357 LPSTR lpszName,WORD nType)
359 printf("EMPTY STUB !!! WNetGetPropertyText(%x,%x,%x,'%s',%x)\n",
360 hwndParent,iButton,nPropSel,lpszName,nType);
361 return WN_NET_ERROR;
364 /**************************************************************************
365 * WNetAddConnection2 [USER.???]
367 UINT WNetAddConnection2(LPSTR lpNetPath, LPSTR lpPassWord,
368 LPSTR lpLocalName, LPSTR lpUserName)
370 printf("EMPTY STUB !!! WNetAddConnection2('%s', %p, '%s', '%s');\n",
371 lpNetPath, lpPassWord, lpLocalName, lpUserName);
372 return WN_NET_ERROR;
375 /**************************************************************************
376 * WNetCloseEnum [USER.???]
378 UINT WNetCloseEnum(HANDLE hEnum)
380 printf("EMPTY STUB !!! WNetCloseEnum(%04X);\n", hEnum);
381 return WN_NET_ERROR;
384 /**************************************************************************
385 * WNetEnumResource [USER.???]
387 UINT WNetEnumResource(HANDLE hEnum, DWORD cRequ,
388 DWORD *lpCount, LPVOID lpBuf)
390 printf("EMPTY STUB !!! WNetEnumResource(%04X, %08lX, %p, %p);\n",
391 hEnum, cRequ, lpCount, lpBuf);
392 return WN_NET_ERROR;
395 /**************************************************************************
396 * WNetOpenEnum [USER.???]
398 UINT WNetOpenEnum(DWORD dwScope, DWORD dwType,
399 LPNETRESOURCE lpNet, HANDLE FAR *lphEnum)
401 printf("EMPTY STUB !!! WNetOpenEnum(%08lX, %08lX, %p, %p);\n",
402 dwScope, dwType, lpNet, lphEnum);
403 return WN_NET_ERROR;