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

RpcRevertToSelf

関数
クライアント偽装を解除し自身に戻る。
DLLRPCRT4.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

RPC_STATUS RpcRevertToSelf(void);

パラメーターなし。戻り値: RPC_STATUS

各言語での呼び出し定義

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

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

RpcRevertToSelf = ctypes.windll.rpcrt4.RpcRevertToSelf
RpcRevertToSelf.restype = ctypes.c_int
RpcRevertToSelf.argtypes = []
require 'fiddle'
require 'fiddle/import'

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

var (
	rpcrt4 = windows.NewLazySystemDLL("RPCRT4.dll")
	procRpcRevertToSelf = rpcrt4.NewProc("RpcRevertToSelf")
)

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