RtlValidRelativeSecurityDescriptor - NtDoc

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

/**
 * The RtlValidRelativeSecurityDescriptor routine checks the validity of a self-relative security descriptor.
 *
 * \param SecurityDescriptorInput A pointer to the buffer that contains the security descriptor in self-relative format.
 * The buffer must begin with a SECURITY_DESCRIPTOR structure, which is followed by the rest of the security descriptor data.
 * \param SecurityDescriptorLength The size of the SecurityDescriptorInput structure.
 * \param RequiredInformation A SECURITY_INFORMATION value that specifies the information that is required to be contained in the security descriptor.
 * \return RtlValidRelativeSecurityDescriptor returns TRUE if the security descriptor is valid and includes the information that the RequiredInformation parameter specifies. Otherwise, this routine returns FALSE.
 * \see https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-rtlvalidrelativesecuritydescriptor
 */
_Check_return_
NTSYSAPI
BOOLEAN
NTAPI
RtlValidRelativeSecurityDescriptor(
    _In_reads_bytes_(SecurityDescriptorLength) PSECURITY_DESCRIPTOR SecurityDescriptorInput,
    _In_ ULONG SecurityDescriptorLength,
    _In_ SECURITY_INFORMATION RequiredInformation
    );

#endif

View code on GitHub
// wdm.h

NTSYSAPI BOOLEAN RtlValidRelativeSecurityDescriptor(
  [in] PSECURITY_DESCRIPTOR SecurityDescriptorInput,
  [in] ULONG                SecurityDescriptorLength,
  [in] SECURITY_INFORMATION RequiredInformation
);

View the official Windows Driver Kit DDI reference

NtDoc

This function is documented in Windows Driver Kit.

Windows Driver Kit DDI reference (nf-wdm-rtlvalidrelativesecuritydescriptor)

RtlValidRelativeSecurityDescriptor function

Description

The RtlValidRelativeSecurityDescriptor routine checks the validity of a self-relative security descriptor.

Parameters

SecurityDescriptorInput [in]

A pointer to the buffer that contains the security descriptor in self-relative format. The buffer must begin with a SECURITY_DESCRIPTOR structure, which is followed by the rest of the security descriptor data.

SecurityDescriptorLength [in]

The size of the SecurityDescriptorInput structure.

RequiredInformation [in]

A SECURITY_INFORMATION value that specifies the information that is required to be contained in the security descriptor.

Return value

RtlValidRelativeSecurityDescriptor returns TRUE if the security descriptor is valid and includes the information that the RequiredInformation parameter specifies. Otherwise, this routine returns FALSE.

Remarks

To check the validity of a security descriptor in absolute format, use RtlValidSecurityDescriptor instead.

See also

RtlValidSecurityDescriptor

SECURITY_DESCRIPTOR

SECURITY_INFORMATION