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

GetInvertedIfStackTable

関数
インターフェイスの逆順の階層関係テーブルを取得する。
DLLIPHLPAPI.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

WIN32_ERROR GetInvertedIfStackTable(
    MIB_INVERTEDIFSTACK_TABLE** Table
);

パラメーター

名前方向
TableMIB_INVERTEDIFSTACK_TABLE**out

戻り値の型: WIN32_ERROR

各言語での呼び出し定義

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

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

GetInvertedIfStackTable = ctypes.windll.iphlpapi.GetInvertedIfStackTable
GetInvertedIfStackTable.restype = wintypes.DWORD
GetInvertedIfStackTable.argtypes = [
    ctypes.c_void_p,  # Table : MIB_INVERTEDIFSTACK_TABLE** out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('IPHLPAPI.dll')
GetInvertedIfStackTable = Fiddle::Function.new(
  lib['GetInvertedIfStackTable'],
  [
    Fiddle::TYPE_VOIDP,  # Table : MIB_INVERTEDIFSTACK_TABLE** out
  ],
  -Fiddle::TYPE_INT)
#[link(name = "iphlpapi")]
extern "system" {
    fn GetInvertedIfStackTable(
        Table: *mut *mut MIB_INVERTEDIFSTACK_TABLE  // MIB_INVERTEDIFSTACK_TABLE** out
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("IPHLPAPI.dll")]
public static extern uint GetInvertedIfStackTable(IntPtr Table);
"@
$api = Add-Type -MemberDefinition $sig -Name 'IPHLPAPI_GetInvertedIfStackTable' -Namespace Win32 -PassThru
# $api::GetInvertedIfStackTable(Table)
#uselib "IPHLPAPI.dll"
#func global GetInvertedIfStackTable "GetInvertedIfStackTable" sptr
; GetInvertedIfStackTable varptr(Table)   ; 戻り値は stat
; Table : MIB_INVERTEDIFSTACK_TABLE** out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "IPHLPAPI.dll"
#cfunc global GetInvertedIfStackTable "GetInvertedIfStackTable" var
; res = GetInvertedIfStackTable(Table)
; Table : MIB_INVERTEDIFSTACK_TABLE** out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; WIN32_ERROR GetInvertedIfStackTable(MIB_INVERTEDIFSTACK_TABLE** Table)
#uselib "IPHLPAPI.dll"
#cfunc global GetInvertedIfStackTable "GetInvertedIfStackTable" var
; res = GetInvertedIfStackTable(Table)
; Table : MIB_INVERTEDIFSTACK_TABLE** out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	iphlpapi = windows.NewLazySystemDLL("IPHLPAPI.dll")
	procGetInvertedIfStackTable = iphlpapi.NewProc("GetInvertedIfStackTable")
)

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