getSecurityDescriptorOwner 函式 (securitybaseapi.h)

GetSecurityDescriptorOwner 函式會從安全性描述項擷取擁有者資訊。

語法

BOOL GetSecurityDescriptorOwner(
  [in]  PSECURITY_DESCRIPTOR pSecurityDescriptor,
  [out] PSID                 *pOwner,
  [out] LPBOOL               lpbOwnerDefaulted
);

參數

[in] pSecurityDescriptor

函式所擷取其擁有者資訊的SECURITY_DESCRIPTOR結構的指標。

[out] pOwner

安全性標識符指標的指標 (SID) ,可在函式傳回時識別擁有者。 如果安全性描述項不包含擁有者,函式會將 pOwner 指向的指標設定為 NULL ,並忽略其餘的輸出參數 lpbOwnerDefaulted。 如果安全性描述項包含擁有者,函式會將 pOwner 指向的指標設定為安全描述項擁有者 SID 的位址,併為 lpbOwnerDefaulted 所指向的變數提供有效值。

[out] lpbOwnerDefaulted

旗標的指標,設定為函式傳回時SECURITY_DESCRIPTOR_CONTROL結構中 SE_OWNER_DEFAULTED 旗標的值。 如果 pOwner 參數指向的變數中所儲存的值是 NULL,則不會設定任何值。

傳回值

如果函式成功,函式會傳回非零。

如果函式失敗,則會傳回零。 若要取得擴充的錯誤資訊,請呼叫 GetLastError

規格需求

需求
最低支援的用戶端 Windows XP [傳統型應用程式 |UWP 應用程式]
最低支援的伺服器 Windows Server 2003 [傳統型應用程式 |UWP 應用程式]
目標平台 Windows
標頭 securitybaseapi.h (包含 Windows.h)
程式庫 Advapi32.lib
Dll Advapi32.dll

另請參閱

GetSecurityDescriptorControl

GetSecurityDescriptorDacl

GetSecurityDescriptorGroup

GetSecurityDescriptorLength

GetSecurityDescriptorSacl

IsValidSecurityDescriptor

低階 存取控制

低階 存取控制 函式

SECURITY_DESCRIPTOR

SECURITY_DESCRIPTOR_CONTROL

SetSecurityDescriptorOwner