ホーム › System.Rpc › RpcBindingInqAuthClientA
RpcBindingInqAuthClientA
関数クライアント呼び出しの認証情報を取得する(ANSI版)。
シグネチャ
// RPCRT4.dll (ANSI / -A)
#include <windows.h>
RPC_STATUS RpcBindingInqAuthClientA(
void* ClientBinding, // optional
void** Privs,
LPSTR* ServerPrincName, // optional
DWORD* AuthnLevel, // optional
DWORD* AuthnSvc, // optional
DWORD* AuthzSvc // optional
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| ClientBinding | void* | inoptional |
| Privs | void** | out |
| ServerPrincName | LPSTR* | outoptional |
| AuthnLevel | DWORD* | outoptional |
| AuthnSvc | DWORD* | outoptional |
| AuthzSvc | DWORD* | outoptional |
戻り値の型: RPC_STATUS
各言語での呼び出し定義
// RPCRT4.dll (ANSI / -A)
#include <windows.h>
RPC_STATUS RpcBindingInqAuthClientA(
void* ClientBinding, // optional
void** Privs,
LPSTR* ServerPrincName, // optional
DWORD* AuthnLevel, // optional
DWORD* AuthnSvc, // optional
DWORD* AuthzSvc // optional
);[DllImport("RPCRT4.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern int RpcBindingInqAuthClientA(
IntPtr ClientBinding, // void* optional
IntPtr Privs, // void** out
IntPtr ServerPrincName, // LPSTR* optional, out
IntPtr AuthnLevel, // DWORD* optional, out
IntPtr AuthnSvc, // DWORD* optional, out
IntPtr AuthzSvc // DWORD* optional, out
);<DllImport("RPCRT4.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function RpcBindingInqAuthClientA(
ClientBinding As IntPtr, ' void* optional
Privs As IntPtr, ' void** out
ServerPrincName As IntPtr, ' LPSTR* optional, out
AuthnLevel As IntPtr, ' DWORD* optional, out
AuthnSvc As IntPtr, ' DWORD* optional, out
AuthzSvc As IntPtr ' DWORD* optional, out
) As Integer
End Function' ClientBinding : void* optional
' Privs : void** out
' ServerPrincName : LPSTR* optional, out
' AuthnLevel : DWORD* optional, out
' AuthnSvc : DWORD* optional, out
' AuthzSvc : DWORD* optional, out
Declare PtrSafe Function RpcBindingInqAuthClientA Lib "rpcrt4" ( _
ByVal ClientBinding As LongPtr, _
ByVal Privs As LongPtr, _
ByVal ServerPrincName As LongPtr, _
ByVal AuthnLevel As LongPtr, _
ByVal AuthnSvc As LongPtr, _
ByVal AuthzSvc As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
RpcBindingInqAuthClientA = ctypes.windll.rpcrt4.RpcBindingInqAuthClientA
RpcBindingInqAuthClientA.restype = ctypes.c_int
RpcBindingInqAuthClientA.argtypes = [
ctypes.POINTER(None), # ClientBinding : void* optional
ctypes.c_void_p, # Privs : void** out
ctypes.c_void_p, # ServerPrincName : LPSTR* optional, out
ctypes.POINTER(wintypes.DWORD), # AuthnLevel : DWORD* optional, out
ctypes.POINTER(wintypes.DWORD), # AuthnSvc : DWORD* optional, out
ctypes.POINTER(wintypes.DWORD), # AuthzSvc : DWORD* optional, out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('RPCRT4.dll')
RpcBindingInqAuthClientA = Fiddle::Function.new(
lib['RpcBindingInqAuthClientA'],
[
Fiddle::TYPE_VOIDP, # ClientBinding : void* optional
Fiddle::TYPE_VOIDP, # Privs : void** out
Fiddle::TYPE_VOIDP, # ServerPrincName : LPSTR* optional, out
Fiddle::TYPE_VOIDP, # AuthnLevel : DWORD* optional, out
Fiddle::TYPE_VOIDP, # AuthnSvc : DWORD* optional, out
Fiddle::TYPE_VOIDP, # AuthzSvc : DWORD* optional, out
],
Fiddle::TYPE_INT)#[link(name = "rpcrt4")]
extern "system" {
fn RpcBindingInqAuthClientA(
ClientBinding: *mut (), // void* optional
Privs: *mut *mut (), // void** out
ServerPrincName: *mut *mut u8, // LPSTR* optional, out
AuthnLevel: *mut u32, // DWORD* optional, out
AuthnSvc: *mut u32, // DWORD* optional, out
AuthzSvc: *mut u32 // DWORD* optional, out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("RPCRT4.dll", CharSet = CharSet.Ansi)]
public static extern int RpcBindingInqAuthClientA(IntPtr ClientBinding, IntPtr Privs, IntPtr ServerPrincName, IntPtr AuthnLevel, IntPtr AuthnSvc, IntPtr AuthzSvc);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RPCRT4_RpcBindingInqAuthClientA' -Namespace Win32 -PassThru
# $api::RpcBindingInqAuthClientA(ClientBinding, Privs, ServerPrincName, AuthnLevel, AuthnSvc, AuthzSvc)#uselib "RPCRT4.dll"
#func global RpcBindingInqAuthClientA "RpcBindingInqAuthClientA" sptr, sptr, sptr, sptr, sptr, sptr
; RpcBindingInqAuthClientA ClientBinding, Privs, varptr(ServerPrincName), varptr(AuthnLevel), varptr(AuthnSvc), varptr(AuthzSvc) ; 戻り値は stat
; ClientBinding : void* optional -> "sptr"
; Privs : void** out -> "sptr"
; ServerPrincName : LPSTR* optional, out -> "sptr"
; AuthnLevel : DWORD* optional, out -> "sptr"
; AuthnSvc : DWORD* optional, out -> "sptr"
; AuthzSvc : DWORD* optional, out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "RPCRT4.dll" #cfunc global RpcBindingInqAuthClientA "RpcBindingInqAuthClientA" sptr, sptr, var, var, var, var ; res = RpcBindingInqAuthClientA(ClientBinding, Privs, ServerPrincName, AuthnLevel, AuthnSvc, AuthzSvc) ; ClientBinding : void* optional -> "sptr" ; Privs : void** out -> "sptr" ; ServerPrincName : LPSTR* optional, out -> "var" ; AuthnLevel : DWORD* optional, out -> "var" ; AuthnSvc : DWORD* optional, out -> "var" ; AuthzSvc : DWORD* optional, out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "RPCRT4.dll" #cfunc global RpcBindingInqAuthClientA "RpcBindingInqAuthClientA" sptr, sptr, sptr, sptr, sptr, sptr ; res = RpcBindingInqAuthClientA(ClientBinding, Privs, varptr(ServerPrincName), varptr(AuthnLevel), varptr(AuthnSvc), varptr(AuthzSvc)) ; ClientBinding : void* optional -> "sptr" ; Privs : void** out -> "sptr" ; ServerPrincName : LPSTR* optional, out -> "sptr" ; AuthnLevel : DWORD* optional, out -> "sptr" ; AuthnSvc : DWORD* optional, out -> "sptr" ; AuthzSvc : DWORD* optional, out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; RPC_STATUS RpcBindingInqAuthClientA(void* ClientBinding, void** Privs, LPSTR* ServerPrincName, DWORD* AuthnLevel, DWORD* AuthnSvc, DWORD* AuthzSvc) #uselib "RPCRT4.dll" #cfunc global RpcBindingInqAuthClientA "RpcBindingInqAuthClientA" intptr, intptr, var, var, var, var ; res = RpcBindingInqAuthClientA(ClientBinding, Privs, ServerPrincName, AuthnLevel, AuthnSvc, AuthzSvc) ; ClientBinding : void* optional -> "intptr" ; Privs : void** out -> "intptr" ; ServerPrincName : LPSTR* optional, out -> "var" ; AuthnLevel : DWORD* optional, out -> "var" ; AuthnSvc : DWORD* optional, out -> "var" ; AuthzSvc : DWORD* optional, out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; RPC_STATUS RpcBindingInqAuthClientA(void* ClientBinding, void** Privs, LPSTR* ServerPrincName, DWORD* AuthnLevel, DWORD* AuthnSvc, DWORD* AuthzSvc) #uselib "RPCRT4.dll" #cfunc global RpcBindingInqAuthClientA "RpcBindingInqAuthClientA" intptr, intptr, intptr, intptr, intptr, intptr ; res = RpcBindingInqAuthClientA(ClientBinding, Privs, varptr(ServerPrincName), varptr(AuthnLevel), varptr(AuthnSvc), varptr(AuthzSvc)) ; ClientBinding : void* optional -> "intptr" ; Privs : void** out -> "intptr" ; ServerPrincName : LPSTR* optional, out -> "intptr" ; AuthnLevel : DWORD* optional, out -> "intptr" ; AuthnSvc : DWORD* optional, out -> "intptr" ; AuthzSvc : DWORD* optional, out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
rpcrt4 = windows.NewLazySystemDLL("RPCRT4.dll")
procRpcBindingInqAuthClientA = rpcrt4.NewProc("RpcBindingInqAuthClientA")
)
// ClientBinding (void* optional), Privs (void** out), ServerPrincName (LPSTR* optional, out), AuthnLevel (DWORD* optional, out), AuthnSvc (DWORD* optional, out), AuthzSvc (DWORD* optional, out)
r1, _, err := procRpcBindingInqAuthClientA.Call(
uintptr(ClientBinding),
uintptr(Privs),
uintptr(ServerPrincName),
uintptr(AuthnLevel),
uintptr(AuthnSvc),
uintptr(AuthzSvc),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // RPC_STATUSfunction RpcBindingInqAuthClientA(
ClientBinding: Pointer; // void* optional
Privs: Pointer; // void** out
ServerPrincName: PPAnsiChar; // LPSTR* optional, out
AuthnLevel: Pointer; // DWORD* optional, out
AuthnSvc: Pointer; // DWORD* optional, out
AuthzSvc: Pointer // DWORD* optional, out
): Integer; stdcall;
external 'RPCRT4.dll' name 'RpcBindingInqAuthClientA';result := DllCall("RPCRT4\RpcBindingInqAuthClientA"
, "Ptr", ClientBinding ; void* optional
, "Ptr", Privs ; void** out
, "Ptr", ServerPrincName ; LPSTR* optional, out
, "Ptr", AuthnLevel ; DWORD* optional, out
, "Ptr", AuthnSvc ; DWORD* optional, out
, "Ptr", AuthzSvc ; DWORD* optional, out
, "Int") ; return: RPC_STATUS●RpcBindingInqAuthClientA(ClientBinding, Privs, ServerPrincName, AuthnLevel, AuthnSvc, AuthzSvc) = DLL("RPCRT4.dll", "int RpcBindingInqAuthClientA(void*, void*, void*, void*, void*, void*)")
# 呼び出し: RpcBindingInqAuthClientA(ClientBinding, Privs, ServerPrincName, AuthnLevel, AuthnSvc, AuthzSvc)
# ClientBinding : void* optional -> "void*"
# Privs : void** out -> "void*"
# ServerPrincName : LPSTR* optional, out -> "void*"
# AuthnLevel : DWORD* optional, out -> "void*"
# AuthnSvc : DWORD* optional, out -> "void*"
# AuthzSvc : DWORD* optional, out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。