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