Replace incomplete and broken implementations of ConvertStringSecurityDescriptorToSecurityDescriptorW and ConvertStringSidToSidW by new ones

svn path=/trunk/; revision=24490
This commit is contained in:
Hervé Poussineau 2006-10-11 22:14:05 +00:00
parent dc1d41df49
commit 47ef13cf4a
4 changed files with 718 additions and 589 deletions

View file

@ -7,6 +7,8 @@
<define name="WINVER">0x600</define>
<define name="_WIN32_IE">0x0500</define>
<define name="_WIN32_WINNT">0x0600</define>
<define name="UNICODE"></define>
<define name="_UNICODE"></define>
<library>scm_client</library>
<library>lsa_client</library>
<library>ntdll</library>

View file

@ -536,7 +536,7 @@ GetInheritanceSourceA (
PACL pAcl,
PFN_OBJECT_MGR_FUNCTS pfnArray OPTIONAL,
PGENERIC_MAPPING pGenericMapping,
PINHERITED_FROM pInheritArray
PINHERITED_FROMA pInheritArray
)
{
/* That's all this function does, at least up to w2k3... Even MS was too
@ -609,14 +609,14 @@ InternalTrusteeAToW(IN PTRUSTEE_A pTrusteeA,
//ASSERT(sizeof(TRUSTEE_W) == sizeof(TRUSTEE_A));
TrusteeForm = GetTrusteeForm(pTrusteeA);
TrusteeForm = GetTrusteeFormA(pTrusteeA);
switch (TrusteeForm)
{
case TRUSTEE_IS_NAME:
{
/* directly copy the array, this works as the size of the EXPLICIT_ACCESS_A
structure matches the size of the EXPLICIT_ACCESS_W version */
lpStr = GetTrusteeName(pTrusteeA);
lpStr = GetTrusteeNameA(pTrusteeA);
if (lpStr != NULL)
BufferSize = strlen(lpStr) + 1;
@ -800,7 +800,7 @@ InternalExplicitAccessAToW(IN ULONG cCountOfExplicitEntries,
Size = cCountOfExplicitEntries * sizeof(EXPLICIT_ACCESS_W);
for (i = 0; i != cCountOfExplicitEntries; i++)
{
TrusteeForm = GetTrusteeForm(&pListOfExplicitEntriesA[i].Trustee);
TrusteeForm = GetTrusteeFormA(&pListOfExplicitEntriesA[i].Trustee);
switch (TrusteeForm)
{
@ -852,7 +852,7 @@ InternalExplicitAccessAToW(IN ULONG cCountOfExplicitEntries,
peaw[i].grfInheritance = pListOfExplicitEntriesA[i].grfInheritance;
/* convert or copy the TRUSTEE structure */
TrusteeForm = GetTrusteeForm(&pListOfExplicitEntriesA[i].Trustee);
TrusteeForm = GetTrusteeFormA(&pListOfExplicitEntriesA[i].Trustee);
switch (TrusteeForm)
{
case TRUSTEE_IS_NAME:

View file

@ -916,7 +916,7 @@ LookupAccountSidW (
{
*pdwAccountName = dwSrcLen;
RtlCopyMemory ( pAccountName, TranslatedName->Name.Buffer, TranslatedName->Name.Length );
pAccountName[TranslatedName->Name.Length / sizeof(WCHAR)] = L'\0';
pAccountName[TranslatedName->Name.Length / sizeof(WCHAR)] = L'\0';
}
if ( peUse )
*peUse = TranslatedName->Use;
@ -936,7 +936,7 @@ LookupAccountSidW (
{
*pdwDomainName = dwSrcLen;
RtlCopyMemory ( pDomainName, ReferencedDomain->Domains[0].Name.Buffer, ReferencedDomain->Domains[0].Name.Length );
pDomainName[ReferencedDomain->Domains[0].Name.Length / sizeof(WCHAR)] = L'\0';
pDomainName[ReferencedDomain->Domains[0].Name.Length / sizeof(WCHAR)] = L'\0';
}
}
}
@ -1960,7 +1960,7 @@ InternalfnProgressW(LPWSTR pObjectName,
NULL,
NULL);
pifnProgressData->fnProgress(pObjectNameA,
pifnProgressData->fnProgress((LPWSTR)pObjectNameA, /* FIXME: wrong cast!! */
Status,
pInvokeSetting,
pifnProgressData->Args,

File diff suppressed because it is too large Load diff