seValidSecurityDescriptor 函数 (wdm.h)

SeValidSecurityDescriptor 例程返回给定的安全描述符在结构上是否有效。

语法

BOOLEAN SeValidSecurityDescriptor(
  [in] ULONG                Length,
  [in] PSECURITY_DESCRIPTOR SecurityDescriptor
);

参数

[in] Length

指定给定安全描述符的大小(以字节为单位)。

[in] SecurityDescriptor

指向自相对 SECURITY_DESCRIPTOR的指针,必须在系统空间中的某个位置缓冲。

返回值

如果缓冲的安全描述符在结构上有效,SeValidSecurityDescriptor 将返回 TRUE

注解

SeValidSecurityDescriptor 不强制实施策略。 它只是检查给定的安全描述符数据的格式是否正确。 具体而言,它会检查修订信息、自相对性、所有者、对齐方式,如果可用,SID、组、DACL、ACL 和/或 SACL 不会溢出给定 的 Length。 因此, SeValidSecurityDescriptor 的调用方不能假定返回的 TRUE 意味着给定的安全描述符必须具有有效内容。

如果 SeValidSecurityDescriptor 返回 TRUE,则给定的安全描述符可以传递给另一个内核模式组件,因为它在结构上有效。 否则,传递结构上无效的安全描述符由另一个内核模式组件操作可能会导致未定义的结果,甚至导致系统 bug 检查。

若要验证从用户模式传入的安全描述符,请调用 RtlValidSecurityDescriptor 而不是 SeValidSecurityDescriptor

要求

要求
最低受支持的客户端 在 Windows 2000 和更高版本的 Windows 中可用。
目标平台 通用
标头 wdm.h(包括 Wdm.h、Ntddk.h、Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL PASSIVE_LEVEL
DDI 符合性规则 HwStorPortProhibitedDDI (storport) PowerIrpDDis (wdm)

另请参阅

RtlValidSecurityDescriptor

SECURITY_DESCRIPTOR