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

ldap_result

関数
非同期LDAP操作の結果をタイムアウト指定で取得する。
DLLWLDAP32.dll呼出規約cdecl対応OSWindows Vista 以降

シグネチャ

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

DWORD ldap_result(
    LDAP* ld,
    DWORD msgid,
    DWORD all,
    LDAP_TIMEVAL* timeout,   // optional
    LDAPMessage** res
);

パラメーター

名前方向
ldLDAP*inout
msgidDWORDin
allDWORDin
timeoutLDAP_TIMEVAL*inoptional
resLDAPMessage**out

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD ldap_result(
    LDAP* ld,
    DWORD msgid,
    DWORD all,
    LDAP_TIMEVAL* timeout,   // optional
    LDAPMessage** res
);
[DllImport("WLDAP32.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern uint ldap_result(
    IntPtr ld,   // LDAP* in/out
    uint msgid,   // DWORD
    uint all,   // DWORD
    IntPtr timeout,   // LDAP_TIMEVAL* optional
    IntPtr res   // LDAPMessage** out
);
<DllImport("WLDAP32.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ldap_result(
    ld As IntPtr,   ' LDAP* in/out
    msgid As UInteger,   ' DWORD
    all As UInteger,   ' DWORD
    timeout As IntPtr,   ' LDAP_TIMEVAL* optional
    res As IntPtr   ' LDAPMessage** out
) As UInteger
End Function
' ld : LDAP* in/out
' msgid : DWORD
' all : DWORD
' timeout : LDAP_TIMEVAL* optional
' res : LDAPMessage** out
Declare PtrSafe Function ldap_result Lib "wldap32" ( _
    ByVal ld As LongPtr, _
    ByVal msgid As Long, _
    ByVal all As Long, _
    ByVal timeout As LongPtr, _
    ByVal res As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ldap_result = ctypes.cdll.wldap32.ldap_result
ldap_result.restype = wintypes.DWORD
ldap_result.argtypes = [
    ctypes.c_void_p,  # ld : LDAP* in/out
    wintypes.DWORD,  # msgid : DWORD
    wintypes.DWORD,  # all : DWORD
    ctypes.c_void_p,  # timeout : LDAP_TIMEVAL* optional
    ctypes.c_void_p,  # res : LDAPMessage** out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('WLDAP32.dll')
ldap_result = Fiddle::Function.new(
  lib['ldap_result'],
  [
    Fiddle::TYPE_VOIDP,  # ld : LDAP* in/out
    -Fiddle::TYPE_INT,  # msgid : DWORD
    -Fiddle::TYPE_INT,  # all : DWORD
    Fiddle::TYPE_VOIDP,  # timeout : LDAP_TIMEVAL* optional
    Fiddle::TYPE_VOIDP,  # res : LDAPMessage** out
  ],
  -Fiddle::TYPE_INT, Fiddle::Function::CDECL)
#[link(name = "wldap32")]
extern "C" {
    fn ldap_result(
        ld: *mut LDAP,  // LDAP* in/out
        msgid: u32,  // DWORD
        all: u32,  // DWORD
        timeout: *mut LDAP_TIMEVAL,  // LDAP_TIMEVAL* optional
        res: *mut *mut LDAPMessage  // LDAPMessage** out
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("WLDAP32.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern uint ldap_result(IntPtr ld, uint msgid, uint all, IntPtr timeout, IntPtr res);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WLDAP32_ldap_result' -Namespace Win32 -PassThru
# $api::ldap_result(ld, msgid, all, timeout, res)
#uselib "WLDAP32.dll"
#func global ldap_result "ldap_result" sptr, sptr, sptr, sptr, sptr
; ldap_result varptr(ld), msgid, all, varptr(timeout), varptr(res)   ; 戻り値は stat
; ld : LDAP* in/out -> "sptr"
; msgid : DWORD -> "sptr"
; all : DWORD -> "sptr"
; timeout : LDAP_TIMEVAL* optional -> "sptr"
; res : LDAPMessage** out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "WLDAP32.dll"
#cfunc global ldap_result "ldap_result" var, int, int, var, var
; res = ldap_result(ld, msgid, all, timeout, res)
; ld : LDAP* in/out -> "var"
; msgid : DWORD -> "int"
; all : DWORD -> "int"
; timeout : LDAP_TIMEVAL* optional -> "var"
; res : LDAPMessage** out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; DWORD ldap_result(LDAP* ld, DWORD msgid, DWORD all, LDAP_TIMEVAL* timeout, LDAPMessage** res)
#uselib "WLDAP32.dll"
#cfunc global ldap_result "ldap_result" var, int, int, var, var
; res = ldap_result(ld, msgid, all, timeout, res)
; ld : LDAP* in/out -> "var"
; msgid : DWORD -> "int"
; all : DWORD -> "int"
; timeout : LDAP_TIMEVAL* optional -> "var"
; res : LDAPMessage** out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	wldap32 = windows.NewLazySystemDLL("WLDAP32.dll")
	procldap_result = wldap32.NewProc("ldap_result")
)

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