mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
[SVCHOST] Fix PSID initialization
CORE-17151
This commit is contained in:
parent
37c63770d7
commit
6859348aea
2 changed files with 17 additions and 8 deletions
|
@ -234,7 +234,7 @@ ScDomainIdToSid (
|
|||
NTSTATUS
|
||||
NTAPI
|
||||
ScAllocateAndInitializeSid (
|
||||
_Out_ PVOID *Sid,
|
||||
_Out_ PSID *Sid,
|
||||
_In_ PSID_IDENTIFIER_AUTHORITY IdentifierAuthority,
|
||||
_In_ ULONG SubAuthorityCount
|
||||
)
|
||||
|
@ -274,13 +274,18 @@ ScCreateWellKnownSids (
|
|||
for (i = 0; i < RTL_NUMBER_OF(SidData); i++)
|
||||
{
|
||||
/* Convert our optimized structure into an actual SID */
|
||||
Status = ScAllocateAndInitializeSid(&SidData[i].Sid,
|
||||
Status = ScAllocateAndInitializeSid(SidData[i].Sid,
|
||||
&SidData[i].Authority,
|
||||
1);
|
||||
if (!NT_SUCCESS(Status)) break;
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DBG_ERR("ScAllocateAndInitializeSid failed for %u\n", i);
|
||||
break;
|
||||
}
|
||||
|
||||
/* Write the correct sub-authority */
|
||||
*RtlSubAuthoritySid(SidData[i].Sid, 0) = SidData[i].SubAuthority;
|
||||
*RtlSubAuthoritySid(*SidData[i].Sid, 0) = SidData[i].SubAuthority;
|
||||
}
|
||||
|
||||
/* Now loop the domain SIDs */
|
||||
|
@ -289,8 +294,12 @@ ScCreateWellKnownSids (
|
|||
/* Convert our optimized structure into an actual SID */
|
||||
Status = ScDomainIdToSid(BuiltinDomainSid,
|
||||
DomainSidData[i].SubAuthority,
|
||||
&DomainSidData[i].Sid);
|
||||
if (!NT_SUCCESS(Status)) break;
|
||||
DomainSidData[i].Sid);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DBG_ERR("ScDomainIdToSid failed for %u\n", i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* If we got to the end, return success */
|
||||
|
|
|
@ -52,7 +52,7 @@ typedef VOID
|
|||
//
|
||||
typedef struct _DOMAIN_SID_DATA
|
||||
{
|
||||
PSID Sid;
|
||||
PSID* Sid;
|
||||
DWORD SubAuthority;
|
||||
} DOMAIN_SID_DATA;
|
||||
|
||||
|
@ -61,7 +61,7 @@ typedef struct _DOMAIN_SID_DATA
|
|||
//
|
||||
typedef struct _SID_DATA
|
||||
{
|
||||
PSID Sid;
|
||||
PSID* Sid;
|
||||
SID_IDENTIFIER_AUTHORITY Authority;
|
||||
DWORD SubAuthority;
|
||||
} SID_DATA;
|
||||
|
|
Loading…
Reference in a new issue