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

FreeMibTable

関数
MIBテーブル取得関数が割り当てたメモリを解放する。
DLLIPHLPAPI.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

void FreeMibTable(
    void* Memory
);

パラメーター

名前方向
Memoryvoid*in

戻り値の型: void

各言語での呼び出し定義

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

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

FreeMibTable = ctypes.windll.iphlpapi.FreeMibTable
FreeMibTable.restype = None
FreeMibTable.argtypes = [
    ctypes.POINTER(None),  # Memory : void*
]
require 'fiddle'
require 'fiddle/import'

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

var (
	iphlpapi = windows.NewLazySystemDLL("IPHLPAPI.dll")
	procFreeMibTable = iphlpapi.NewProc("FreeMibTable")
)

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