Win32 API 日本語リファレンス
ホームSystem.Rpc › I_RpcBindingInqSecurityContext

I_RpcBindingInqSecurityContext

関数
バインディングのセキュリティコンテキストハンドルを問い合わせる内部関数。
DLLRPCRT4.dll呼出規約winapi

シグネチャ

// RPCRT4.dll
#include <windows.h>

RPC_STATUS I_RpcBindingInqSecurityContext(
    void* Binding,
    void** SecurityContextHandle
);

パラメーター

名前方向
Bindingvoid*inout
SecurityContextHandlevoid**inout

戻り値の型: RPC_STATUS

各言語での呼び出し定義

// RPCRT4.dll
#include <windows.h>

RPC_STATUS I_RpcBindingInqSecurityContext(
    void* Binding,
    void** SecurityContextHandle
);
[DllImport("RPCRT4.dll", ExactSpelling = true)]
static extern int I_RpcBindingInqSecurityContext(
    IntPtr Binding,   // void* in/out
    IntPtr SecurityContextHandle   // void** in/out
);
<DllImport("RPCRT4.dll", ExactSpelling:=True)>
Public Shared Function I_RpcBindingInqSecurityContext(
    Binding As IntPtr,   ' void* in/out
    SecurityContextHandle As IntPtr   ' void** in/out
) As Integer
End Function
' Binding : void* in/out
' SecurityContextHandle : void** in/out
Declare PtrSafe Function I_RpcBindingInqSecurityContext Lib "rpcrt4" ( _
    ByVal Binding As LongPtr, _
    ByVal SecurityContextHandle As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

I_RpcBindingInqSecurityContext = ctypes.windll.rpcrt4.I_RpcBindingInqSecurityContext
I_RpcBindingInqSecurityContext.restype = ctypes.c_int
I_RpcBindingInqSecurityContext.argtypes = [
    ctypes.POINTER(None),  # Binding : void* in/out
    ctypes.c_void_p,  # SecurityContextHandle : void** in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('RPCRT4.dll')
I_RpcBindingInqSecurityContext = Fiddle::Function.new(
  lib['I_RpcBindingInqSecurityContext'],
  [
    Fiddle::TYPE_VOIDP,  # Binding : void* in/out
    Fiddle::TYPE_VOIDP,  # SecurityContextHandle : void** in/out
  ],
  Fiddle::TYPE_INT)
#[link(name = "rpcrt4")]
extern "system" {
    fn I_RpcBindingInqSecurityContext(
        Binding: *mut (),  // void* in/out
        SecurityContextHandle: *mut *mut ()  // void** in/out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("RPCRT4.dll")]
public static extern int I_RpcBindingInqSecurityContext(IntPtr Binding, IntPtr SecurityContextHandle);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RPCRT4_I_RpcBindingInqSecurityContext' -Namespace Win32 -PassThru
# $api::I_RpcBindingInqSecurityContext(Binding, SecurityContextHandle)
#uselib "RPCRT4.dll"
#func global I_RpcBindingInqSecurityContext "I_RpcBindingInqSecurityContext" sptr, sptr
; I_RpcBindingInqSecurityContext Binding, SecurityContextHandle   ; 戻り値は stat
; Binding : void* in/out -> "sptr"
; SecurityContextHandle : void** in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "RPCRT4.dll"
#cfunc global I_RpcBindingInqSecurityContext "I_RpcBindingInqSecurityContext" sptr, sptr
; res = I_RpcBindingInqSecurityContext(Binding, SecurityContextHandle)
; Binding : void* in/out -> "sptr"
; SecurityContextHandle : void** in/out -> "sptr"
; RPC_STATUS I_RpcBindingInqSecurityContext(void* Binding, void** SecurityContextHandle)
#uselib "RPCRT4.dll"
#cfunc global I_RpcBindingInqSecurityContext "I_RpcBindingInqSecurityContext" intptr, intptr
; res = I_RpcBindingInqSecurityContext(Binding, SecurityContextHandle)
; Binding : void* in/out -> "intptr"
; SecurityContextHandle : void** in/out -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	rpcrt4 = windows.NewLazySystemDLL("RPCRT4.dll")
	procI_RpcBindingInqSecurityContext = rpcrt4.NewProc("I_RpcBindingInqSecurityContext")
)

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