mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 05:22:56 +00:00
[NETAPI32] NetUserGetInfo: Build and return the users SID for level 4 and 23.
This commit is contained in:
parent
98b7ecd280
commit
0425d866bf
3 changed files with 85 additions and 13 deletions
|
@ -215,4 +215,34 @@ BuildSidFromSidAndRid(IN PSID SrcSid,
|
|||
return NERR_Success;
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
CopySidFromSidAndRid(
|
||||
_Out_ PSID DstSid,
|
||||
_In_ PSID SrcSid,
|
||||
_In_ ULONG RelativeId)
|
||||
{
|
||||
UCHAR RidCount;
|
||||
ULONG i;
|
||||
PULONG p, q;
|
||||
|
||||
RidCount = *RtlSubAuthorityCountSid(SrcSid);
|
||||
if (RidCount >= 8)
|
||||
return;
|
||||
|
||||
RtlInitializeSid(DstSid,
|
||||
RtlIdentifierAuthoritySid(SrcSid),
|
||||
RidCount + 1);
|
||||
|
||||
for (i = 0; i < (ULONG)RidCount; i++)
|
||||
{
|
||||
p = RtlSubAuthoritySid(SrcSid, i);
|
||||
q = RtlSubAuthoritySid(DstSid, i);
|
||||
*q = *p;
|
||||
}
|
||||
|
||||
q = RtlSubAuthoritySid(DstSid, (ULONG)RidCount);
|
||||
*q = RelativeId;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue