Release 970804
[wine/multimedia.git] / misc / network.c
blob5c1eacec173592e94c84454fc7c9da0e01658c1c
1 /*
2 * Network functions
3 */
5 #include <ctype.h>
6 #include <stdio.h>
8 #include "windows.h"
9 #include "drive.h"
11 #define WN_SUCCESS 0x0000
12 #define WN_NOT_SUPPORTED 0x0001
13 #define WN_NET_ERROR 0x0002
14 #define WN_MORE_DATA 0x0003
15 #define WN_BAD_POINTER 0x0004
16 #define WN_BAD_VALUE 0x0005
17 #define WN_BAD_PASSWORD 0x0006
18 #define WN_ACCESS_DENIED 0x0007
19 #define WN_FUNCTION_BUSY 0x0008
20 #define WN_WINDOWS_ERROR 0x0009
21 #define WN_BAD_USER 0x000A
22 #define WN_OUT_OF_MEMORY 0x000B
23 #define WN_CANCEL 0x000C
24 #define WN_CONTINUE 0x000D
25 #define WN_NOT_CONNECTED 0x0030
26 #define WN_OPEN_FILES 0x0031
27 #define WN_BAD_NETNAME 0x0032
28 #define WN_BAD_LOCALNAME 0x0033
29 #define WN_ALREADY_CONNECTED 0x0034
30 #define WN_DEVICE_ERROR 0x0035
31 #define WN_CONNECTION_CLOSED 0x0036
33 typedef LPSTR LPNETRESOURCE;
35 /**************************************************************************
36 * WNetErrorText [USER.499]
38 int WNetErrorText(WORD nError,LPSTR lpszText,WORD cbText)
40 printf("EMPTY STUB !!! WNetErrorText(%x,%p,%x)\n",
41 nError,lpszText,cbText);
42 return FALSE;
45 /**************************************************************************
46 * WNetOpenJob [USER.501]
48 int WNetOpenJob(LPSTR szQueue,LPSTR szJobTitle,WORD nCopies,LPWORD pfh)
50 printf("EMPTY STUB !!! WNetOpenJob('%s','%s',%x,%p)\n",
51 szQueue,szJobTitle,nCopies,pfh);
52 return WN_NET_ERROR;
55 /**************************************************************************
56 * WNetCloseJob [USER.502]
58 int WNetCloseJob(WORD fh,LPWORD pidJob,LPSTR szQueue)
60 printf("EMPTY STUB !!! WNetCloseJob(%x,%p,'%s')\n",
61 fh,pidJob,szQueue);
62 return WN_NET_ERROR;
65 /**************************************************************************
66 * WNetAbortJob [USER.503]
68 int WNetAbortJob(LPSTR szQueue,WORD wJobId)
70 printf("EMPTY STUB !!! WNetAbortJob('%s',%x)\n",
71 szQueue,wJobId);
72 return WN_NET_ERROR;
75 /**************************************************************************
76 * WNetHoldJob [USER.504]
78 int WNetHoldJob(LPSTR szQueue,WORD wJobId)
80 printf("EMPTY STUB !!! WNetHoldJob('%s',%x)\n",
81 szQueue,wJobId);
82 return WN_NET_ERROR;
85 /**************************************************************************
86 * WNetReleaseJob [USER.505]
88 int WNetReleaseJob(LPSTR szQueue,WORD wJobId)
90 printf("EMPTY STUB !!! WNetReleaseJob('%s',%x)\n",
91 szQueue,wJobId);
92 return WN_NET_ERROR;
95 /**************************************************************************
96 * WNetCancelJob [USER.506]
98 int WNetCancelJob(LPSTR szQueue,WORD wJobId)
100 printf("EMPTY STUB !!! WNetCancelJob('%s',%x)\n",
101 szQueue,wJobId);
102 return WN_NET_ERROR;
105 /**************************************************************************
106 * WNetSetJobCopies [USER.507]
108 int WNetSetJobCopies(LPSTR szQueue,WORD wJobId,WORD nCopies)
110 printf("EMPTY STUB !!! WNetSetJobCopies('%s',%x,%x)\n",
111 szQueue,wJobId,nCopies);
112 return WN_NET_ERROR;
115 /**************************************************************************
116 * WNetWatchQueue [USER.508]
118 int WNetWatchQueue(HWND16 hWnd,LPSTR szLocal,LPSTR szUser,WORD nQueue)
120 printf("EMPTY STUB !!! WNetWatchQueue(%04x,'%s','%s',%x)\n",
121 hWnd,szLocal,szUser,nQueue);
122 return WN_NET_ERROR;
125 /**************************************************************************
126 * WNetUnwatchQueue [USER.509]
128 int WNetUnwatchQueue(LPSTR szQueue)
130 printf("EMPTY STUB !!! WNetUnwatchQueue('%s')\n", szQueue);
131 return WN_NET_ERROR;
134 /**************************************************************************
135 * WNetLockQueueData [USER.510]
137 int WNetLockQueueData(LPSTR szQueue,LPSTR szUser,void *lplpQueueStruct)
139 printf("EMPTY STUB !!! WNetLockQueueData('%s','%s',%p)\n",
140 szQueue,szUser,lplpQueueStruct);
141 return WN_NET_ERROR;
144 /**************************************************************************
145 * WNetUnlockQueueData [USER.511]
147 int WNetUnlockQueueData(LPSTR szQueue)
149 printf("EMPTY STUB !!! WNetUnlockQueueData('%s')\n",szQueue);
150 return WN_NET_ERROR;
153 /**************************************************************************
154 * WNetGetConnection [USER.512]
156 int WNetGetConnection(LPSTR lpLocalName,
157 LPSTR lpRemoteName, UINT16 *cbRemoteName)
159 const char *path;
161 if (lpLocalName[1] == ':')
163 int drive = toupper(lpLocalName[0]) - 'A';
164 switch(GetDriveType16(drive))
166 case DRIVE_CANNOTDETERMINE:
167 case DRIVE_DOESNOTEXIST:
168 return WN_BAD_LOCALNAME;
169 case DRIVE_REMOVABLE:
170 case DRIVE_FIXED:
171 return WN_NOT_CONNECTED;
172 case DRIVE_REMOTE:
173 path = DRIVE_GetDosCwd(drive);
174 if (strlen(path) + 1 > *cbRemoteName) return WN_MORE_DATA;
175 strcpy( lpRemoteName, path );
176 *cbRemoteName = strlen(lpRemoteName) + 1;
177 return WN_SUCCESS;
180 return WN_BAD_LOCALNAME;
183 /**************************************************************************
184 * WNetGetCaps [USER.513]
186 int WNetGetCaps(WORD capability)
188 return 0;
191 /**************************************************************************
192 * WNetDeviceMode [USER.514]
194 int WNetDeviceMode(HWND16 hWndOwner)
196 printf("EMPTY STUB !!! WNetDeviceMode(%04x)\n",hWndOwner);
197 return WN_NET_ERROR;
200 /**************************************************************************
201 * WNetBrowseDialog [USER.515]
203 int WNetBrowseDialog(HWND16 hParent,WORD nType,LPSTR szPath)
205 printf("EMPTY STUB !!! WNetBrowseDialog(%04x,%x,'%s')\n",
206 hParent,nType,szPath);
207 return WN_NET_ERROR;
210 /**************************************************************************
211 * WNetGetUser [USER.516]
213 UINT16 WNetGetUser(LPSTR lpLocalName, LPSTR lpUserName, DWORD *lpSize)
215 printf("EMPTY STUB !!! WNetGetUser(%p, %p, %p);\n",
216 lpLocalName, lpUserName, lpSize);
217 return WN_NET_ERROR;
220 /**************************************************************************
221 * WNetAddConnection [USER.517]
223 UINT16 WNetAddConnection(LPSTR lpNetPath, LPSTR lpPassWord, LPSTR lpLocalName)
225 printf("EMPTY STUB !!! WNetAddConnection('%s', %p, '%s');\n",
226 lpNetPath, lpPassWord, lpLocalName);
227 return WN_NET_ERROR;
231 /**************************************************************************
232 * WNetCancelConnection [USER.518]
234 UINT16 WNetCancelConnection(LPSTR lpName, BOOL16 bForce)
236 printf("EMPTY STUB !!! WNetCancelConnection('%s', %04X);\n",
237 lpName, bForce);
238 return WN_NET_ERROR;
241 /**************************************************************************
242 * WNetGetError [USER.519]
244 int WNetGetError(LPWORD nError)
246 printf("EMPTY STUB !!! WNetGetError(%p)\n",nError);
247 return WN_NET_ERROR;
250 /**************************************************************************
251 * WNetGetErrorText [USER.520]
253 int WNetGetErrorText(WORD nError, LPSTR lpBuffer, LPWORD nBufferSize)
255 printf("EMPTY STUB !!! WNetGetErrorText(%x,%p,%p)\n",
256 nError,lpBuffer,nBufferSize);
257 return WN_NET_ERROR;
260 /**************************************************************************
261 * WNetRestoreConnection [USER.523]
263 int WNetRestoreConnection(HWND16 hwndOwner,LPSTR lpszDevice)
265 printf("EMPTY STUB !!! WNetRestoreConnection(%04x,'%s')\n",
266 hwndOwner,lpszDevice);
267 return WN_NET_ERROR;
270 /**************************************************************************
271 * WNetWriteJob [USER.524]
273 int WNetWriteJob(HANDLE16 hJob,void *lpData,LPWORD lpcbData)
275 printf("EMPTY STUB !!! WNetWriteJob(%04x,%p,%p)\n",
276 hJob,lpData,lpcbData);
277 return WN_NET_ERROR;
280 /**************************************************************************
281 * WnetConnectDialog [USER.525]
283 UINT16 WNetConnectDialog(HWND16 hWndParent, WORD iType)
285 printf("EMPTY STUB !!! WNetConnectDialog(%04x, %4X)\n", hWndParent, iType);
286 return WN_SUCCESS;
289 /**************************************************************************
290 * WNetDisconnectDialog [USER.526]
292 int WNetDisconnectDialog(HWND16 hwndOwner, WORD iType)
294 printf("EMPTY STUB !!! WNetDisconnectDialog(%04x,%x)\n",
295 hwndOwner,iType);
296 return WN_NET_ERROR;
299 /**************************************************************************
300 * WnetConnectionDialog [USER.527]
302 UINT16 WNetConnectionDialog(HWND16 hWndParent, WORD iType)
304 printf("EMPTY STUB !!! WNetConnectionDialog(%04x, %4X)\n",
305 hWndParent, iType);
306 return WN_SUCCESS;
309 /**************************************************************************
310 * WNetViewQueueDialog [USER.528]
312 int WNetViewQueueDialog(HWND16 hwndOwner,LPSTR lpszQueue)
314 printf("EMPTY STUB !!! WNetViewQueueDialog(%04x,'%s')\n",
315 hwndOwner,lpszQueue);
316 return WN_NET_ERROR;
319 /**************************************************************************
320 * WNetPropertyDialog [USER.529]
322 int WNetPropertyDialog(HWND16 hwndParent,WORD iButton,
323 WORD nPropSel,LPSTR lpszName,WORD nType)
325 printf("EMPTY STUB !!! WNetPropertyDialog(%04x,%x,%x,'%s',%x)\n",
326 hwndParent,iButton,nPropSel,lpszName,nType);
327 return WN_NET_ERROR;
330 /**************************************************************************
331 * WNetGetDirectoryType [USER.530]
333 int WNetGetDirectoryType(LPSTR lpName,void *lpType)
335 printf("EMPTY STUB !!! WNetGetDirectoryType('%s',%p)\n",
336 lpName,lpType);
337 return WN_NET_ERROR;
340 /**************************************************************************
341 * WNetDirectoryNotify [USER.531]
343 int WNetDirectoryNotify(HWND16 hwndOwner,void *lpDir,WORD wOper)
345 printf("EMPTY STUB !!! WNetDirectoryNotify(%04x,%p,%x)\n",
346 hwndOwner,lpDir,wOper);
347 return WN_NET_ERROR;
350 /**************************************************************************
351 * WNetGetPropertyText [USER.532]
353 int WNetGetPropertyText(HWND16 hwndParent,WORD iButton,WORD nPropSel,
354 LPSTR lpszName,WORD nType)
356 printf("EMPTY STUB !!! WNetGetPropertyText(%04x,%x,%x,'%s',%x)\n",
357 hwndParent,iButton,nPropSel,lpszName,nType);
358 return WN_NET_ERROR;
361 /**************************************************************************
362 * WNetAddConnection2 [USER.???]
364 UINT16 WNetAddConnection2(LPSTR lpNetPath, LPSTR lpPassWord,
365 LPSTR lpLocalName, LPSTR lpUserName)
367 printf("EMPTY STUB !!! WNetAddConnection2('%s', %p, '%s', '%s');\n",
368 lpNetPath, lpPassWord, lpLocalName, lpUserName);
369 return WN_NET_ERROR;
372 /**************************************************************************
373 * WNetCloseEnum [USER.???]
375 UINT16 WNetCloseEnum(HANDLE16 hEnum)
377 printf("EMPTY STUB !!! WNetCloseEnum(%04x);\n", hEnum);
378 return WN_NET_ERROR;
381 /**************************************************************************
382 * WNetEnumResource [USER.???]
384 UINT16 WNetEnumResource(HANDLE16 hEnum, DWORD cRequ,
385 DWORD *lpCount, LPVOID lpBuf)
387 printf("EMPTY STUB !!! WNetEnumResource(%04x, %08lX, %p, %p);\n",
388 hEnum, cRequ, lpCount, lpBuf);
389 return WN_NET_ERROR;
392 /**************************************************************************
393 * WNetOpenEnum [USER.???]
395 UINT16 WNetOpenEnum(DWORD dwScope, DWORD dwType,
396 LPNETRESOURCE lpNet, HANDLE16 *lphEnum)
398 printf("EMPTY STUB !!! WNetOpenEnum(%08lX, %08lX, %p, %p);\n",
399 dwScope, dwType, lpNet, lphEnum);
400 return WN_NET_ERROR;