RtlConvertSidToUnicodeString 函式 (winternl.h)

[ RtlConvertSidToUnicodeString 函式可用於需求一節中指定的操作系統。 它在後續版本中可能會變更或無法使用。 請改用 ConvertSidToStringSid 函式。]

RtlConvertSidToUnicodeString 函式會將安全標識碼 (SID) 轉換為其 Unicode 字元表示法。 此函式沒有相關聯的匯入連結庫。 您必須使用 LoadLibraryGetProcAddress 函式,動態連結至 Ntdll.dll。

語法

NTSTATUS RtlConvertSidToUnicodeString(
  [out] PUNICODE_STRING UnicodeString,
  [in]  PSID            Sid,
  [in]  BOOLEAN         AllocateDestinationString
);

參數

[out] UnicodeString

安全性標識碼之 Unicode 字元表示的指標。

[in] Sid

表示安全性標識碼之 SID 結構的指標。

[in] AllocateDestinationString

如果為 TRUE,則會代表呼叫端配置 UnicodeString ,而且呼叫端必須負責呼叫 RtlFreeUnicodeString 函式來釋放配置的記憶體。 如果為 FALSE,則呼叫端會負責配置和釋放 UnicodeString

傳回值

傳回值是NTSTATUS程式代碼。 如果函式成功,則會傳回STATUS_SUCCESS (0x00000000L) 的值。

規格需求

需求
最低支援的用戶端 Windows XP [僅限傳統型應用程式]
最低支援的伺服器 Windows Server 2003 [僅限桌面應用程式]
目標平台 Windows
標頭 winternl.h
程式庫 ntdll.lib
Dll ntdll.dll