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

I_RpcGetExtendedError

関数
直近のRPC呼び出しの拡張エラー情報を取得する内部関数。
DLLRPCRT4.dll呼出規約winapi

シグネチャ

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

RPC_STATUS I_RpcGetExtendedError(void);

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

各言語での呼び出し定義

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

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

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

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

var (
	rpcrt4 = windows.NewLazySystemDLL("RPCRT4.dll")
	procI_RpcGetExtendedError = rpcrt4.NewProc("I_RpcGetExtendedError")
)

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