Win32 API 日本語リファレンス
ホームNetworkManagement.Dhcp › DhcpRpcFreeMemory

DhcpRpcFreeMemory

関数
DHCP API が RPC で割り当てたメモリを解放する。
DLLDHCPSAPI.dll呼出規約winapi対応OSwindowsserver2000

シグネチャ

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

void DhcpRpcFreeMemory(
    void* BufferPointer
);

パラメーター

名前方向
BufferPointervoid*inout

戻り値の型: void

各言語での呼び出し定義

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

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

DhcpRpcFreeMemory = ctypes.windll.dhcpsapi.DhcpRpcFreeMemory
DhcpRpcFreeMemory.restype = None
DhcpRpcFreeMemory.argtypes = [
    ctypes.POINTER(None),  # BufferPointer : void* in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	dhcpsapi = windows.NewLazySystemDLL("DHCPSAPI.dll")
	procDhcpRpcFreeMemory = dhcpsapi.NewProc("DhcpRpcFreeMemory")
)

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