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

RpcUserFree

関数
RPCがユーザー割り当てバッファを解放する。
DLLRPCRT4.dll呼出規約winapi対応OSWindows XP 以降

シグネチャ

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

void RpcUserFree(
    void* AsyncHandle,
    void* pBuffer
);

パラメーター

名前方向
AsyncHandlevoid*inout
pBuffervoid*inout

戻り値の型: void

各言語での呼び出し定義

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

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

RpcUserFree = ctypes.windll.rpcrt4.RpcUserFree
RpcUserFree.restype = None
RpcUserFree.argtypes = [
    ctypes.POINTER(None),  # AsyncHandle : void* in/out
    ctypes.POINTER(None),  # pBuffer : void* in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	rpcrt4 = windows.NewLazySystemDLL("RPCRT4.dll")
	procRpcUserFree = rpcrt4.NewProc("RpcUserFree")
)

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