ホーム › Networking.Ldap › ldap_set_dbg_routine
ldap_set_dbg_routine
関数LDAPのデバッグ出力用コールバック関数を登録する。
シグネチャ
// WLDAP32.dll
#include <windows.h>
void ldap_set_dbg_routine(
DBGPRINT DebugPrintRoutine
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| DebugPrintRoutine | DBGPRINT | in |
戻り値の型: void
各言語での呼び出し定義
// WLDAP32.dll
#include <windows.h>
void ldap_set_dbg_routine(
DBGPRINT DebugPrintRoutine
);[DllImport("WLDAP32.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern void ldap_set_dbg_routine(
IntPtr DebugPrintRoutine // DBGPRINT
);<DllImport("WLDAP32.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Sub ldap_set_dbg_routine(
DebugPrintRoutine As IntPtr ' DBGPRINT
)
End Sub' DebugPrintRoutine : DBGPRINT
Declare PtrSafe Sub ldap_set_dbg_routine Lib "wldap32" ( _
ByVal DebugPrintRoutine As LongPtr)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ldap_set_dbg_routine = ctypes.cdll.wldap32.ldap_set_dbg_routine
ldap_set_dbg_routine.restype = None
ldap_set_dbg_routine.argtypes = [
ctypes.c_void_p, # DebugPrintRoutine : DBGPRINT
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('WLDAP32.dll')
ldap_set_dbg_routine = Fiddle::Function.new(
lib['ldap_set_dbg_routine'],
[
Fiddle::TYPE_VOIDP, # DebugPrintRoutine : DBGPRINT
],
Fiddle::TYPE_VOID, Fiddle::Function::CDECL)#[link(name = "wldap32")]
extern "C" {
fn ldap_set_dbg_routine(
DebugPrintRoutine: *const core::ffi::c_void // DBGPRINT
);
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("WLDAP32.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void ldap_set_dbg_routine(IntPtr DebugPrintRoutine);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WLDAP32_ldap_set_dbg_routine' -Namespace Win32 -PassThru
# $api::ldap_set_dbg_routine(DebugPrintRoutine)#uselib "WLDAP32.dll"
#func global ldap_set_dbg_routine "ldap_set_dbg_routine" sptr
; ldap_set_dbg_routine DebugPrintRoutine
; DebugPrintRoutine : DBGPRINT -> "sptr"#uselib "WLDAP32.dll"
#func global ldap_set_dbg_routine "ldap_set_dbg_routine" sptr
; ldap_set_dbg_routine DebugPrintRoutine
; DebugPrintRoutine : DBGPRINT -> "sptr"; void ldap_set_dbg_routine(DBGPRINT DebugPrintRoutine)
#uselib "WLDAP32.dll"
#func global ldap_set_dbg_routine "ldap_set_dbg_routine" intptr
; ldap_set_dbg_routine DebugPrintRoutine
; DebugPrintRoutine : DBGPRINT -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
wldap32 = windows.NewLazySystemDLL("WLDAP32.dll")
procldap_set_dbg_routine = wldap32.NewProc("ldap_set_dbg_routine")
)
// DebugPrintRoutine (DBGPRINT)
r1, _, err := procldap_set_dbg_routine.Call(
uintptr(DebugPrintRoutine),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // voidprocedure ldap_set_dbg_routine(
DebugPrintRoutine: Pointer // DBGPRINT
); cdecl;
external 'WLDAP32.dll' name 'ldap_set_dbg_routine';result := DllCall("WLDAP32\ldap_set_dbg_routine"
, "Ptr", DebugPrintRoutine ; DBGPRINT
, "Cdecl Int") ; return: void●ldap_set_dbg_routine(DebugPrintRoutine) = DLL("WLDAP32.dll", "int ldap_set_dbg_routine(void*)")
# 呼び出し: ldap_set_dbg_routine(DebugPrintRoutine)
# DebugPrintRoutine : DBGPRINT -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。