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

DnsReleaseContextHandle

関数
DNSコンテキストハンドルを解放する。
DLLDNSAPI.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

void DnsReleaseContextHandle(
    HANDLE hContext
);

パラメーター

名前方向
hContextHANDLEin

戻り値の型: void

各言語での呼び出し定義

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

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

DnsReleaseContextHandle = ctypes.windll.dnsapi.DnsReleaseContextHandle
DnsReleaseContextHandle.restype = None
DnsReleaseContextHandle.argtypes = [
    wintypes.HANDLE,  # hContext : HANDLE
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('DNSAPI.dll')
DnsReleaseContextHandle = Fiddle::Function.new(
  lib['DnsReleaseContextHandle'],
  [
    Fiddle::TYPE_VOIDP,  # hContext : HANDLE
  ],
  Fiddle::TYPE_VOID)
#[link(name = "dnsapi")]
extern "system" {
    fn DnsReleaseContextHandle(
        hContext: *mut core::ffi::c_void  // HANDLE
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("DNSAPI.dll")]
public static extern void DnsReleaseContextHandle(IntPtr hContext);
"@
$api = Add-Type -MemberDefinition $sig -Name 'DNSAPI_DnsReleaseContextHandle' -Namespace Win32 -PassThru
# $api::DnsReleaseContextHandle(hContext)
#uselib "DNSAPI.dll"
#func global DnsReleaseContextHandle "DnsReleaseContextHandle" sptr
; DnsReleaseContextHandle hContext
; hContext : HANDLE -> "sptr"
#uselib "DNSAPI.dll"
#func global DnsReleaseContextHandle "DnsReleaseContextHandle" sptr
; DnsReleaseContextHandle hContext
; hContext : HANDLE -> "sptr"
; void DnsReleaseContextHandle(HANDLE hContext)
#uselib "DNSAPI.dll"
#func global DnsReleaseContextHandle "DnsReleaseContextHandle" intptr
; DnsReleaseContextHandle hContext
; hContext : HANDLE -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	dnsapi = windows.NewLazySystemDLL("DNSAPI.dll")
	procDnsReleaseContextHandle = dnsapi.NewProc("DnsReleaseContextHandle")
)

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