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

I_RpcRequestMutex

関数
RPCランタイム内部のミューテックスを要求し取得する。
DLLRPCRT4.dll呼出規約winapi

シグネチャ

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

void I_RpcRequestMutex(
    void** Mutex
);

パラメーター

名前方向
Mutexvoid**inout

戻り値の型: void

各言語での呼び出し定義

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

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

I_RpcRequestMutex = ctypes.windll.rpcrt4.I_RpcRequestMutex
I_RpcRequestMutex.restype = None
I_RpcRequestMutex.argtypes = [
    ctypes.c_void_p,  # Mutex : void** in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('RPCRT4.dll')
I_RpcRequestMutex = Fiddle::Function.new(
  lib['I_RpcRequestMutex'],
  [
    Fiddle::TYPE_VOIDP,  # Mutex : void** in/out
  ],
  Fiddle::TYPE_VOID)
#[link(name = "rpcrt4")]
extern "system" {
    fn I_RpcRequestMutex(
        Mutex: *mut *mut ()  // void** in/out
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("RPCRT4.dll")]
public static extern void I_RpcRequestMutex(IntPtr Mutex);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RPCRT4_I_RpcRequestMutex' -Namespace Win32 -PassThru
# $api::I_RpcRequestMutex(Mutex)
#uselib "RPCRT4.dll"
#func global I_RpcRequestMutex "I_RpcRequestMutex" sptr
; I_RpcRequestMutex Mutex
; Mutex : void** in/out -> "sptr"
#uselib "RPCRT4.dll"
#func global I_RpcRequestMutex "I_RpcRequestMutex" sptr
; I_RpcRequestMutex Mutex
; Mutex : void** in/out -> "sptr"
; void I_RpcRequestMutex(void** Mutex)
#uselib "RPCRT4.dll"
#func global I_RpcRequestMutex "I_RpcRequestMutex" intptr
; I_RpcRequestMutex Mutex
; Mutex : void** in/out -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	rpcrt4 = windows.NewLazySystemDLL("RPCRT4.dll")
	procI_RpcRequestMutex = rpcrt4.NewProc("I_RpcRequestMutex")
)

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