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

ldap_cleanup

関数
LDAPライブラリの利用を終了して資源を解放する。
DLLWLDAP32.dll呼出規約cdecl対応OSWindows Vista 以降

シグネチャ

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

DWORD ldap_cleanup(
    HANDLE hInstance
);

パラメーター

名前方向
hInstanceHANDLEin

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD ldap_cleanup(
    HANDLE hInstance
);
[DllImport("WLDAP32.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern uint ldap_cleanup(
    IntPtr hInstance   // HANDLE
);
<DllImport("WLDAP32.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ldap_cleanup(
    hInstance As IntPtr   ' HANDLE
) As UInteger
End Function
' hInstance : HANDLE
Declare PtrSafe Function ldap_cleanup Lib "wldap32" ( _
    ByVal hInstance As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ldap_cleanup = ctypes.cdll.wldap32.ldap_cleanup
ldap_cleanup.restype = wintypes.DWORD
ldap_cleanup.argtypes = [
    wintypes.HANDLE,  # hInstance : HANDLE
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('WLDAP32.dll')
ldap_cleanup = Fiddle::Function.new(
  lib['ldap_cleanup'],
  [
    Fiddle::TYPE_VOIDP,  # hInstance : HANDLE
  ],
  -Fiddle::TYPE_INT, Fiddle::Function::CDECL)
#[link(name = "wldap32")]
extern "C" {
    fn ldap_cleanup(
        hInstance: *mut core::ffi::c_void  // HANDLE
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("WLDAP32.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern uint ldap_cleanup(IntPtr hInstance);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WLDAP32_ldap_cleanup' -Namespace Win32 -PassThru
# $api::ldap_cleanup(hInstance)
#uselib "WLDAP32.dll"
#func global ldap_cleanup "ldap_cleanup" sptr
; ldap_cleanup hInstance   ; 戻り値は stat
; hInstance : HANDLE -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "WLDAP32.dll"
#cfunc global ldap_cleanup "ldap_cleanup" sptr
; res = ldap_cleanup(hInstance)
; hInstance : HANDLE -> "sptr"
; DWORD ldap_cleanup(HANDLE hInstance)
#uselib "WLDAP32.dll"
#cfunc global ldap_cleanup "ldap_cleanup" intptr
; res = ldap_cleanup(hInstance)
; hInstance : HANDLE -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	wldap32 = windows.NewLazySystemDLL("WLDAP32.dll")
	procldap_cleanup = wldap32.NewProc("ldap_cleanup")
)

// hInstance (HANDLE)
r1, _, err := procldap_cleanup.Call(
	uintptr(hInstance),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function ldap_cleanup(
  hInstance: THandle   // HANDLE
): DWORD; cdecl;
  external 'WLDAP32.dll' name 'ldap_cleanup';
result := DllCall("WLDAP32\ldap_cleanup"
    , "Ptr", hInstance   ; HANDLE
    , "Cdecl UInt")   ; return: DWORD
●ldap_cleanup(hInstance) = DLL("WLDAP32.dll", "dword ldap_cleanup(void*)")
# 呼び出し: ldap_cleanup(hInstance)
# hInstance : HANDLE -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。