mirror of
https://github.com/reactos/reactos.git
synced 2025-07-24 17:53:43 +00:00
[ADVAPI32]
* Apply Wine commit e57edfea by Paul Vriens: Skip leading spaces when parsing. * Update the related functions with Wine 1.7.27. CORE-8540 svn path=/trunk/; revision=65007
This commit is contained in:
parent
7a1f0bac68
commit
6d8f72bf65
1 changed files with 69 additions and 52 deletions
|
@ -2335,6 +2335,9 @@ static BYTE ParseAceStringType(LPCWSTR* StringAcl)
|
|||
LPCWSTR szAcl = *StringAcl;
|
||||
const ACEFLAG *lpaf = AceType;
|
||||
|
||||
while (*szAcl == ' ')
|
||||
szAcl++;
|
||||
|
||||
while (lpaf->wstr &&
|
||||
(len = strlenW(lpaf->wstr)) &&
|
||||
strncmpW(lpaf->wstr, szAcl, len))
|
||||
|
@ -2343,7 +2346,7 @@ static BYTE ParseAceStringType(LPCWSTR* StringAcl)
|
|||
if (!lpaf->wstr)
|
||||
return 0;
|
||||
|
||||
*StringAcl += len;
|
||||
*StringAcl = szAcl + len;
|
||||
return lpaf->value;
|
||||
}
|
||||
|
||||
|
@ -2369,6 +2372,9 @@ static BYTE ParseAceStringFlags(LPCWSTR* StringAcl)
|
|||
BYTE flags = 0;
|
||||
LPCWSTR szAcl = *StringAcl;
|
||||
|
||||
while (*szAcl == ' ')
|
||||
szAcl++;
|
||||
|
||||
while (*szAcl != ';')
|
||||
{
|
||||
const ACEFLAG *lpaf = AceFlags;
|
||||
|
@ -2399,6 +2405,9 @@ static DWORD ParseAceStringRights(LPCWSTR* StringAcl)
|
|||
DWORD rights = 0;
|
||||
LPCWSTR szAcl = *StringAcl;
|
||||
|
||||
while (*szAcl == ' ')
|
||||
szAcl++;
|
||||
|
||||
if ((*szAcl == '0') && (*(szAcl + 1) == 'x'))
|
||||
{
|
||||
LPCWSTR p = szAcl;
|
||||
|
@ -2445,11 +2454,8 @@ static DWORD ParseAceStringRights(LPCWSTR* StringAcl)
|
|||
*
|
||||
* dacl_flags(string_ace1)(string_ace2)... (string_acen)
|
||||
*/
|
||||
static BOOL
|
||||
ParseStringAclToAcl(LPCWSTR StringAcl,
|
||||
LPDWORD lpdwFlags,
|
||||
PACL pAcl,
|
||||
LPDWORD cBytes)
|
||||
static BOOL ParseStringAclToAcl(LPCWSTR StringAcl, LPDWORD lpdwFlags,
|
||||
PACL pAcl, LPDWORD cBytes)
|
||||
{
|
||||
DWORD val;
|
||||
DWORD sidlen;
|
||||
|
@ -2457,6 +2463,7 @@ ParseStringAclToAcl(LPCWSTR StringAcl,
|
|||
DWORD acesize = 0;
|
||||
DWORD acecount = 0;
|
||||
PACCESS_ALLOWED_ACE pAce = NULL; /* pointer to current ACE */
|
||||
DWORD error = ERROR_INVALID_ACL;
|
||||
|
||||
TRACE("%s\n", debugstr_w(StringAcl));
|
||||
|
||||
|
@ -2479,7 +2486,10 @@ ParseStringAclToAcl(LPCWSTR StringAcl,
|
|||
if (pAce)
|
||||
pAce->Header.AceType = (BYTE) val;
|
||||
if (*StringAcl != ';')
|
||||
{
|
||||
error = RPC_S_INVALID_STRING_UUID;
|
||||
goto lerr;
|
||||
}
|
||||
StringAcl++;
|
||||
|
||||
/* Parse ACE flags */
|
||||
|
@ -2499,6 +2509,8 @@ ParseStringAclToAcl(LPCWSTR StringAcl,
|
|||
StringAcl++;
|
||||
|
||||
/* Parse ACE object guid */
|
||||
while (*StringAcl == ' ')
|
||||
StringAcl++;
|
||||
if (*StringAcl != ';')
|
||||
{
|
||||
FIXME("Support for *_OBJECT_ACE_TYPE not implemented\n");
|
||||
|
@ -2507,6 +2519,8 @@ ParseStringAclToAcl(LPCWSTR StringAcl,
|
|||
StringAcl++;
|
||||
|
||||
/* Parse ACE inherit object guid */
|
||||
while (*StringAcl == ' ')
|
||||
StringAcl++;
|
||||
if (*StringAcl != ';')
|
||||
{
|
||||
FIXME("Support for *_OBJECT_ACE_TYPE not implemented\n");
|
||||
|
@ -2554,7 +2568,7 @@ ParseStringAclToAcl(LPCWSTR StringAcl,
|
|||
return TRUE;
|
||||
|
||||
lerr:
|
||||
SetLastError(ERROR_INVALID_ACL);
|
||||
SetLastError(error);
|
||||
WARN("Invalid ACE string format\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -2563,8 +2577,8 @@ lerr:
|
|||
/******************************************************************************
|
||||
* ParseStringSecurityDescriptorToSecurityDescriptor
|
||||
*/
|
||||
static BOOL
|
||||
ParseStringSecurityDescriptorToSecurityDescriptor(LPCWSTR StringSecurityDescriptor,
|
||||
static BOOL ParseStringSecurityDescriptorToSecurityDescriptor(
|
||||
LPCWSTR StringSecurityDescriptor,
|
||||
SECURITY_DESCRIPTOR_RELATIVE* SecurityDescriptor,
|
||||
LPDWORD cBytes)
|
||||
{
|
||||
|
@ -2580,6 +2594,9 @@ ParseStringSecurityDescriptorToSecurityDescriptor(LPCWSTR StringSecurityDescript
|
|||
if (SecurityDescriptor)
|
||||
lpNext = (LPBYTE)(SecurityDescriptor + 1);
|
||||
|
||||
while (*StringSecurityDescriptor == ' ')
|
||||
StringSecurityDescriptor++;
|
||||
|
||||
while (*StringSecurityDescriptor)
|
||||
{
|
||||
toktype = *StringSecurityDescriptor;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue