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