RtlCopySid - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTRTL_H

NTSYSAPI
NTSTATUS
NTAPI
RtlCopySid(
    _In_ ULONG DestinationSidLength,
    _Out_writes_bytes_(DestinationSidLength) PSID DestinationSid,
    _In_ PSID SourceSid
    );

#endif

View code on GitHub
// ntifs.h

NTSYSAPI NTSTATUS RtlCopySid(
  [in] ULONG DestinationSidLength,
  [in] PSID  DestinationSid,
  [in] PSID  SourceSid
);

View the official Windows Driver Kit DDI reference

NtDoc

This function is documented in Windows Driver Kit.

Windows Driver Kit DDI reference (nf-ntifs-rtlcopysid)

RtlCopySid function

Description

The RtlCopySid routine copies the value of a security identifier (SID) to a buffer.

Parameters

DestinationSidLength [in]

Length, in bytes, of the buffer to receive the copy of the SID.

DestinationSid [in]

Pointer to a caller-allocated buffer to receive a copy of the source SID structure. The buffer must be at least sizeof(SID),

SourceSid [in]

Pointer to the source SID structure to be copied.

Return value

RtlCopySid returns STATUS_SUCCESS if the SID was successfully copied. Otherwise, it returns an NTSTATUS value such as one of the following:

Return code Description
STATUS_BUFFER_TOO_SMALL The DestinationSid buffer was not large enough to receive a copy of the SID.

Remarks

For more information about security and access control, see Windows security model for driver developers and the documentation on these topics in the Windows SDK.

See also

RtlEqualPrefixSid

RtlEqualSid

RtlLengthSid

RtlValidSid

SID