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

DnsQueryRawResultFree

関数
DnsQueryRawの結果に割り当てられたメモリを解放する。
DLLDNSAPI.dll呼出規約winapi

シグネチャ

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

void DnsQueryRawResultFree(
    DNS_QUERY_RAW_RESULT* queryResults   // optional
);

パラメーター

名前方向
queryResultsDNS_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 方式にも切替可。
出力引数:
; 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 方式にも切替可。
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   // void
procedure 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)。