#ifndef _NTRTL_H
/**
* The RtlCopySid routine copies a security identifier (SID) into a caller-supplied buffer.
*
* \param DestinationSidLength The length, in bytes, of the destination buffer.
* \param DestinationSid A pointer to the buffer that receives the copied SID.
* \param SourceSid A pointer to the SID to copy.
* \return NTSTATUS Successful or errant status.
* \sa https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-rtlcopysid
*/
NTSYSAPI
NTSTATUS
NTAPI
RtlCopySid(
_In_ ULONG DestinationSidLength,
_Out_writes_bytes_(DestinationSidLength) PSID DestinationSid,
_In_ PSID SourceSid
);
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 referenceThis function is documented in Windows Driver Kit.
The RtlCopySid routine copies the value of a security identifier (SID) to a buffer.
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.
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. |
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.