advapi32: Make ADVAPI_IsLocalComputer global and remove duplicate copy.

Make debugstr_sid global.
This commit is contained in:
Robert Reif 2006-07-29 08:12:58 -04:00 committed by Alexandre Julliard
parent 6ede65596a
commit 3f000d8c71
3 changed files with 30 additions and 26 deletions

View File

@ -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 */

View File

@ -30,6 +30,7 @@
#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_OBJECT_ATTRIBUTES oa)
}
}
/************************************************************
* 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.@]
*

View File

@ -35,6 +35,7 @@
#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[] = {'I','D',0};
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;