2003-11-29 01:19:19 +01:00
|
|
|
/* Copyright 2001 Mike McCormack
|
|
|
|
* Copyright 2003 Juan Lang
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2001-11-06 18:52:36 +01:00
|
|
|
*/
|
|
|
|
|
2001-11-06 20:01:05 +01:00
|
|
|
#include "config.h"
|
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
#include "wine/debug.h"
|
2005-11-30 12:04:18 +01:00
|
|
|
#include "lm.h"
|
2003-11-29 01:19:19 +01:00
|
|
|
#include "netbios.h"
|
2001-11-06 18:52:36 +01:00
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(netbios);
|
2001-11-06 18:52:36 +01:00
|
|
|
|
2007-01-16 22:11:37 +01:00
|
|
|
static HMODULE NETAPI32_hModule;
|
2001-11-06 18:52:36 +01:00
|
|
|
|
2002-11-05 00:53:41 +01:00
|
|
|
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
2001-11-06 18:52:36 +01:00
|
|
|
{
|
2006-10-12 20:56:59 +02:00
|
|
|
TRACE("%p,%x,%p\n", hinstDLL, fdwReason, lpvReserved);
|
2001-11-06 18:52:36 +01:00
|
|
|
|
|
|
|
switch (fdwReason) {
|
2003-11-29 01:19:19 +01:00
|
|
|
case DLL_PROCESS_ATTACH:
|
|
|
|
{
|
2003-06-30 22:53:48 +02:00
|
|
|
DisableThreadLibraryCalls(hinstDLL);
|
2001-11-06 18:52:36 +01:00
|
|
|
NETAPI32_hModule = hinstDLL;
|
2003-11-29 01:19:19 +01:00
|
|
|
NetBIOSInit();
|
|
|
|
NetBTInit();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case DLL_PROCESS_DETACH:
|
|
|
|
{
|
|
|
|
NetBIOSShutdown();
|
|
|
|
break;
|
|
|
|
}
|
2001-11-06 18:52:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2006-06-07 13:42:24 +02:00
|
|
|
/************************************************************
|
|
|
|
* NetServerEnum (NETAPI32.@)
|
|
|
|
*/
|
2003-05-20 01:06:35 +02:00
|
|
|
NET_API_STATUS WINAPI NetServerEnum(
|
2007-08-08 10:41:51 +02:00
|
|
|
LMCSTR servername,
|
2003-05-20 01:06:35 +02:00
|
|
|
DWORD level,
|
|
|
|
LPBYTE* bufptr,
|
|
|
|
DWORD prefmaxlen,
|
|
|
|
LPDWORD entriesread,
|
|
|
|
LPDWORD totalentries,
|
|
|
|
DWORD servertype,
|
2007-08-08 10:41:51 +02:00
|
|
|
LMCSTR domain,
|
2003-05-20 01:06:35 +02:00
|
|
|
LPDWORD resume_handle
|
|
|
|
)
|
|
|
|
{
|
2006-10-12 20:56:59 +02:00
|
|
|
FIXME("Stub (%s %d %p %d %p %p %d %s %p)\n", debugstr_w(servername),
|
2004-04-05 22:17:45 +02:00
|
|
|
level, bufptr, prefmaxlen, entriesread, totalentries, servertype,
|
|
|
|
debugstr_w(domain), resume_handle);
|
2003-05-20 01:06:35 +02:00
|
|
|
|
|
|
|
return ERROR_NO_BROWSER_SERVERS_FOUND;
|
|
|
|
}
|
2003-09-11 05:09:19 +02:00
|
|
|
|
2006-06-07 13:42:24 +02:00
|
|
|
/************************************************************
|
|
|
|
* NetServerEnumEx (NETAPI32.@)
|
|
|
|
*/
|
|
|
|
NET_API_STATUS WINAPI NetServerEnumEx(
|
2007-08-08 10:41:51 +02:00
|
|
|
LMCSTR ServerName,
|
2006-06-07 13:42:24 +02:00
|
|
|
DWORD Level,
|
|
|
|
LPBYTE *Bufptr,
|
|
|
|
DWORD PrefMaxlen,
|
|
|
|
LPDWORD EntriesRead,
|
|
|
|
LPDWORD totalentries,
|
|
|
|
DWORD servertype,
|
2007-08-08 10:41:51 +02:00
|
|
|
LMCSTR domain,
|
|
|
|
LMCSTR FirstNameToReturn)
|
2006-06-07 13:42:24 +02:00
|
|
|
{
|
2006-10-12 20:56:59 +02:00
|
|
|
FIXME("Stub (%s %d %p %d %p %p %d %s %p)\n", debugstr_w(ServerName),
|
2006-06-07 13:42:24 +02:00
|
|
|
Level, Bufptr, PrefMaxlen, EntriesRead, totalentries, servertype,
|
|
|
|
debugstr_w(domain), debugstr_w(FirstNameToReturn));
|
|
|
|
|
|
|
|
return ERROR_NO_BROWSER_SERVERS_FOUND;
|
|
|
|
}
|
2003-09-11 05:09:19 +02:00
|
|
|
|
2004-04-02 21:17:42 +02:00
|
|
|
/************************************************************
|
|
|
|
* NetServerGetInfo (NETAPI32.@)
|
|
|
|
*/
|
2005-11-21 12:59:27 +01:00
|
|
|
NET_API_STATUS WINAPI NetServerGetInfo(LMSTR servername, DWORD level, LPBYTE* bufptr)
|
2004-04-02 21:17:42 +02:00
|
|
|
{
|
2009-10-08 18:34:04 +02:00
|
|
|
FIXME("stub (%s, %d, %p)\n", debugstr_w(servername), level, bufptr);
|
2004-04-02 21:17:42 +02:00
|
|
|
return ERROR_ACCESS_DENIED;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-09-11 05:09:19 +02:00
|
|
|
/************************************************************
|
|
|
|
* NetStatisticsGet (NETAPI32.@)
|
|
|
|
*/
|
2007-08-08 10:41:51 +02:00
|
|
|
NET_API_STATUS WINAPI NetStatisticsGet(LMSTR server, LMSTR service,
|
2003-09-11 05:09:19 +02:00
|
|
|
DWORD level, DWORD options,
|
|
|
|
LPBYTE *bufptr)
|
|
|
|
{
|
2006-10-12 20:56:59 +02:00
|
|
|
TRACE("(%p, %p, %d, %d, %p)\n", server, service, level, options, bufptr);
|
2003-09-11 05:09:19 +02:00
|
|
|
return NERR_InternalError;
|
|
|
|
}
|
2004-03-01 22:23:51 +01:00
|
|
|
|
|
|
|
DWORD WINAPI NetpNetBiosStatusToApiStatus(DWORD nrc)
|
|
|
|
{
|
|
|
|
DWORD ret;
|
|
|
|
|
|
|
|
switch (nrc)
|
|
|
|
{
|
|
|
|
case NRC_GOODRET:
|
|
|
|
ret = NO_ERROR;
|
|
|
|
break;
|
|
|
|
case NRC_NORES:
|
|
|
|
ret = NERR_NoNetworkResource;
|
|
|
|
break;
|
|
|
|
case NRC_DUPNAME:
|
|
|
|
ret = NERR_AlreadyExists;
|
|
|
|
break;
|
|
|
|
case NRC_NAMTFUL:
|
|
|
|
ret = NERR_TooManyNames;
|
|
|
|
break;
|
|
|
|
case NRC_ACTSES:
|
|
|
|
ret = NERR_DeleteLater;
|
|
|
|
break;
|
|
|
|
case NRC_REMTFUL:
|
|
|
|
ret = ERROR_REM_NOT_LIST;
|
|
|
|
break;
|
|
|
|
case NRC_NOCALL:
|
|
|
|
ret = NERR_NameNotFound;
|
|
|
|
break;
|
|
|
|
case NRC_NOWILD:
|
|
|
|
ret = ERROR_INVALID_PARAMETER;
|
|
|
|
break;
|
|
|
|
case NRC_INUSE:
|
|
|
|
ret = NERR_DuplicateName;
|
|
|
|
break;
|
|
|
|
case NRC_NAMERR:
|
|
|
|
ret = ERROR_INVALID_PARAMETER;
|
|
|
|
break;
|
|
|
|
case NRC_NAMCONF:
|
|
|
|
ret = NERR_DuplicateName;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
ret = NERR_NetworkError;
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
2007-10-30 21:34:48 +01:00
|
|
|
|
|
|
|
NET_API_STATUS WINAPI NetUseEnum(LMSTR server, DWORD level, LPBYTE* bufptr, DWORD prefmaxsize,
|
|
|
|
LPDWORD entriesread, LPDWORD totalentries, LPDWORD resumehandle)
|
|
|
|
{
|
|
|
|
FIXME("stub (%p, %d, %p, %d, %p, %p, %p)\n", server, level, bufptr, prefmaxsize,
|
|
|
|
entriesread, totalentries, resumehandle);
|
|
|
|
return ERROR_NOT_SUPPORTED;
|
|
|
|
}
|