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