wine/misc/network.c
Alexandre Julliard 54c2711ff6 Release 980329
Sun Mar 29 15:18:57 1998  Uwe Bonnes <elektron.ikp.physik.tu-darmstadt.de>

	* [msdos/int21.c]
	More verbose Trace messages

Sun Mar 29 15:03:30 1998  Alexandre Julliard  <julliard@lrc.epfl.ch>

	* [loader/ne_image.c]
	Terminate relocation chains on 0 offset.

Sun Mar 29 02:35:45 1998  James Juran  <jrj120@psu.edu>

	* [windows/caret.c] [windows/class.c] [windows/clipboard.c]
	Fixed more USER32 ordinal numbers in function documentation.

Sat Mar 28 22:40:23 1997  Andreas Mohr <100.30936@germany.net>

	* [controls/desktop.c]
	Return 1 for WM_NCCREATE in DesktopWndProc.

	* [controls/menu.c]
	Fixed crash when destroying a top popup win that was only created
	but not shown.

	* [ole/typelib.c] [if1632/typelib.spec]
	Implemented OABuildVersion.

	* [windows/win.c]
	Finally fixed ugly bug in GetParent32 that affected window placement:
	Didn't return 0 for windows that have neither WS_POPUP nor
	WS_CHILD set. Now it acts exactly like Windows (at least I hope so ;)

Sat Mar 28 02:26:43 1998  Dimitrie O. Paun  <dimi@mail.cs.toronto.edu>

	* [DEVELOPERS-HINTS] [documentation/debug-msgs]
	Updated documentation on debug messages

	* [include/button.h] [controls/button.c] [include/windows.h]
	[include/combo.h] [controls/combo.c] [controls/commctrl.c]
	[controls/icontitle.c] [controls/listbox.c]	[controls/menu.c]
	[controls/scroll.c] [controls/widgets.c] 
	Changed some 16-bit code to 32-bit code. I am positive this will
	not break anything.

	* [controls/uitools.c] 
	Renamed the prefix of some functions from UITOOLS_ to UITOOLS95_
	to reflect the fact that they implement Win95 look. Maybe we will
	have a UITOOLS31_ in the future. Anyhow, the change is completely
	internal to this file.

	* [*/*.c]
	Changed a lot of [f]printf into appropriate debug messages.

Fri Mar 27 19:56:12 1998  Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
	* [documentation/status/]
	Added directdraw and directsound status.

	* [if1632/thunk.c][ole/*.c][win32/kernel32.c]
	Added some documentation.
	Moved FUNC004 to thunk.c since it seems to be a 16->32 thunk
	(calling conventions and the like still unknown).

Fri Mar 27 09:59:32 1998  Morten Eriksen  <mortene@pvv.org>

	* [loader/resource.c][windows/keyboard.c]
	Implemented CopyAcceleratorTable() and CreateAcceleratorTable().
	
	* [include/compobj.h][ole/compobj.c][relay32/ole32.spec]
	Added implementation of StringFromGUID2(). 

Tue Mar 26 23:12:05 1998  Eric Kohl <ekohl@abo.rhein-zeitung.de>

	* [misc/imagelist.c][relay32/comctl32.spec]
	Implemented new debugging interface.
	Added missing functions (some are empty stubs).
	Changed ordinals in comctl32.spec (now dll version 4.72 comatible).

	* [objects/oembitmaps.c][include/windows.h]
	  [include/bitmaps/*]
	Added missing restore bitmaps for Win95 look.
	Added missing Win95 cursors.

Thu Mar 26 10:18:20 1998  Douglas Ridgway  <ridgway@winehq.com>

	* [programs/view/Makefile.in] [programs/view/view.c]
	Fix compilation, Aldus placeable metafile loading.

	* [graphics/metafiledrv/init.c] [relay32/gdi32.spec] 
	  [objects/metafile.c]
	Implemented various 32 bit versions of regular metafile API.

	* [objects/enhmetafile.c]
	Implemented rendering of a couple of dozen records.

Tue Mar 24 20:06:39 1998  Matthew Becker <mbecker@glasscity.net>

	* [memory/*.c]
	Updated documentation for API manpages.

Mon Mar 23 09:09:00 1998  Alex Korobka <alex@pharm.sunysb.edu>

	* [misc/winsock.c]
	Fixed 32-bit DNS lookup.

Mon Mar 23 23:54:47 1998  Luiz Otavio L. Zorzella  <zorzella@nr.conexware.com>

	* [multimedia/init.c]
	New code for the initialization and gathering of information about
	the MIDI devices, for future use.

Thu Mar 19 00:59:29 1998  Jim Peterson <jspeter@nospam.birch.ee.vt.edu>

	* [windows/win.c]
	Eliminated inaccurate setting of cs->hMenu in
	WIN_CreateWindowEx, along with superfluous SetMenu32 call.

Mon Mar 16 17:40:53 1998  Petter Reinholdtsen <pere@td.org.uit.no>

	* [debugger/dbg.y] [debugger/Makefile.in] [Makefile.in]
	Install wine.sym in $(exec_prefix)/lib and make sure the debugger
	finds it.

Sun Mar 15 22:36:35 1998  Michael Veksler <mveksler@tx.technion.ac.il>

	* [dummy.c] [if1632/gdi.spec]
	Fixed stub declaration of GDI_532, so Hebrew-Word2 kind of works.
1998-03-29 19:44:57 +00:00

462 lines
14 KiB
C

/*
* Network functions
*/
#include <ctype.h>
#include <stdio.h>
#include "windows.h"
#include "winerror.h"
#include "drive.h"
#include "wnet.h"
#include "debug.h"
/**************************************************************************
* WNetErrorText [USER.499]
*/
int WINAPI WNetErrorText(WORD nError,LPSTR lpszText,WORD cbText)
{
FIXME(wnet, "(%x,%p,%x): stub\n",nError,lpszText,cbText);
return FALSE;
}
/**************************************************************************
* WNetOpenJob [USER.501]
*/
int WINAPI WNetOpenJob(LPSTR szQueue,LPSTR szJobTitle,WORD nCopies,LPWORD pfh)
{
FIXME(wnet, "('%s','%s',%x,%p): stub\n",
szQueue,szJobTitle,nCopies,pfh);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetCloseJob [USER.502]
*/
int WINAPI WNetCloseJob(WORD fh,LPWORD pidJob,LPSTR szQueue)
{
FIXME(wnet, "(%x,%p,'%s'): stub\n",fh,pidJob,szQueue);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetAbortJob [USER.503]
*/
int WINAPI WNetAbortJob(LPSTR szQueue,WORD wJobId)
{
FIXME(wnet, "('%s',%x): stub\n",szQueue,wJobId);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetHoldJob [USER.504]
*/
int WINAPI WNetHoldJob(LPSTR szQueue,WORD wJobId)
{
FIXME(wnet, "('%s',%x): stub\n",szQueue,wJobId);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetReleaseJob [USER.505]
*/
int WINAPI WNetReleaseJob(LPSTR szQueue,WORD wJobId)
{
FIXME(wnet, "('%s',%x): stub\n",szQueue,wJobId);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetCancelJob [USER.506]
*/
int WINAPI WNetCancelJob(LPSTR szQueue,WORD wJobId)
{
FIXME(wnet, "('%s',%x): stub\n",szQueue,wJobId);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetSetJobCopies [USER.507]
*/
int WINAPI WNetSetJobCopies(LPSTR szQueue,WORD wJobId,WORD nCopies)
{
FIXME(wnet, "('%s',%x,%x): stub\n",szQueue,wJobId,nCopies);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetWatchQueue [USER.508]
*/
int WINAPI WNetWatchQueue(HWND16 hWnd,LPSTR szLocal,LPSTR szUser,WORD nQueue)
{
FIXME(wnet, "(%04x,'%s','%s',%x): stub\n",hWnd,szLocal,szUser,nQueue);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetUnwatchQueue [USER.509]
*/
int WINAPI WNetUnwatchQueue(LPSTR szQueue)
{
FIXME(wnet, "('%s'): stub\n", szQueue);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetLockQueueData [USER.510]
*/
int WINAPI WNetLockQueueData(LPSTR szQueue,LPSTR szUser,void *lplpQueueStruct)
{
FIXME(wnet, "('%s','%s',%p): stub\n",szQueue,szUser,lplpQueueStruct);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetUnlockQueueData [USER.511]
*/
int WINAPI WNetUnlockQueueData(LPSTR szQueue)
{
FIXME(wnet, "('%s'): stub\n",szQueue);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetGetConnection [USER.512]
*/
int WINAPI WNetGetConnection16(LPCSTR lpLocalName,
LPSTR lpRemoteName, UINT16 *cbRemoteName)
{
const char *path;
if (lpLocalName[1] == ':')
{
int drive = toupper(lpLocalName[0]) - 'A';
switch(GetDriveType16(drive))
{
case DRIVE_CANNOTDETERMINE:
case DRIVE_DOESNOTEXIST:
return WN_BAD_LOCALNAME;
case DRIVE_REMOVABLE:
case DRIVE_FIXED:
return WN_NOT_CONNECTED;
case DRIVE_REMOTE:
path = DRIVE_GetLabel(drive);
if (strlen(path) + 1 > *cbRemoteName)
{
*cbRemoteName = strlen(path) + 1;
return WN_MORE_DATA;
}
strcpy( lpRemoteName, path );
*cbRemoteName = strlen(lpRemoteName) + 1;
return WN_SUCCESS;
}
}
return WN_BAD_LOCALNAME;
}
/**************************************************************************
* WNetGetCaps [USER.513]
*/
int WINAPI WNetGetCaps(WORD capability)
{
switch (capability) {
case WNNC_SPEC_VERSION:
{
return 0x30a; /* WfW 3.11(and apparently other 3.1x) */
}
case WNNC_NET_TYPE:
/* hi byte = network type,
lo byte = network vendor (Netware = 0x03) [15 types] */
return WNNC_NET_MultiNet | WNNC_SUBNET_WinWorkgroups;
case WNNC_DRIVER_VERSION:
/* driver version of vendor */
return 0x100; /* WfW 3.11 */
case WNNC_USER:
/* 1 = WNetGetUser is supported */
return 1;
case WNNC_CONNECTION:
/* returns mask of the supported connection functions */
return WNNC_CON_AddConnection|WNNC_CON_CancelConnection
|WNNC_CON_GetConnections/*|WNNC_CON_AutoConnect*/
|WNNC_CON_BrowseDialog|WNNC_CON_RestoreConnection;
case WNNC_PRINTING:
/* returns mask of the supported printing functions */
return WNNC_PRT_OpenJob|WNNC_PRT_CloseJob|WNNC_PRT_HoldJob
|WNNC_PRT_ReleaseJob|WNNC_PRT_CancelJob
|WNNC_PRT_SetJobCopies|WNNC_PRT_WatchQueue
|WNNC_PRT_UnwatchQueue|WNNC_PRT_LockQueueData
|WNNC_PRT_UnlockQueueData|WNNC_PRT_AbortJob
|WNNC_PRT_WriteJob;
case WNNC_DIALOG:
/* returns mask of the supported dialog functions */
return WNNC_DLG_DeviceMode|WNNC_DLG_BrowseDialog
|WNNC_DLG_ConnectDialog|WNNC_DLG_DisconnectDialog
|WNNC_DLG_ViewQueueDialog|WNNC_DLG_PropertyDialog
|WNNC_DLG_ConnectionDialog
/*|WNNC_DLG_PrinterConnectDialog
|WNNC_DLG_SharesDialog|WNNC_DLG_ShareAsDialog*/;
case WNNC_ADMIN:
/* returns mask of the supported administration functions */
/* not sure if long file names is a good idea */
return WNNC_ADM_GetDirectoryType|WNNC_ADM_DirectoryNotify
|WNNC_ADM_LongNames/*|WNNC_ADM_SetDefaultDrive*/;
case WNNC_ERROR:
/* returns mask of the supported error functions */
return WNNC_ERR_GetError|WNNC_ERR_GetErrorText;
case WNNC_PRINTMGREXT:
/* returns the Print Manager version in major and
minor format if Print Manager functions are available */
return 0x30e; /* printman version of WfW 3.11 */
case 0xffff:
/* Win 3.11 returns HMODULE of network driver here
FIXME: what should we return ?
logonoff.exe needs it, msmail crashes with wrong value */
return 0;
default:
return 0;
}
}
/**************************************************************************
* WNetDeviceMode [USER.514]
*/
int WINAPI WNetDeviceMode(HWND16 hWndOwner)
{
FIXME(wnet, "(%04x): stub\n",hWndOwner);
return WN_NO_NETWORK;
}
/**************************************************************************
* WNetBrowseDialog [USER.515]
*/
int WINAPI WNetBrowseDialog(HWND16 hParent,WORD nType,LPSTR szPath)
{
FIXME(wnet, "(%04x,%x,'%s'): stub\n",hParent,nType,szPath);
return WN_NO_NETWORK;
}
/**************************************************************************
* WNetGetUser [USER.516]
*/
UINT16 WINAPI WNetGetUser(LPSTR lpLocalName, LPSTR lpUserName, DWORD *lpSize)
{
FIXME(wnet, "(%p, %p, %p): stub\n", lpLocalName, lpUserName, lpSize);
return WN_NO_NETWORK;
}
/**************************************************************************
* WNetAddConnection [USER.517]
*/
UINT16 WINAPI WNetAddConnection(LPSTR lpNetPath, LPSTR lpPassWord,
LPSTR lpLocalName)
{
FIXME(wnet, "('%s', %p, '%s'): stub\n",
lpNetPath,lpPassWord,lpLocalName);
return WN_NO_NETWORK;
}
/**************************************************************************
* WNetCancelConnection [USER.518]
*/
UINT16 WINAPI WNetCancelConnection(LPSTR lpName, BOOL16 bForce)
{
FIXME(wnet, "('%s', %04X): stub\n", lpName, bForce);
return WN_NO_NETWORK;
}
/**************************************************************************
* WNetGetError [USER.519]
*/
int WINAPI WNetGetError(LPWORD nError)
{
FIXME(wnet, "(%p): stub\n",nError);
return WN_NO_NETWORK;
}
/**************************************************************************
* WNetGetErrorText [USER.520]
*/
int WINAPI WNetGetErrorText(WORD nError, LPSTR lpBuffer, LPWORD nBufferSize)
{
FIXME(wnet, "(%x,%p,%p): stub\n",nError,lpBuffer,nBufferSize);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetRestoreConnection [USER.523]
*/
int WINAPI WNetRestoreConnection(HWND16 hwndOwner,LPSTR lpszDevice)
{
FIXME(wnet, "(%04x,'%s'): stub\n",hwndOwner,lpszDevice);
return WN_NO_NETWORK;
}
/**************************************************************************
* WNetWriteJob [USER.524]
*/
int WINAPI WNetWriteJob(HANDLE16 hJob,void *lpData,LPWORD lpcbData)
{
FIXME(wnet, "(%04x,%p,%p): stub\n",hJob,lpData,lpcbData);
return WN_NO_NETWORK;
}
/**************************************************************************
* WnetConnectDialog [USER.525]
*/
UINT16 WINAPI WNetConnectDialog(HWND16 hWndParent, WORD iType)
{
FIXME(wnet, "(%04x, %4X): stub\n", hWndParent, iType);
return WN_SUCCESS;
}
/**************************************************************************
* WNetDisconnectDialog [USER.526]
*/
int WINAPI WNetDisconnectDialog(HWND16 hwndOwner, WORD iType)
{
FIXME(wnet, "(%04x,%x): stub\n",hwndOwner,iType);
return WN_NO_NETWORK;
}
/**************************************************************************
* WnetConnectionDialog [USER.527]
*/
UINT16 WINAPI WNetConnectionDialog(HWND16 hWndParent, WORD iType)
{
FIXME(wnet, "(%04x, %4X): stub\n", hWndParent, iType);
return WN_SUCCESS;
}
/**************************************************************************
* WNetViewQueueDialog [USER.528]
*/
int WINAPI WNetViewQueueDialog(HWND16 hwndOwner,LPSTR lpszQueue)
{
FIXME(wnet, "(%04x,'%s'): stub\n",hwndOwner,lpszQueue);
return WN_NO_NETWORK;
}
/**************************************************************************
* WNetPropertyDialog [USER.529]
*/
int WINAPI WNetPropertyDialog(HWND16 hwndParent,WORD iButton,
WORD nPropSel,LPSTR lpszName,WORD nType)
{
FIXME(wnet, "(%04x,%x,%x,'%s',%x): stub\n",
hwndParent,iButton,nPropSel,lpszName,nType);
return WN_NO_NETWORK;
}
/**************************************************************************
* WNetGetDirectoryType [USER.530]
*/
int WINAPI WNetGetDirectoryType(LPSTR lpName,void *lpType)
{
FIXME(wnet, "('%s',%p): stub\n",lpName,lpType);
return WN_NO_NETWORK;
}
/**************************************************************************
* WNetDirectoryNotify [USER.531]
*/
int WINAPI WNetDirectoryNotify(HWND16 hwndOwner,void *lpDir,WORD wOper)
{
FIXME(wnet, "(%04x,%p,%x): stub\n",hwndOwner,lpDir,wOper);
return WN_NO_NETWORK;
}
/**************************************************************************
* WNetGetPropertyText [USER.532]
*/
int WINAPI WNetGetPropertyText(HWND16 hwndParent,WORD iButton,WORD nPropSel,
LPSTR lpszName,WORD nType)
{
FIXME(wnet, "(%04x,%x,%x,'%s',%x): stub\n",
hwndParent,iButton,nPropSel,lpszName,nType);
return WN_NO_NETWORK;
}
/**************************************************************************
* WNetAddConnection2 [USER.???]
*/
UINT16 WINAPI WNetAddConnection2(LPSTR lpNetPath, LPSTR lpPassWord,
LPSTR lpLocalName, LPSTR lpUserName)
{
FIXME(wnet, "('%s', %p, '%s', '%s'): stub\n",
lpNetPath, lpPassWord, lpLocalName, lpUserName);
return WN_NO_NETWORK;
}
/**************************************************************************
* WNetCloseEnum [USER.???]
*/
UINT16 WINAPI WNetCloseEnum(HANDLE16 hEnum)
{
FIXME(wnet, "(%04x): stub\n", hEnum);
return WN_NO_NETWORK;
}
/**************************************************************************
* WNetEnumResource [USER.???]
*/
UINT16 WINAPI WNetEnumResource(HANDLE16 hEnum, DWORD cRequ,
DWORD *lpCount, LPVOID lpBuf)
{
FIXME(wnet, "(%04x, %08lX, %p, %p): stub\n",
hEnum, cRequ, lpCount, lpBuf);
return WN_NO_NETWORK;
}
/**************************************************************************
* WNetOpenEnum [USER.???]
*/
UINT16 WINAPI WNetOpenEnum16(DWORD dwScope, DWORD dwType,
LPNETRESOURCE16 lpNet, HANDLE16 *lphEnum)
{
FIXME(wnet, "(%08lX, %08lX, %p, %p): stub\n",
dwScope, dwType, lpNet, lphEnum);
return WN_NO_NETWORK;
}
/**************************************************************************
* WNetOpenEnumA [MPR.92]
*/
UINT32 WINAPI WNetOpenEnum32A(DWORD dwScope, DWORD dwType,
LPNETRESOURCE32A lpNet, HANDLE32 *lphEnum)
{
FIXME(wnet, "(%08lX, %08lX, %p, %p): stub\n",
dwScope, dwType, lpNet, lphEnum);
return WN_NO_NETWORK;
}
/**************************************************************************
* WNetGetConnectionA [MPR.92]
*/
DWORD WINAPI
WNetGetConnection32A(LPCSTR localname,LPSTR remotename,LPDWORD buflen)
{
UINT16 x;
DWORD ret = WNetGetConnection16(localname,remotename,&x);
*buflen = x;
return ret;
}
DWORD WINAPI
WNetGetResourceInformation32A(
LPNETRESOURCE32A netres,LPVOID buf,LPDWORD buflen,LPSTR systemstr
) {
FIXME(wnet,"(%p,%p,%p,%p): stub!\n",netres,buf,buflen,systemstr);
return WN_NO_NETWORK;
}