RtlSetGroupSecurityDescriptor 函式 (ntifs.h)

RtlSetGroupSecurityDescriptor 例程會設定絕對格式安全性描述元的主要群組資訊。 它會取代安全性描述元中已存在的任何主要群組資訊。

語法

NTSYSAPI NTSTATUS RtlSetGroupSecurityDescriptor(
  [in, out]      PSECURITY_DESCRIPTOR SecurityDescriptor,
  [in, optional] PSID                 Group,
  [in, optional] BOOLEAN              GroupDefaulted
);

參數

[in, out] SecurityDescriptor

要設定主要群組 之SECURITY_DESCRIPTOR 結構的指標。 RtlSetGroupSecurityDescriptor 會將任何現有的主要群組取代為新的主要群組。

[in, optional] Group

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

[in, optional] GroupDefaulted

如果主要群組資訊衍生自默認機制,請將這個布爾值變數設定為 TRUE 。 如果此參數為 TRUE,RtlSetGroupSecurityDescriptor 會在安全性描述元的 [SECURITY_DESCRIPTOR_CONTROL] 字段中設定SE_GROUP_DEFAULTED旗標。 如果此參數為 FALSE,RtlSetGroupSecurityDescriptor 會清除SE_GROUP_DEFAULTED旗標。

傳回值

如果主要群組已成功設定或重設,RtlSetGroupSecurityDescriptor 會傳回STATUS_SUCCESS。 否則,它會傳回適當的NTSTATUS值,例如下列其中一個:

傳回碼 Description
STATUS_INVALID_SECURITY_DESCR
指定的安全性描述元不是有效的絕對安全性描述元。 STATUS_INVALID_SECURITY_DESCR是錯誤碼。
STATUS_UNKNOWN_REVISION
這個例程無法辨識指定的安全性描述元修訂。 STATUS_UNKNOWN_REVISION是錯誤碼。

備註

若要擷取安全性描述元的主要群組資訊,請使用 RtlGetGroupSecurityDescriptor

若要設定安全性描述元的擁有者資訊,請使用 RtlSetOwnerSecurityDescriptor

如需安全性和訪問控制的詳細資訊,請參閱 Microsoft Windows SDK 檔。

規格需求

需求
最低支援的用戶端 Windows Server 2003 SP1
目標平台 Universal
標頭 ntifs.h (包含 Ntifs.h)
程式庫 NtosKrnl.lib
Dll NtosKrnl.exe (核心模式) ;Ntdll.dll (使用者模式)
IRQL <= APC_LEVEL

另請參閱

RtlGetGroupSecurityDescriptor

RtlSetOwnerSecurityDescriptor

SECURITY_DESCRIPTOR

SECURITY_DESCRIPTOR_CONTROL

SID