ホーム › System.Rpc › NdrFreeBuffer
NdrFreeBuffer
関数RPCマーシャリングバッファを解放する。
シグネチャ
// RPCRT4.dll
#include <windows.h>
void NdrFreeBuffer(
MIDL_STUB_MESSAGE* pStubMsg
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pStubMsg | MIDL_STUB_MESSAGE* | inout |
戻り値の型: void
各言語での呼び出し定義
// RPCRT4.dll
#include <windows.h>
void NdrFreeBuffer(
MIDL_STUB_MESSAGE* pStubMsg
);[DllImport("RPCRT4.dll", ExactSpelling = true)]
static extern void NdrFreeBuffer(
IntPtr pStubMsg // MIDL_STUB_MESSAGE* in/out
);<DllImport("RPCRT4.dll", ExactSpelling:=True)>
Public Shared Sub NdrFreeBuffer(
pStubMsg As IntPtr ' MIDL_STUB_MESSAGE* in/out
)
End Sub' pStubMsg : MIDL_STUB_MESSAGE* in/out
Declare PtrSafe Sub NdrFreeBuffer Lib "rpcrt4" ( _
ByVal pStubMsg As LongPtr)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
NdrFreeBuffer = ctypes.windll.rpcrt4.NdrFreeBuffer
NdrFreeBuffer.restype = None
NdrFreeBuffer.argtypes = [
ctypes.c_void_p, # pStubMsg : MIDL_STUB_MESSAGE* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('RPCRT4.dll')
NdrFreeBuffer = Fiddle::Function.new(
lib['NdrFreeBuffer'],
[
Fiddle::TYPE_VOIDP, # pStubMsg : MIDL_STUB_MESSAGE* in/out
],
Fiddle::TYPE_VOID)#[link(name = "rpcrt4")]
extern "system" {
fn NdrFreeBuffer(
pStubMsg: *mut MIDL_STUB_MESSAGE // MIDL_STUB_MESSAGE* in/out
);
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("RPCRT4.dll")]
public static extern void NdrFreeBuffer(IntPtr pStubMsg);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RPCRT4_NdrFreeBuffer' -Namespace Win32 -PassThru
# $api::NdrFreeBuffer(pStubMsg)#uselib "RPCRT4.dll"
#func global NdrFreeBuffer "NdrFreeBuffer" sptr
; NdrFreeBuffer varptr(pStubMsg)
; pStubMsg : MIDL_STUB_MESSAGE* in/out -> "sptr"出力引数:
#uselib "RPCRT4.dll" #func global NdrFreeBuffer "NdrFreeBuffer" var ; NdrFreeBuffer pStubMsg ; pStubMsg : MIDL_STUB_MESSAGE* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "RPCRT4.dll" #func global NdrFreeBuffer "NdrFreeBuffer" sptr ; NdrFreeBuffer varptr(pStubMsg) ; pStubMsg : MIDL_STUB_MESSAGE* in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; void NdrFreeBuffer(MIDL_STUB_MESSAGE* pStubMsg) #uselib "RPCRT4.dll" #func global NdrFreeBuffer "NdrFreeBuffer" var ; NdrFreeBuffer pStubMsg ; pStubMsg : MIDL_STUB_MESSAGE* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; void NdrFreeBuffer(MIDL_STUB_MESSAGE* pStubMsg) #uselib "RPCRT4.dll" #func global NdrFreeBuffer "NdrFreeBuffer" intptr ; NdrFreeBuffer varptr(pStubMsg) ; pStubMsg : MIDL_STUB_MESSAGE* in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
rpcrt4 = windows.NewLazySystemDLL("RPCRT4.dll")
procNdrFreeBuffer = rpcrt4.NewProc("NdrFreeBuffer")
)
// pStubMsg (MIDL_STUB_MESSAGE* in/out)
r1, _, err := procNdrFreeBuffer.Call(
uintptr(pStubMsg),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // voidprocedure NdrFreeBuffer(
pStubMsg: Pointer // MIDL_STUB_MESSAGE* in/out
); stdcall;
external 'RPCRT4.dll' name 'NdrFreeBuffer';result := DllCall("RPCRT4\NdrFreeBuffer"
, "Ptr", pStubMsg ; MIDL_STUB_MESSAGE* in/out
, "Int") ; return: void●NdrFreeBuffer(pStubMsg) = DLL("RPCRT4.dll", "int NdrFreeBuffer(void*)")
# 呼び出し: NdrFreeBuffer(pStubMsg)
# pStubMsg : MIDL_STUB_MESSAGE* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。