netapi32: Remove another macro, replace by more readable functions.

This commit is contained in:
Kai Blin 2007-03-19 02:33:36 +01:00 committed by Alexandre Julliard
parent 284683a24e
commit fa841ae379
3 changed files with 17 additions and 39 deletions

View File

@ -31,7 +31,6 @@
#include "lmerr.h"
#include "winreg.h"
#include "ntsecapi.h"
#include "netapi32_misc.h"
#include "wine/debug.h"
#include "wine/unicode.h"
@ -41,6 +40,8 @@ static const WCHAR sAdminUserName[] = {'A','d','m','i','n','i','s','t','r','a','
'o','r',0};
static const WCHAR sGuestUserName[] = {'G','u','e','s','t',0};
BOOL NETAPI_IsLocalComputer(LPCWSTR ServerName);
/************************************************************
* NETAPI_ValidateServername
*
@ -143,7 +144,13 @@ NetUserGetInfo(LPCWSTR servername, LPCWSTR username, DWORD level,
status = NETAPI_ValidateServername(servername);
if (status != NERR_Success)
return status;
NETAPI_ForceLocalComputer(servername, NERR_InvalidComputer);
if(!NETAPI_IsLocalComputer(servername))
{
FIXME("Only implemented for local computer, but remote server"
"%s was requested.\n", debugstr_w(servername));
return NERR_InvalidComputer;
}
if(!NETAPI_IsKnownUser(username))
{
@ -466,7 +473,14 @@ NetQueryDisplayInformation(
TRACE("(%s, %d, %d, %d, %d, %p, %p)\n", debugstr_w(ServerName),
Level, Index, EntriesRequested, PreferredMaximumLength,
ReturnedEntryCount, SortedBuffer);
NETAPI_ForceLocalComputer(ServerName, ERROR_ACCESS_DENIED);
if(!NETAPI_IsLocalComputer(ServerName))
{
FIXME("Only implemented on local computer, but requested for "
"remote server %s\n", debugstr_w(ServerName));
return ERROR_ACCESS_DENIED;
}
switch (Level)
{
case 1:

View File

@ -31,7 +31,6 @@
#include "lmerr.h"
#include "winreg.h"
#include "ntsecapi.h"
#include "netapi32_misc.h"
#include "wine/debug.h"
#include "wine/unicode.h"

View File

@ -1,35 +0,0 @@
/*
* Copyright 2002 Andriy Palamarchuk
*
* netapi32 internal functions.
*
* 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, writ
e to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __WINE_NETAPI32_MISC_H
#define __WINE_NETAPI32_MISC_H
extern BOOL NETAPI_IsLocalComputer(LPCWSTR ServerName);
#define NETAPI_ForceLocalComputer(ServerName, FailureCode) \
if (!NETAPI_IsLocalComputer(ServerName)) \
{ \
FIXME("Action Implemented for local computer only. " \
"Requested for server %s\n", debugstr_w(ServerName)); \
return FailureCode; \
}
#endif