Win32 API 日本語リファレンス
ホームNetworking.ActiveDirectory › DsGetDcCloseW

DsGetDcCloseW

関数
DsGetDcOpenで開いたDC検出コンテキストを閉じる。
DLLNETAPI32.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

void DsGetDcCloseW(
    HANDLE GetDcContextHandle
);

パラメーター

名前方向
GetDcContextHandleHANDLEin

戻り値の型: void

各言語での呼び出し定義

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

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

DsGetDcCloseW = ctypes.windll.netapi32.DsGetDcCloseW
DsGetDcCloseW.restype = None
DsGetDcCloseW.argtypes = [
    wintypes.HANDLE,  # GetDcContextHandle : HANDLE
]
require 'fiddle'
require 'fiddle/import'

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

var (
	netapi32 = windows.NewLazySystemDLL("NETAPI32.dll")
	procDsGetDcCloseW = netapi32.NewProc("DsGetDcCloseW")
)

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