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