Win32 API 日本語リファレンス
ホームSecurity.Authorization › GetTrusteeFormA

GetTrusteeFormA

関数
TRUSTEE構造体のトラスティ識別形式を取得する。
DLLADVAPI32.dll文字セットANSI (-A)呼出規約winapi対応OSWindows XP 以降

シグネチャ

// ADVAPI32.dll  (ANSI / -A)
#include <windows.h>

TRUSTEE_FORM GetTrusteeFormA(
    TRUSTEE_A* pTrustee
);

パラメーター

名前方向
pTrusteeTRUSTEE_A*in

戻り値の型: TRUSTEE_FORM

各言語での呼び出し定義

// ADVAPI32.dll  (ANSI / -A)
#include <windows.h>

TRUSTEE_FORM GetTrusteeFormA(
    TRUSTEE_A* pTrustee
);
[DllImport("ADVAPI32.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern int GetTrusteeFormA(
    IntPtr pTrustee   // TRUSTEE_A*
);
<DllImport("ADVAPI32.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function GetTrusteeFormA(
    pTrustee As IntPtr   ' TRUSTEE_A*
) As Integer
End Function
' pTrustee : TRUSTEE_A*
Declare PtrSafe Function GetTrusteeFormA Lib "advapi32" ( _
    ByVal pTrustee As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

GetTrusteeFormA = ctypes.windll.advapi32.GetTrusteeFormA
GetTrusteeFormA.restype = ctypes.c_int
GetTrusteeFormA.argtypes = [
    ctypes.c_void_p,  # pTrustee : TRUSTEE_A*
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('ADVAPI32.dll')
GetTrusteeFormA = Fiddle::Function.new(
  lib['GetTrusteeFormA'],
  [
    Fiddle::TYPE_VOIDP,  # pTrustee : TRUSTEE_A*
  ],
  Fiddle::TYPE_INT)
#[link(name = "advapi32")]
extern "system" {
    fn GetTrusteeFormA(
        pTrustee: *mut TRUSTEE_A  // TRUSTEE_A*
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("ADVAPI32.dll", CharSet = CharSet.Ansi)]
public static extern int GetTrusteeFormA(IntPtr pTrustee);
"@
$api = Add-Type -MemberDefinition $sig -Name 'ADVAPI32_GetTrusteeFormA' -Namespace Win32 -PassThru
# $api::GetTrusteeFormA(pTrustee)
#uselib "ADVAPI32.dll"
#func global GetTrusteeFormA "GetTrusteeFormA" sptr
; GetTrusteeFormA varptr(pTrustee)   ; 戻り値は stat
; pTrustee : TRUSTEE_A* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "ADVAPI32.dll"
#cfunc global GetTrusteeFormA "GetTrusteeFormA" var
; res = GetTrusteeFormA(pTrustee)
; pTrustee : TRUSTEE_A* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; TRUSTEE_FORM GetTrusteeFormA(TRUSTEE_A* pTrustee)
#uselib "ADVAPI32.dll"
#cfunc global GetTrusteeFormA "GetTrusteeFormA" var
; res = GetTrusteeFormA(pTrustee)
; pTrustee : TRUSTEE_A* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	advapi32 = windows.NewLazySystemDLL("ADVAPI32.dll")
	procGetTrusteeFormA = advapi32.NewProc("GetTrusteeFormA")
)

// pTrustee (TRUSTEE_A*)
r1, _, err := procGetTrusteeFormA.Call(
	uintptr(pTrustee),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // TRUSTEE_FORM
function GetTrusteeFormA(
  pTrustee: Pointer   // TRUSTEE_A*
): Integer; stdcall;
  external 'ADVAPI32.dll' name 'GetTrusteeFormA';
result := DllCall("ADVAPI32\GetTrusteeFormA"
    , "Ptr", pTrustee   ; TRUSTEE_A*
    , "Int")   ; return: TRUSTEE_FORM
●GetTrusteeFormA(pTrustee) = DLL("ADVAPI32.dll", "int GetTrusteeFormA(void*)")
# 呼び出し: GetTrusteeFormA(pTrustee)
# pTrustee : TRUSTEE_A* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。