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

DhcpHlprFreeV4DhcpProperty

関数
IPv4 DHCPプロパティ構造体のメモリを解放する。
DLLDHCPSAPI.dll呼出規約winapi

シグネチャ

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

void DhcpHlprFreeV4DhcpProperty(
    DHCP_PROPERTY* Property
);

パラメーター

名前方向
PropertyDHCP_PROPERTY*inout

戻り値の型: void

各言語での呼び出し定義

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

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

DhcpHlprFreeV4DhcpProperty = ctypes.windll.dhcpsapi.DhcpHlprFreeV4DhcpProperty
DhcpHlprFreeV4DhcpProperty.restype = None
DhcpHlprFreeV4DhcpProperty.argtypes = [
    ctypes.c_void_p,  # Property : DHCP_PROPERTY* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('DHCPSAPI.dll')
DhcpHlprFreeV4DhcpProperty = Fiddle::Function.new(
  lib['DhcpHlprFreeV4DhcpProperty'],
  [
    Fiddle::TYPE_VOIDP,  # Property : DHCP_PROPERTY* in/out
  ],
  Fiddle::TYPE_VOID)
#[link(name = "dhcpsapi")]
extern "system" {
    fn DhcpHlprFreeV4DhcpProperty(
        Property: *mut DHCP_PROPERTY  // DHCP_PROPERTY* in/out
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("DHCPSAPI.dll")]
public static extern void DhcpHlprFreeV4DhcpProperty(IntPtr Property);
"@
$api = Add-Type -MemberDefinition $sig -Name 'DHCPSAPI_DhcpHlprFreeV4DhcpProperty' -Namespace Win32 -PassThru
# $api::DhcpHlprFreeV4DhcpProperty(Property)
#uselib "DHCPSAPI.dll"
#func global DhcpHlprFreeV4DhcpProperty "DhcpHlprFreeV4DhcpProperty" sptr
; DhcpHlprFreeV4DhcpProperty varptr(Property)
; Property : DHCP_PROPERTY* in/out -> "sptr"
出力引数:
#uselib "DHCPSAPI.dll"
#func global DhcpHlprFreeV4DhcpProperty "DhcpHlprFreeV4DhcpProperty" var
; DhcpHlprFreeV4DhcpProperty Property
; Property : DHCP_PROPERTY* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; void DhcpHlprFreeV4DhcpProperty(DHCP_PROPERTY* Property)
#uselib "DHCPSAPI.dll"
#func global DhcpHlprFreeV4DhcpProperty "DhcpHlprFreeV4DhcpProperty" var
; DhcpHlprFreeV4DhcpProperty Property
; Property : DHCP_PROPERTY* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	dhcpsapi = windows.NewLazySystemDLL("DHCPSAPI.dll")
	procDhcpHlprFreeV4DhcpProperty = dhcpsapi.NewProc("DhcpHlprFreeV4DhcpProperty")
)

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