RtlCopySid

NTSTATUS __stdcall RtlCopySid(ULONG DestinationSidLength, PSID DestinationSid, PSID SourceSid){
  ULONG v3; 
  v3 = 4 * *((unsigned __int8 *)SourceSid + 1) + 8;
  if( v3 > DestinationSidLength )
    return -1073741789;
  memmove((UINT8 *)DestinationSid, (UINT8 *)SourceSid, v3);
  return 0;
}

Referenced by:

LocalGetAclForString
MiLoadHotPatchForUserSid
MiQueryLoadedPatches
NtQueryInformationToken
PspAssignProcessQuotaBlock
RtlAddAccessFilterAce
RtlAddProcessTrustLabelAce
RtlAddResourceAttributeAce
RtlpAddKnownObjectAce
SddlAddAccessFilterAce
SddlAddMandatoryAce
SddlAddProcessTrustLabelAce
SddlAddScopedPolicyIDAce
SeAuditProcessCreation
SeConvertStringSidToSid
SeQueryInformationToken
SeQueryUserSidToken
SepAdjustGroups
SepAllocateAndInitializeCachedHandleEntry
SepCreateSidValuesBlock
SepCreateTokenEx
SepDuplicateSid
SepGetLowBoxNumberEntry
SepGetSidValuesDump
SepInsertOrReferenceSharedSidEntries
SepSetTokenPackage