mirror of
https://github.com/reactos/reactos.git
synced 2025-07-03 16:51:23 +00:00
Sync GetNamedSecurityInfoA with Wine.
RtlCreateUnicodeStringFromAsciiz is unwanted since the call to GetNamedSecurityInfoW checks for NULL and in this case sets ERROR_INVALID_PARAMETER. svn path=/trunk/; revision=41216
This commit is contained in:
parent
f3dc5e09e4
commit
70806391db
1 changed files with 14 additions and 17 deletions
|
@ -1874,29 +1874,26 @@ GetNamedSecurityInfoA(LPSTR pObjectName,
|
||||||
PACL *ppSacl,
|
PACL *ppSacl,
|
||||||
PSECURITY_DESCRIPTOR *ppSecurityDescriptor)
|
PSECURITY_DESCRIPTOR *ppSecurityDescriptor)
|
||||||
{
|
{
|
||||||
UNICODE_STRING ObjectName;
|
DWORD len;
|
||||||
NTSTATUS Status;
|
LPWSTR wstr = NULL;
|
||||||
DWORD Ret;
|
DWORD r;
|
||||||
|
|
||||||
Status = RtlCreateUnicodeStringFromAsciiz(&ObjectName,
|
TRACE("%s %d %d %p %p %p %p %p\n", pObjectName, ObjectType, SecurityInfo,
|
||||||
pObjectName);
|
ppsidOwner, ppsidGroup, ppDacl, ppSacl, ppSecurityDescriptor);
|
||||||
if (!NT_SUCCESS(Status))
|
|
||||||
|
if( pObjectName )
|
||||||
{
|
{
|
||||||
return RtlNtStatusToDosError(Status);
|
len = MultiByteToWideChar( CP_ACP, 0, pObjectName, -1, NULL, 0 );
|
||||||
|
wstr = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR));
|
||||||
|
MultiByteToWideChar( CP_ACP, 0, pObjectName, -1, wstr, len );
|
||||||
}
|
}
|
||||||
|
|
||||||
Ret = GetNamedSecurityInfoW(ObjectName.Buffer,
|
r = GetNamedSecurityInfoW( wstr, ObjectType, SecurityInfo, ppsidOwner,
|
||||||
ObjectType,
|
ppsidGroup, ppDacl, ppSacl, ppSecurityDescriptor );
|
||||||
SecurityInfo,
|
|
||||||
ppsidOwner,
|
|
||||||
ppsidGroup,
|
|
||||||
ppDacl,
|
|
||||||
ppSacl,
|
|
||||||
ppSecurityDescriptor);
|
|
||||||
|
|
||||||
RtlFreeUnicodeString(&ObjectName);
|
HeapFree( GetProcessHeap(), 0, wstr );
|
||||||
|
|
||||||
return Ret;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue