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

RpcSmClientFree

関数
RPCクライアントが割り当てたメモリを解放する。
DLLRPCRT4.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

RPC_STATUS RpcSmClientFree(
    void* pNodeToFree
);

パラメーター

名前方向
pNodeToFreevoid*in

戻り値の型: RPC_STATUS

各言語での呼び出し定義

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

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

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

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

var (
	rpcrt4 = windows.NewLazySystemDLL("RPCRT4.dll")
	procRpcSmClientFree = rpcrt4.NewProc("RpcSmClientFree")
)

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