ホーム › System.Rpc › RpcBindingInqAuthInfoExW
RpcBindingInqAuthInfoExW
関数RPCバインディングに設定された認証情報とセキュリティQOSを問い合わせる(Unicode版)。
シグネチャ
// RPCRT4.dll (Unicode / -W)
#include <windows.h>
RPC_STATUS RpcBindingInqAuthInfoExW(
void* Binding,
LPWSTR* ServerPrincName, // optional
DWORD* AuthnLevel, // optional
DWORD* AuthnSvc, // optional
void** AuthIdentity, // optional
DWORD* AuthzSvc, // optional
DWORD RpcQosVersion,
RPC_SECURITY_QOS* SecurityQOS // optional
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| Binding | void* | in |
| ServerPrincName | LPWSTR* | outoptional |
| AuthnLevel | DWORD* | outoptional |
| AuthnSvc | DWORD* | outoptional |
| AuthIdentity | void** | outoptional |
| AuthzSvc | DWORD* | outoptional |
| RpcQosVersion | DWORD | in |
| SecurityQOS | RPC_SECURITY_QOS* | outoptional |
戻り値の型: RPC_STATUS
各言語での呼び出し定義
// RPCRT4.dll (Unicode / -W)
#include <windows.h>
RPC_STATUS RpcBindingInqAuthInfoExW(
void* Binding,
LPWSTR* ServerPrincName, // optional
DWORD* AuthnLevel, // optional
DWORD* AuthnSvc, // optional
void** AuthIdentity, // optional
DWORD* AuthzSvc, // optional
DWORD RpcQosVersion,
RPC_SECURITY_QOS* SecurityQOS // optional
);[DllImport("RPCRT4.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern int RpcBindingInqAuthInfoExW(
IntPtr Binding, // void*
IntPtr ServerPrincName, // LPWSTR* optional, out
IntPtr AuthnLevel, // DWORD* optional, out
IntPtr AuthnSvc, // DWORD* optional, out
IntPtr AuthIdentity, // void** optional, out
IntPtr AuthzSvc, // DWORD* optional, out
uint RpcQosVersion, // DWORD
IntPtr SecurityQOS // RPC_SECURITY_QOS* optional, out
);<DllImport("RPCRT4.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True)>
Public Shared Function RpcBindingInqAuthInfoExW(
Binding As IntPtr, ' void*
ServerPrincName As IntPtr, ' LPWSTR* optional, out
AuthnLevel As IntPtr, ' DWORD* optional, out
AuthnSvc As IntPtr, ' DWORD* optional, out
AuthIdentity As IntPtr, ' void** optional, out
AuthzSvc As IntPtr, ' DWORD* optional, out
RpcQosVersion As UInteger, ' DWORD
SecurityQOS As IntPtr ' RPC_SECURITY_QOS* optional, out
) As Integer
End Function' Binding : void*
' ServerPrincName : LPWSTR* optional, out
' AuthnLevel : DWORD* optional, out
' AuthnSvc : DWORD* optional, out
' AuthIdentity : void** optional, out
' AuthzSvc : DWORD* optional, out
' RpcQosVersion : DWORD
' SecurityQOS : RPC_SECURITY_QOS* optional, out
Declare PtrSafe Function RpcBindingInqAuthInfoExW Lib "rpcrt4" ( _
ByVal Binding As LongPtr, _
ByVal ServerPrincName As LongPtr, _
ByVal AuthnLevel As LongPtr, _
ByVal AuthnSvc As LongPtr, _
ByVal AuthIdentity As LongPtr, _
ByVal AuthzSvc As LongPtr, _
ByVal RpcQosVersion As Long, _
ByVal SecurityQOS As LongPtr) As Long
' Unicode(W): 文字列は ByVal As LongPtr とし StrPtr(unicodeStr) を渡す
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
RpcBindingInqAuthInfoExW = ctypes.windll.rpcrt4.RpcBindingInqAuthInfoExW
RpcBindingInqAuthInfoExW.restype = ctypes.c_int
RpcBindingInqAuthInfoExW.argtypes = [
ctypes.POINTER(None), # Binding : void*
ctypes.c_void_p, # ServerPrincName : LPWSTR* optional, out
ctypes.POINTER(wintypes.DWORD), # AuthnLevel : DWORD* optional, out
ctypes.POINTER(wintypes.DWORD), # AuthnSvc : DWORD* optional, out
ctypes.c_void_p, # AuthIdentity : void** optional, out
ctypes.POINTER(wintypes.DWORD), # AuthzSvc : DWORD* optional, out
wintypes.DWORD, # RpcQosVersion : DWORD
ctypes.c_void_p, # SecurityQOS : RPC_SECURITY_QOS* optional, out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('RPCRT4.dll')
RpcBindingInqAuthInfoExW = Fiddle::Function.new(
lib['RpcBindingInqAuthInfoExW'],
[
Fiddle::TYPE_VOIDP, # Binding : void*
Fiddle::TYPE_VOIDP, # ServerPrincName : LPWSTR* optional, out
Fiddle::TYPE_VOIDP, # AuthnLevel : DWORD* optional, out
Fiddle::TYPE_VOIDP, # AuthnSvc : DWORD* optional, out
Fiddle::TYPE_VOIDP, # AuthIdentity : void** optional, out
Fiddle::TYPE_VOIDP, # AuthzSvc : DWORD* optional, out
-Fiddle::TYPE_INT, # RpcQosVersion : DWORD
Fiddle::TYPE_VOIDP, # SecurityQOS : RPC_SECURITY_QOS* optional, out
],
Fiddle::TYPE_INT)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"#[link(name = "rpcrt4")]
extern "system" {
fn RpcBindingInqAuthInfoExW(
Binding: *mut (), // void*
ServerPrincName: *mut *mut u16, // LPWSTR* optional, out
AuthnLevel: *mut u32, // DWORD* optional, out
AuthnSvc: *mut u32, // DWORD* optional, out
AuthIdentity: *mut *mut (), // void** optional, out
AuthzSvc: *mut u32, // DWORD* optional, out
RpcQosVersion: u32, // DWORD
SecurityQOS: *mut RPC_SECURITY_QOS // RPC_SECURITY_QOS* optional, out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("RPCRT4.dll", CharSet = CharSet.Unicode)]
public static extern int RpcBindingInqAuthInfoExW(IntPtr Binding, IntPtr ServerPrincName, IntPtr AuthnLevel, IntPtr AuthnSvc, IntPtr AuthIdentity, IntPtr AuthzSvc, uint RpcQosVersion, IntPtr SecurityQOS);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RPCRT4_RpcBindingInqAuthInfoExW' -Namespace Win32 -PassThru
# $api::RpcBindingInqAuthInfoExW(Binding, ServerPrincName, AuthnLevel, AuthnSvc, AuthIdentity, AuthzSvc, RpcQosVersion, SecurityQOS)#uselib "RPCRT4.dll"
#func global RpcBindingInqAuthInfoExW "RpcBindingInqAuthInfoExW" wptr, wptr, wptr, wptr, wptr, wptr, wptr, wptr
; RpcBindingInqAuthInfoExW Binding, varptr(ServerPrincName), varptr(AuthnLevel), varptr(AuthnSvc), AuthIdentity, varptr(AuthzSvc), RpcQosVersion, varptr(SecurityQOS) ; 戻り値は stat
; Binding : void* -> "wptr"
; ServerPrincName : LPWSTR* optional, out -> "wptr"
; AuthnLevel : DWORD* optional, out -> "wptr"
; AuthnSvc : DWORD* optional, out -> "wptr"
; AuthIdentity : void** optional, out -> "wptr"
; AuthzSvc : DWORD* optional, out -> "wptr"
; RpcQosVersion : DWORD -> "wptr"
; SecurityQOS : RPC_SECURITY_QOS* optional, out -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "RPCRT4.dll" #cfunc global RpcBindingInqAuthInfoExW "RpcBindingInqAuthInfoExW" sptr, var, var, var, sptr, var, int, var ; res = RpcBindingInqAuthInfoExW(Binding, ServerPrincName, AuthnLevel, AuthnSvc, AuthIdentity, AuthzSvc, RpcQosVersion, SecurityQOS) ; Binding : void* -> "sptr" ; ServerPrincName : LPWSTR* optional, out -> "var" ; AuthnLevel : DWORD* optional, out -> "var" ; AuthnSvc : DWORD* optional, out -> "var" ; AuthIdentity : void** optional, out -> "sptr" ; AuthzSvc : DWORD* optional, out -> "var" ; RpcQosVersion : DWORD -> "int" ; SecurityQOS : RPC_SECURITY_QOS* optional, out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "RPCRT4.dll" #cfunc global RpcBindingInqAuthInfoExW "RpcBindingInqAuthInfoExW" sptr, sptr, sptr, sptr, sptr, sptr, int, sptr ; res = RpcBindingInqAuthInfoExW(Binding, varptr(ServerPrincName), varptr(AuthnLevel), varptr(AuthnSvc), AuthIdentity, varptr(AuthzSvc), RpcQosVersion, varptr(SecurityQOS)) ; Binding : void* -> "sptr" ; ServerPrincName : LPWSTR* optional, out -> "sptr" ; AuthnLevel : DWORD* optional, out -> "sptr" ; AuthnSvc : DWORD* optional, out -> "sptr" ; AuthIdentity : void** optional, out -> "sptr" ; AuthzSvc : DWORD* optional, out -> "sptr" ; RpcQosVersion : DWORD -> "int" ; SecurityQOS : RPC_SECURITY_QOS* optional, out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; RPC_STATUS RpcBindingInqAuthInfoExW(void* Binding, LPWSTR* ServerPrincName, DWORD* AuthnLevel, DWORD* AuthnSvc, void** AuthIdentity, DWORD* AuthzSvc, DWORD RpcQosVersion, RPC_SECURITY_QOS* SecurityQOS) #uselib "RPCRT4.dll" #cfunc global RpcBindingInqAuthInfoExW "RpcBindingInqAuthInfoExW" intptr, var, var, var, intptr, var, int, var ; res = RpcBindingInqAuthInfoExW(Binding, ServerPrincName, AuthnLevel, AuthnSvc, AuthIdentity, AuthzSvc, RpcQosVersion, SecurityQOS) ; Binding : void* -> "intptr" ; ServerPrincName : LPWSTR* optional, out -> "var" ; AuthnLevel : DWORD* optional, out -> "var" ; AuthnSvc : DWORD* optional, out -> "var" ; AuthIdentity : void** optional, out -> "intptr" ; AuthzSvc : DWORD* optional, out -> "var" ; RpcQosVersion : DWORD -> "int" ; SecurityQOS : RPC_SECURITY_QOS* optional, out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; RPC_STATUS RpcBindingInqAuthInfoExW(void* Binding, LPWSTR* ServerPrincName, DWORD* AuthnLevel, DWORD* AuthnSvc, void** AuthIdentity, DWORD* AuthzSvc, DWORD RpcQosVersion, RPC_SECURITY_QOS* SecurityQOS) #uselib "RPCRT4.dll" #cfunc global RpcBindingInqAuthInfoExW "RpcBindingInqAuthInfoExW" intptr, intptr, intptr, intptr, intptr, intptr, int, intptr ; res = RpcBindingInqAuthInfoExW(Binding, varptr(ServerPrincName), varptr(AuthnLevel), varptr(AuthnSvc), AuthIdentity, varptr(AuthzSvc), RpcQosVersion, varptr(SecurityQOS)) ; Binding : void* -> "intptr" ; ServerPrincName : LPWSTR* optional, out -> "intptr" ; AuthnLevel : DWORD* optional, out -> "intptr" ; AuthnSvc : DWORD* optional, out -> "intptr" ; AuthIdentity : void** optional, out -> "intptr" ; AuthzSvc : DWORD* optional, out -> "intptr" ; RpcQosVersion : DWORD -> "int" ; SecurityQOS : RPC_SECURITY_QOS* optional, out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
rpcrt4 = windows.NewLazySystemDLL("RPCRT4.dll")
procRpcBindingInqAuthInfoExW = rpcrt4.NewProc("RpcBindingInqAuthInfoExW")
)
// Binding (void*), ServerPrincName (LPWSTR* optional, out), AuthnLevel (DWORD* optional, out), AuthnSvc (DWORD* optional, out), AuthIdentity (void** optional, out), AuthzSvc (DWORD* optional, out), RpcQosVersion (DWORD), SecurityQOS (RPC_SECURITY_QOS* optional, out)
r1, _, err := procRpcBindingInqAuthInfoExW.Call(
uintptr(Binding),
uintptr(ServerPrincName),
uintptr(AuthnLevel),
uintptr(AuthnSvc),
uintptr(AuthIdentity),
uintptr(AuthzSvc),
uintptr(RpcQosVersion),
uintptr(SecurityQOS),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // RPC_STATUSfunction RpcBindingInqAuthInfoExW(
Binding: Pointer; // void*
ServerPrincName: PPWideChar; // LPWSTR* optional, out
AuthnLevel: Pointer; // DWORD* optional, out
AuthnSvc: Pointer; // DWORD* optional, out
AuthIdentity: Pointer; // void** optional, out
AuthzSvc: Pointer; // DWORD* optional, out
RpcQosVersion: DWORD; // DWORD
SecurityQOS: Pointer // RPC_SECURITY_QOS* optional, out
): Integer; stdcall;
external 'RPCRT4.dll' name 'RpcBindingInqAuthInfoExW';result := DllCall("RPCRT4\RpcBindingInqAuthInfoExW"
, "Ptr", Binding ; void*
, "Ptr", ServerPrincName ; LPWSTR* optional, out
, "Ptr", AuthnLevel ; DWORD* optional, out
, "Ptr", AuthnSvc ; DWORD* optional, out
, "Ptr", AuthIdentity ; void** optional, out
, "Ptr", AuthzSvc ; DWORD* optional, out
, "UInt", RpcQosVersion ; DWORD
, "Ptr", SecurityQOS ; RPC_SECURITY_QOS* optional, out
, "Int") ; return: RPC_STATUS●RpcBindingInqAuthInfoExW(Binding, ServerPrincName, AuthnLevel, AuthnSvc, AuthIdentity, AuthzSvc, RpcQosVersion, SecurityQOS) = DLL("RPCRT4.dll", "int RpcBindingInqAuthInfoExW(void*, void*, void*, void*, void*, void*, dword, void*)")
# 呼び出し: RpcBindingInqAuthInfoExW(Binding, ServerPrincName, AuthnLevel, AuthnSvc, AuthIdentity, AuthzSvc, RpcQosVersion, SecurityQOS)
# Binding : void* -> "void*"
# ServerPrincName : LPWSTR* optional, out -> "void*"
# AuthnLevel : DWORD* optional, out -> "void*"
# AuthnSvc : DWORD* optional, out -> "void*"
# AuthIdentity : void** optional, out -> "void*"
# AuthzSvc : DWORD* optional, out -> "void*"
# RpcQosVersion : DWORD -> "dword"
# SecurityQOS : RPC_SECURITY_QOS* optional, out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。