2 * USER Windows Network functions
12 #include "wine/winnet16.h"
15 #include "debugtools.h"
18 DEFAULT_DEBUG_CHANNEL(wnet);
24 /**************************************************************************
25 * WNetOpenJob16 [USER.501]
27 WORD WINAPI WNetOpenJob16( LPSTR szQueue, LPSTR szJobTitle, WORD nCopies, LPINT16 pfh )
29 FIXME( "(%s, %s, %d, %p): stub\n",
30 debugstr_a(szQueue), debugstr_a(szJobTitle), nCopies, pfh );
31 return WN16_NET_ERROR;
34 /**************************************************************************
35 * WNetCloseJob16 [USER.502]
37 WORD WINAPI WNetCloseJob16( WORD fh, LPINT16 pidJob, LPSTR szQueue )
39 FIXME( "(%d, %p, %s): stub\n", fh, pidJob, debugstr_a(szQueue) );
40 return WN16_NET_ERROR;
43 /**************************************************************************
44 * WNetWriteJob16 [USER.524]
46 WORD WINAPI WNetWriteJob16( HANDLE16 hJob, LPSTR lpData, LPINT16 lpcbData )
48 FIXME( "(%04x, %p, %p): stub\n", hJob, lpData, lpcbData );
49 return WN16_NET_ERROR;
52 /**************************************************************************
53 * WNetAbortJob16 [USER.503]
55 WORD WINAPI WNetAbortJob16( LPSTR szQueue, WORD wJobId )
57 FIXME( "(%s, %d): stub\n", debugstr_a(szQueue), wJobId );
58 return WN16_NET_ERROR;
61 /**************************************************************************
62 * WNetHoldJob16 [USER.504]
64 WORD WINAPI WNetHoldJob16( LPSTR szQueue, WORD wJobId )
66 FIXME( "(%s, %d): stub\n", debugstr_a(szQueue), wJobId );
67 return WN16_NET_ERROR;
70 /**************************************************************************
71 * WNetReleaseJob16 [USER.505]
73 WORD WINAPI WNetReleaseJob16( LPSTR szQueue, WORD wJobId )
75 FIXME( "(%s, %d): stub\n", debugstr_a(szQueue), wJobId );
76 return WN16_NET_ERROR;
79 /**************************************************************************
80 * WNetCancelJob16 [USER.506]
82 WORD WINAPI WNetCancelJob16( LPSTR szQueue, WORD wJobId )
84 FIXME( "(%s, %d): stub\n", debugstr_a(szQueue), wJobId );
85 return WN16_NET_ERROR;
88 /**************************************************************************
89 * WNetSetJobCopies16 [USER.507]
91 WORD WINAPI WNetSetJobCopies16( LPSTR szQueue, WORD wJobId, WORD nCopies )
93 FIXME( "(%s, %d, %d): stub\n", debugstr_a(szQueue), wJobId, nCopies );
94 return WN16_NET_ERROR;
97 /**************************************************************************
98 * WNetWatchQueue16 [USER.508]
100 WORD WINAPI WNetWatchQueue16( HWND16 hWnd, LPSTR szLocal, LPSTR szUser, WORD nQueue )
102 FIXME( "(%04x, %s, %s, %d): stub\n",
103 hWnd, debugstr_a(szLocal), debugstr_a(szUser), nQueue );
104 return WN16_NET_ERROR;
107 /**************************************************************************
108 * WNetUnwatchQueue16 [USER.509]
110 WORD WINAPI WNetUnwatchQueue16( LPSTR szQueue )
112 FIXME( "(%s): stub\n", debugstr_a(szQueue) );
113 return WN16_NET_ERROR;
116 /**************************************************************************
117 * WNetLockQueueData16 [USER.510]
119 WORD WINAPI WNetLockQueueData16( LPSTR szQueue, LPSTR szUser,
120 LPQUEUESTRUCT16 *lplpQueueStruct )
122 FIXME( "(%s, %s, %p): stub\n",
123 debugstr_a(szQueue), debugstr_a(szUser), lplpQueueStruct );
124 return WN16_NET_ERROR;
127 /**************************************************************************
128 * WNetUnlockQueueData16 [USER.511]
130 WORD WINAPI WNetUnlockQueueData16( LPSTR szQueue )
132 FIXME( "(%s): stub\n", debugstr_a(szQueue) );
133 return WN16_NET_ERROR;
141 /********************************************************************
142 * WNetAddConnection16 [USER.517] Directs a local device to net
144 * Redirects a local device (either a disk drive or printer port)
145 * to a shared device on a remote server.
147 WORD WINAPI WNetAddConnection16( LPSTR lpNetPath, LPSTR lpPassWord,
150 FIXME( "(%s, %p, %s): stub\n",
151 debugstr_a(lpNetPath), lpPassWord, debugstr_a(lpLocalName) );
152 return WN16_NET_ERROR;
155 /********************************************************************
156 * WNetCancelConnection16 [USER.518] undirects a local device
158 WORD WINAPI WNetCancelConnection16( LPSTR lpName, BOOL16 bForce )
160 FIXME( "(%s, %04X): stub\n", debugstr_a(lpName), bForce);
161 return WN16_NOT_SUPPORTED;
164 /********************************************************************
165 * WNetGetConnection16 [USER.512] reverse-resolves a local device
167 WORD WINAPI WNetGetConnection16( LPSTR lpLocalName,
168 LPSTR lpRemoteName, UINT16 *cbRemoteName )
172 TRACE( "local %s\n", lpLocalName );
173 if (lpLocalName[1] == ':')
175 int drive = toupper(lpLocalName[0]) - 'A';
176 switch(GetDriveTypeA(lpLocalName))
179 path = DRIVE_GetLabel(drive);
180 if (strlen(path) + 1 > *cbRemoteName)
182 *cbRemoteName = strlen(path) + 1;
183 return WN16_MORE_DATA;
185 strcpy( lpRemoteName, path );
186 *cbRemoteName = strlen(lpRemoteName) + 1;
188 case DRIVE_REMOVABLE:
191 TRACE("file is local\n");
192 return WN16_NOT_CONNECTED;
194 return WN16_BAD_LOCALNAME;
197 return WN16_BAD_LOCALNAME;
200 /**************************************************************************
201 * WNetRestoreConnection16 [USER.523]
203 WORD WINAPI WNetRestoreConnection16( HWND16 hwndOwner, LPSTR lpszDevice )
205 FIXME( "(%04x, %s): stub\n", hwndOwner, debugstr_a(lpszDevice) );
206 return WN16_NOT_SUPPORTED;
214 /**************************************************************************
215 * WNetGetCaps16 [USER.513]
217 WORD WINAPI WNetGetCaps16( WORD capability )
221 case WNNC16_SPEC_VERSION:
222 return 0x30a; /* WfW 3.11 (and apparently other 3.1x) */
224 case WNNC16_NET_TYPE:
225 /* hi byte = network type,
226 lo byte = network vendor (Netware = 0x03) [15 types] */
227 return WNNC16_NET_MultiNet | WNNC16_SUBNET_WinWorkgroups;
229 case WNNC16_DRIVER_VERSION:
230 /* driver version of vendor */
231 return 0x100; /* WfW 3.11 */
234 /* 1 = WNetGetUser is supported */
237 case WNNC16_CONNECTION:
238 /* returns mask of the supported connection functions */
239 return WNNC16_CON_AddConnection | WNNC16_CON_CancelConnection
240 | WNNC16_CON_GetConnections /* | WNNC16_CON_AutoConnect */
241 | WNNC16_CON_BrowseDialog | WNNC16_CON_RestoreConnection;
243 case WNNC16_PRINTING:
244 /* returns mask of the supported printing functions */
245 return WNNC16_PRT_OpenJob | WNNC16_PRT_CloseJob | WNNC16_PRT_HoldJob
246 | WNNC16_PRT_ReleaseJob | WNNC16_PRT_CancelJob
247 | WNNC16_PRT_SetJobCopies | WNNC16_PRT_WatchQueue
248 | WNNC16_PRT_UnwatchQueue | WNNC16_PRT_LockQueueData
249 | WNNC16_PRT_UnlockQueueData | WNNC16_PRT_AbortJob
250 | WNNC16_PRT_WriteJob;
253 /* returns mask of the supported dialog functions */
254 return WNNC16_DLG_DeviceMode | WNNC16_DLG_BrowseDialog
255 | WNNC16_DLG_ConnectDialog | WNNC16_DLG_DisconnectDialog
256 | WNNC16_DLG_ViewQueueDialog | WNNC16_DLG_PropertyDialog
257 | WNNC16_DLG_ConnectionDialog
258 /* | WNNC16_DLG_PrinterConnectDialog
259 | WNNC16_DLG_SharesDialog | WNNC16_DLG_ShareAsDialog */;
262 /* returns mask of the supported administration functions */
263 /* not sure if long file names is a good idea */
264 return WNNC16_ADM_GetDirectoryType
265 /* | WNNC16_ADM_DirectoryNotify */ /*not yet supported*/
266 | WNNC16_ADM_LongNames /* | WNNC16_ADM_SetDefaultDrive */;
269 /* returns mask of the supported error functions */
270 return WNNC16_ERR_GetError | WNNC16_ERR_GetErrorText;
272 case WNNC16_PRINTMGREXT:
273 /* returns the Print Manager version in major and
274 minor format if Print Manager functions are available */
275 return 0x30e; /* printman version of WfW 3.11 */
278 /* Win 3.11 returns HMODULE of network driver here
279 FIXME: what should we return ?
280 logonoff.exe needs it, msmail crashes with wrong value */
293 /**************************************************************************
294 * WNetGetUser16 [USER.516]
296 WORD WINAPI WNetGetUser16( LPCSTR lpName, LPSTR szUser, LPINT16 nBufferSize )
298 FIXME( "(%p, %p, %p): stub\n", lpName, szUser, nBufferSize );
299 return WN16_NOT_SUPPORTED;
307 /**************************************************************************
308 * WNetDeviceMode16 [USER.514]
310 WORD WINAPI WNetDeviceMode16( HWND16 hWndOwner )
312 FIXME( "(%04x): stub\n", hWndOwner );
313 return WN16_NOT_SUPPORTED;
316 /**************************************************************************
317 * WNetBrowseDialog16 [USER.515]
319 WORD WINAPI WNetBrowseDialog16( HWND16 hParent, WORD nType, LPSTR szPath )
321 FIXME( "(%04x, %x, %s): stub\n", hParent, nType, szPath );
322 return WN16_NOT_SUPPORTED;
325 /********************************************************************
326 * WNetConnectDialog [USER.525]
328 WORD WINAPI WNetConnectDialog( HWND16 hWndParent, WORD iType )
330 FIXME( "(%04x, %x): stub\n", hWndParent, iType );
334 /**************************************************************************
335 * WNetDisconnectDialog16 [USER.526]
337 WORD WINAPI WNetDisconnectDialog16( HWND16 hwndOwner, WORD iType )
339 FIXME( "(%04x, %x): stub\n", hwndOwner, iType );
340 return WN16_NOT_SUPPORTED;
343 /**************************************************************************
344 * WNetConnectionDialog16 [USER.527]
346 WORD WINAPI WNetConnectionDialog16( HWND16 hWndParent, WORD iType )
348 FIXME( "(%04x, %x): stub\n", hWndParent, iType );
352 /**************************************************************************
353 * WNetViewQueueDialog16 [USER.528]
355 WORD WINAPI WNetViewQueueDialog16( HWND16 hwndOwner, LPSTR lpszQueue )
357 FIXME(" (%04x, %s): stub\n", hwndOwner, debugstr_a(lpszQueue) );
358 return WN16_NOT_SUPPORTED;
361 /**************************************************************************
362 * WNetPropertyDialog16 [USER.529]
364 WORD WINAPI WNetPropertyDialog16( HWND16 hwndParent, WORD iButton,
365 WORD nPropSel, LPSTR lpszName, WORD nType )
367 FIXME( "(%04x, %x, %x, %s, %x ): stub\n",
368 hwndParent, iButton, nPropSel, debugstr_a(lpszName), nType );
369 return WN16_NOT_SUPPORTED;
372 /**************************************************************************
373 * WNetGetPropertyText16 [USER.532]
375 WORD WINAPI WNetGetPropertyText16( WORD iButton, WORD nPropSel, LPSTR lpszName,
376 LPSTR lpszButtonName, WORD cbButtonName, WORD nType )
378 FIXME( "(%04x, %04x, %s, %s, %04x): stub\n",
379 iButton, nPropSel, debugstr_a(lpszName), debugstr_a(lpszButtonName), nType);
380 return WN16_NOT_SUPPORTED;
388 /*********************************************************************
389 * WNetGetDirectoryType16 [USER.530] Decides whether resource is local
392 * on success, puts one of the following in *lpType:
393 * - WNDT_NETWORK on a network
396 WORD WINAPI WNetGetDirectoryType16( LPSTR lpName, LPINT16 lpType )
398 UINT type = GetDriveTypeA(lpName);
399 if ( type == DRIVE_DOESNOTEXIST )
400 type = GetDriveTypeA(NULL);
402 *lpType = (type == DRIVE_REMOTE)? WNDT_NETWORK : WNDT_NORMAL;
404 TRACE( "%s is %s\n", debugstr_a(lpName),
405 (*lpType == WNDT_NETWORK)? "WNDT_NETWORK" : "WNDT_NORMAL" );
409 /**************************************************************************
410 * WNetDirectoryNotify16 [USER.531]
412 WORD WINAPI WNetDirectoryNotify16( HWND16 hwndOwner, LPSTR lpDir, WORD wOper )
414 FIXME( "(%04x, %s, %s): stub\n", hwndOwner, debugstr_a(lpDir),
415 (wOper == WNDN_MKDIR)? "WNDN_MKDIR" :
416 (wOper == WNDN_MVDIR)? "WNDN_MVDIR" :
417 (wOper == WNDN_RMDIR)? "WNDN_RMDIR" : "unknown" );
418 return WN16_NOT_SUPPORTED;
426 /**************************************************************************
427 * WNetGetError16 [USER.519]
429 WORD WINAPI WNetGetError16( LPINT16 nError )
431 FIXME( "(%p): stub\n", nError );
432 return WN16_NOT_SUPPORTED;
435 /**************************************************************************
436 * WNetGetErrorText16 [USER.520]
438 WORD WINAPI WNetGetErrorText16( WORD nError, LPSTR lpBuffer, LPINT16 nBufferSize )
440 FIXME( "(%x, %p, %p): stub\n", nError, lpBuffer, nBufferSize );
441 return WN16_NET_ERROR;
444 /**************************************************************************
445 * WNetErrorText16 [USER.499]
447 WORD WINAPI WNetErrorText16( WORD nError, LPSTR lpszText, WORD cbText )
449 FIXME("(%x, %p, %x): stub\n", nError, lpszText, cbText );