Robert Reif : advapi32: Make ADVAPI_IsLocalComputer global and remove duplicate copy.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Jul 31 04:32:11 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 3f000d8c717bca14310871f8ea1119154f5bae09
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=3f000d8c717bca14310871f8ea1119154f5bae09

Author: Robert Reif <reif at earthlink.net>
Date:   Sat Jul 29 08:12:58 2006 -0400

advapi32: Make ADVAPI_IsLocalComputer global and remove duplicate copy.

Make debugstr_sid global.

---

 dlls/advapi32/advapi32_misc.h |   26 ++++++++++++++++++++++++++
 dlls/advapi32/lsa.c           |   25 +------------------------
 dlls/advapi32/security.c      |    5 +++--
 3 files changed, 30 insertions(+), 26 deletions(-)
 create mode 100644 dlls/advapi32/advapi32_misc.h

diff --git a/dlls/advapi32/advapi32_misc.h b/dlls/advapi32/advapi32_misc.h
new file mode 100644
index 0000000..436c0fe
--- /dev/null
+++ b/dlls/advapi32/advapi32_misc.h
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2006 Robert Reif
+ *
+ * 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
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ *
+ */
+
+#ifndef __WINE_ADVAPI32MISC_H
+#define __WINE_ADVAPI32MISC_H
+
+const char * debugstr_sid(PSID sid);
+BOOL ADVAPI_IsLocalComputer(LPCWSTR ServerName);
+
+#endif /* __WINE_ADVAPI32MISC_H */
diff --git a/dlls/advapi32/lsa.c b/dlls/advapi32/lsa.c
index 6e70345..62b2075 100644
--- a/dlls/advapi32/lsa.c
+++ b/dlls/advapi32/lsa.c
@@ -30,6 +30,7 @@ #include "winbase.h"
 #include "winreg.h"
 #include "winternl.h"
 #include "ntsecapi.h"
+#include "advapi32_misc.h"
 
 #include "wine/debug.h"
 
@@ -54,30 +55,6 @@ static void dumpLsaAttributes(PLSA_OBJEC
     }
 }
 
-/************************************************************
- * ADVAPI_IsLocalComputer
- *
- * Checks whether the server name indicates local machine.
- */
-static BOOL ADVAPI_IsLocalComputer(LPCWSTR ServerName)
-{
-    DWORD dwSize = MAX_COMPUTERNAME_LENGTH + 1;
-    BOOL Result;
-    LPWSTR buf;
-
-    if (!ServerName || !ServerName[0])
-        return TRUE;
-
-    buf = HeapAlloc(GetProcessHeap(), 0, dwSize * sizeof(WCHAR));
-    Result = GetComputerNameW(buf,  &dwSize);
-    if (Result && (ServerName[0] == '\\') && (ServerName[1] == '\\'))
-        ServerName += 2;
-    Result = Result && !lstrcmpW(ServerName, buf);
-    HeapFree(GetProcessHeap(), 0, buf);
-
-    return Result;
-}
-
 /******************************************************************************
  * LsaAddAccountRights [ADVAPI32.@]
  *
diff --git a/dlls/advapi32/security.c b/dlls/advapi32/security.c
index 658fa44..d2a5d81 100644
--- a/dlls/advapi32/security.c
+++ b/dlls/advapi32/security.c
@@ -35,6 +35,7 @@ #include "accctrl.h"
 #include "sddl.h"
 #include "winsvc.h"
 #include "aclapi.h"
+#include "advapi32_misc.h"
 
 #include "wine/debug.h"
 #include "wine/unicode.h"
@@ -239,7 +240,7 @@ static const WCHAR SDDL_INHERITED[]     
 static const WCHAR SDDL_AUDIT_SUCCESS[]      = {'S','A',0};
 static const WCHAR SDDL_AUDIT_FAILURE[]      = {'F','A',0};
 
-static const char * debugstr_sid(PSID sid)
+const char * debugstr_sid(PSID sid)
 {
     int auth = 0;
     SID * psid = (SID *)sid;
@@ -322,7 +323,7 @@ static void GetWorldAccessACL(PACL pACL)
  *
  * Checks whether the server name indicates local machine.
  */
-static BOOL ADVAPI_IsLocalComputer(LPCWSTR ServerName)
+BOOL ADVAPI_IsLocalComputer(LPCWSTR ServerName)
 {
     DWORD dwSize = MAX_COMPUTERNAME_LENGTH + 1;
     BOOL Result;




More information about the wine-cvs mailing list