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

Alexandre Julliard julliard at wine.codeweavers.com
Mon Mar 19 08:17:45 CDT 2007


Module: wine
Branch: master
Commit: fa841ae37982e11f6715232bed04ec270f1afec2
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=fa841ae37982e11f6715232bed04ec270f1afec2

Author: Kai Blin <kai.blin at gmail.com>
Date:   Mon Mar 19 02:33:36 2007 +0100

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

---

 dlls/netapi32/access.c        |   20 +++++++++++++++++---
 dlls/netapi32/local_group.c   |    1 -
 dlls/netapi32/netapi32_misc.h |   35 -----------------------------------
 3 files changed, 17 insertions(+), 39 deletions(-)

diff --git a/dlls/netapi32/access.c b/dlls/netapi32/access.c
index 804b629..ce324c7 100644
--- a/dlls/netapi32/access.c
+++ b/dlls/netapi32/access.c
@@ -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:
diff --git a/dlls/netapi32/local_group.c b/dlls/netapi32/local_group.c
index 68534ac..a9f838f 100644
--- a/dlls/netapi32/local_group.c
+++ b/dlls/netapi32/local_group.c
@@ -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"
 
diff --git a/dlls/netapi32/netapi32_misc.h b/dlls/netapi32/netapi32_misc.h
deleted file mode 100644
index 947d900..0000000
--- a/dlls/netapi32/netapi32_misc.h
+++ /dev/null
@@ -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




More information about the wine-cvs mailing list