ホーム › Security.Authorization › GetTrusteeTypeA
GetTrusteeTypeA
関数TRUSTEE構造体からトラスティの種類を取得する。
シグネチャ
// ADVAPI32.dll (ANSI / -A)
#include <windows.h>
TRUSTEE_TYPE GetTrusteeTypeA(
TRUSTEE_A* pTrustee // optional
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pTrustee | TRUSTEE_A* | inoptional |
戻り値の型: TRUSTEE_TYPE
各言語での呼び出し定義
// ADVAPI32.dll (ANSI / -A)
#include <windows.h>
TRUSTEE_TYPE GetTrusteeTypeA(
TRUSTEE_A* pTrustee // optional
);[DllImport("ADVAPI32.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern int GetTrusteeTypeA(
IntPtr pTrustee // TRUSTEE_A* optional
);<DllImport("ADVAPI32.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function GetTrusteeTypeA(
pTrustee As IntPtr ' TRUSTEE_A* optional
) As Integer
End Function' pTrustee : TRUSTEE_A* optional
Declare PtrSafe Function GetTrusteeTypeA 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
GetTrusteeTypeA = ctypes.windll.advapi32.GetTrusteeTypeA
GetTrusteeTypeA.restype = ctypes.c_int
GetTrusteeTypeA.argtypes = [
ctypes.c_void_p, # pTrustee : TRUSTEE_A* optional
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('ADVAPI32.dll')
GetTrusteeTypeA = Fiddle::Function.new(
lib['GetTrusteeTypeA'],
[
Fiddle::TYPE_VOIDP, # pTrustee : TRUSTEE_A* optional
],
Fiddle::TYPE_INT)#[link(name = "advapi32")]
extern "system" {
fn GetTrusteeTypeA(
pTrustee: *mut TRUSTEE_A // TRUSTEE_A* optional
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("ADVAPI32.dll", CharSet = CharSet.Ansi)]
public static extern int GetTrusteeTypeA(IntPtr pTrustee);
"@
$api = Add-Type -MemberDefinition $sig -Name 'ADVAPI32_GetTrusteeTypeA' -Namespace Win32 -PassThru
# $api::GetTrusteeTypeA(pTrustee)#uselib "ADVAPI32.dll"
#func global GetTrusteeTypeA "GetTrusteeTypeA" sptr
; GetTrusteeTypeA varptr(pTrustee) ; 戻り値は stat
; pTrustee : TRUSTEE_A* optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "ADVAPI32.dll" #cfunc global GetTrusteeTypeA "GetTrusteeTypeA" var ; res = GetTrusteeTypeA(pTrustee) ; pTrustee : TRUSTEE_A* optional -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "ADVAPI32.dll" #cfunc global GetTrusteeTypeA "GetTrusteeTypeA" sptr ; res = GetTrusteeTypeA(varptr(pTrustee)) ; pTrustee : TRUSTEE_A* optional -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; TRUSTEE_TYPE GetTrusteeTypeA(TRUSTEE_A* pTrustee) #uselib "ADVAPI32.dll" #cfunc global GetTrusteeTypeA "GetTrusteeTypeA" var ; res = GetTrusteeTypeA(pTrustee) ; pTrustee : TRUSTEE_A* optional -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; TRUSTEE_TYPE GetTrusteeTypeA(TRUSTEE_A* pTrustee) #uselib "ADVAPI32.dll" #cfunc global GetTrusteeTypeA "GetTrusteeTypeA" intptr ; res = GetTrusteeTypeA(varptr(pTrustee)) ; pTrustee : TRUSTEE_A* optional -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
advapi32 = windows.NewLazySystemDLL("ADVAPI32.dll")
procGetTrusteeTypeA = advapi32.NewProc("GetTrusteeTypeA")
)
// pTrustee (TRUSTEE_A* optional)
r1, _, err := procGetTrusteeTypeA.Call(
uintptr(pTrustee),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // TRUSTEE_TYPEfunction GetTrusteeTypeA(
pTrustee: Pointer // TRUSTEE_A* optional
): Integer; stdcall;
external 'ADVAPI32.dll' name 'GetTrusteeTypeA';result := DllCall("ADVAPI32\GetTrusteeTypeA"
, "Ptr", pTrustee ; TRUSTEE_A* optional
, "Int") ; return: TRUSTEE_TYPE●GetTrusteeTypeA(pTrustee) = DLL("ADVAPI32.dll", "int GetTrusteeTypeA(void*)")
# 呼び出し: GetTrusteeTypeA(pTrustee)
# pTrustee : TRUSTEE_A* optional -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。