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

RpcRevertToSelfEx

関数
指定バインディングの偽装を解除し自身に戻る。
DLLRPCRT4.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

RPC_STATUS RpcRevertToSelfEx(
    void* BindingHandle   // optional
);

パラメーター

名前方向
BindingHandlevoid*inoptional

戻り値の型: RPC_STATUS

各言語での呼び出し定義

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

RPC_STATUS RpcRevertToSelfEx(
    void* BindingHandle   // optional
);
[DllImport("RPCRT4.dll", ExactSpelling = true)]
static extern int RpcRevertToSelfEx(
    IntPtr BindingHandle   // void* optional
);
<DllImport("RPCRT4.dll", ExactSpelling:=True)>
Public Shared Function RpcRevertToSelfEx(
    BindingHandle As IntPtr   ' void* optional
) As Integer
End Function
' BindingHandle : void* optional
Declare PtrSafe Function RpcRevertToSelfEx 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

RpcRevertToSelfEx = ctypes.windll.rpcrt4.RpcRevertToSelfEx
RpcRevertToSelfEx.restype = ctypes.c_int
RpcRevertToSelfEx.argtypes = [
    ctypes.POINTER(None),  # BindingHandle : void* optional
]
require 'fiddle'
require 'fiddle/import'

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

var (
	rpcrt4 = windows.NewLazySystemDLL("RPCRT4.dll")
	procRpcRevertToSelfEx = rpcrt4.NewProc("RpcRevertToSelfEx")
)

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