ホーム › Networking.Ldap › ldap_get_option
ldap_get_option
関数LDAPセッションのオプション値を取得する。
シグネチャ
// WLDAP32.dll (ANSI / -A)
#include <windows.h>
DWORD ldap_get_option(
LDAP* ld,
INT option,
void* outvalue
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| ld | LDAP* | inout |
| option | INT | in |
| outvalue | void* | inout |
戻り値の型: DWORD
各言語での呼び出し定義
// WLDAP32.dll (ANSI / -A)
#include <windows.h>
DWORD ldap_get_option(
LDAP* ld,
INT option,
void* outvalue
);[DllImport("WLDAP32.dll", CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern uint ldap_get_option(
IntPtr ld, // LDAP* in/out
int option, // INT
IntPtr outvalue // void* in/out
);<DllImport("WLDAP32.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ldap_get_option(
ld As IntPtr, ' LDAP* in/out
[option] As Integer, ' INT
outvalue As IntPtr ' void* in/out
) As UInteger
End Function' ld : LDAP* in/out
' option : INT
' outvalue : void* in/out
Declare PtrSafe Function ldap_get_option Lib "wldap32" ( _
ByVal ld As LongPtr, _
ByVal option As Long, _
ByVal outvalue As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ldap_get_option = ctypes.cdll.wldap32.ldap_get_option
ldap_get_option.restype = wintypes.DWORD
ldap_get_option.argtypes = [
ctypes.c_void_p, # ld : LDAP* in/out
ctypes.c_int, # option : INT
ctypes.POINTER(None), # outvalue : void* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('WLDAP32.dll')
ldap_get_option = Fiddle::Function.new(
lib['ldap_get_option'],
[
Fiddle::TYPE_VOIDP, # ld : LDAP* in/out
Fiddle::TYPE_INT, # option : INT
Fiddle::TYPE_VOIDP, # outvalue : void* in/out
],
-Fiddle::TYPE_INT, Fiddle::Function::CDECL)#[link(name = "wldap32")]
extern "C" {
fn ldap_get_option(
ld: *mut LDAP, // LDAP* in/out
option: i32, // INT
outvalue: *mut () // void* in/out
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("WLDAP32.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
public static extern uint ldap_get_option(IntPtr ld, int option, IntPtr outvalue);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WLDAP32_ldap_get_option' -Namespace Win32 -PassThru
# $api::ldap_get_option(ld, option, outvalue)#uselib "WLDAP32.dll"
#func global ldap_get_option "ldap_get_option" sptr, sptr, sptr
; ldap_get_option varptr(ld), option, outvalue ; 戻り値は stat
; ld : LDAP* in/out -> "sptr"
; option : INT -> "sptr"
; outvalue : void* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "WLDAP32.dll" #cfunc global ldap_get_option "ldap_get_option" var, int, sptr ; res = ldap_get_option(ld, option, outvalue) ; ld : LDAP* in/out -> "var" ; option : INT -> "int" ; outvalue : void* in/out -> "sptr" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "WLDAP32.dll" #cfunc global ldap_get_option "ldap_get_option" sptr, int, sptr ; res = ldap_get_option(varptr(ld), option, outvalue) ; ld : LDAP* in/out -> "sptr" ; option : INT -> "int" ; outvalue : void* in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; DWORD ldap_get_option(LDAP* ld, INT option, void* outvalue) #uselib "WLDAP32.dll" #cfunc global ldap_get_option "ldap_get_option" var, int, intptr ; res = ldap_get_option(ld, option, outvalue) ; ld : LDAP* in/out -> "var" ; option : INT -> "int" ; outvalue : void* in/out -> "intptr" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; DWORD ldap_get_option(LDAP* ld, INT option, void* outvalue) #uselib "WLDAP32.dll" #cfunc global ldap_get_option "ldap_get_option" intptr, int, intptr ; res = ldap_get_option(varptr(ld), option, outvalue) ; ld : LDAP* in/out -> "intptr" ; option : INT -> "int" ; outvalue : void* in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
wldap32 = windows.NewLazySystemDLL("WLDAP32.dll")
procldap_get_option = wldap32.NewProc("ldap_get_option")
)
// ld (LDAP* in/out), option (INT), outvalue (void* in/out)
r1, _, err := procldap_get_option.Call(
uintptr(ld),
uintptr(option),
uintptr(outvalue),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction ldap_get_option(
ld: Pointer; // LDAP* in/out
option: Integer; // INT
outvalue: Pointer // void* in/out
): DWORD; cdecl;
external 'WLDAP32.dll' name 'ldap_get_option';result := DllCall("WLDAP32\ldap_get_option"
, "Ptr", ld ; LDAP* in/out
, "Int", option ; INT
, "Ptr", outvalue ; void* in/out
, "Cdecl UInt") ; return: DWORD●ldap_get_option(ld, option, outvalue) = DLL("WLDAP32.dll", "dword ldap_get_option(void*, int, void*)")
# 呼び出し: ldap_get_option(ld, option, outvalue)
# ld : LDAP* in/out -> "void*"
# option : INT -> "int"
# outvalue : void* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。