RtlSetOwnerSecurityDescriptor 函式 (ntifs.h)

RtlSetOwnerSecurityDescriptor 例程會設定絕對格式安全性描述元的擁有者資訊。 它會取代安全性描述元中已存在的任何擁有者資訊。

語法

NTSYSAPI NTSTATUS RtlSetOwnerSecurityDescriptor(
  [in, out]      PSECURITY_DESCRIPTOR SecurityDescriptor,
  [in, optional] PSID                 Owner,
  [in, optional] BOOLEAN              OwnerDefaulted
);

參數

[in, out] SecurityDescriptor

要設定其擁有者之SECURITY_DESCRIPTOR結構的指標。 RtlSetOwnerSecurityDescriptor 會將任何現有的擁有者取代為新的擁有者。

[in, optional] Owner

安全性標識符的指標 (SID) 結構,供安全性描述項的新主要擁有者使用。 這個指標不是 SID 結構本身,會複製到安全性描述元中。 如果此參數為 NULL,RtlSetOwnerSecurityDescriptor 會清除安全性描述項的擁有者資訊。 這會將安全性描述符標示為沒有擁有者。

[in, optional] OwnerDefaulted

如果擁有者資訊衍生自默認機制,請將 設定為 TRUE 。 如果此值為 TRUE,則為預設資訊。 RtlSetOwnerSecurityDescriptor 會在安全性描述項的 [SECURITY_DESCRIPTOR_CONTROL] 字段中設定SE_OWNER_DEFAULTED旗標。 如果此參數為 FALSE,則會清除SE_OWNER_DEFAULTED旗標。

傳回值

RtlSetOwnerSecurityDescriptor 可以傳回下列其中一個狀態代碼:

傳回碼 Description
STATUS_SUCCESS
擁有者已成功設定或重設。
STATUS_UNKNOWN_REVISION
這個例程無法辨識指定的安全性描述元版本。
STATUS_INVALID_SECURITY_DESCR
指定的安全性描述元不是有效的絕對安全性描述元。

備註

如需安全性和訪問控制的詳細資訊,請參閱 適用於驅動程序開發人員的 Windows 安全性模型 ,以及 Windows SDK 中有關這些主題的檔。

規格需求

需求
目標平台 Universal
標頭 ntifs.h (包含 Ntifs.h)
程式庫 NtosKrnl.lib
Dll NtosKrnl.exe (核心模式) ;Ntdll.dll (使用者模式)
IRQL < DISPATCH_LEVEL

另請參閱

RtlCreateSecurityDescriptor

RtlCreateSecurityDescriptorRelative

RtlLengthSecurityDescriptor

RtlSetDaclSecurityDescriptor

RtlValidSecurityDescriptor

SECURITY_DESCRIPTOR

SECURITY_DESCRIPTOR_CONTROL

SID

SeAssignSecurity