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

ldap_create_vlv_controlW

関数
仮想リストビュー用のLDAPコントロールを作成する(Unicode版)。
DLLWLDAP32.dll文字セットUnicode (-W)呼出規約cdecl対応OSWindows Vista 以降

シグネチャ

// WLDAP32.dll  (Unicode / -W)
#include <windows.h>

INT ldap_create_vlv_controlW(
    LDAP* ExternalHandle,
    LDAPVLVInfo* VlvInfo,
    BYTE IsCritical,
    LDAPControlW** Control
);

パラメーター

名前方向
ExternalHandleLDAP*inout
VlvInfoLDAPVLVInfo*inout
IsCriticalBYTEin
ControlLDAPControlW**inout

戻り値の型: INT

各言語での呼び出し定義

// WLDAP32.dll  (Unicode / -W)
#include <windows.h>

INT ldap_create_vlv_controlW(
    LDAP* ExternalHandle,
    LDAPVLVInfo* VlvInfo,
    BYTE IsCritical,
    LDAPControlW** Control
);
[DllImport("WLDAP32.dll", CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern int ldap_create_vlv_controlW(
    IntPtr ExternalHandle,   // LDAP* in/out
    IntPtr VlvInfo,   // LDAPVLVInfo* in/out
    byte IsCritical,   // BYTE
    IntPtr Control   // LDAPControlW** in/out
);
<DllImport("WLDAP32.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ldap_create_vlv_controlW(
    ExternalHandle As IntPtr,   ' LDAP* in/out
    VlvInfo As IntPtr,   ' LDAPVLVInfo* in/out
    IsCritical As Byte,   ' BYTE
    Control As IntPtr   ' LDAPControlW** in/out
) As Integer
End Function
' ExternalHandle : LDAP* in/out
' VlvInfo : LDAPVLVInfo* in/out
' IsCritical : BYTE
' Control : LDAPControlW** in/out
Declare PtrSafe Function ldap_create_vlv_controlW Lib "wldap32" ( _
    ByVal ExternalHandle As LongPtr, _
    ByVal VlvInfo As LongPtr, _
    ByVal IsCritical As Byte, _
    ByVal Control As LongPtr) As Long
' Unicode(W): 文字列は ByVal As LongPtr とし StrPtr(unicodeStr) を渡す
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ldap_create_vlv_controlW = ctypes.cdll.wldap32.ldap_create_vlv_controlW
ldap_create_vlv_controlW.restype = ctypes.c_int
ldap_create_vlv_controlW.argtypes = [
    ctypes.c_void_p,  # ExternalHandle : LDAP* in/out
    ctypes.c_void_p,  # VlvInfo : LDAPVLVInfo* in/out
    ctypes.c_ubyte,  # IsCritical : BYTE
    ctypes.c_void_p,  # Control : LDAPControlW** in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('WLDAP32.dll')
ldap_create_vlv_controlW = Fiddle::Function.new(
  lib['ldap_create_vlv_controlW'],
  [
    Fiddle::TYPE_VOIDP,  # ExternalHandle : LDAP* in/out
    Fiddle::TYPE_VOIDP,  # VlvInfo : LDAPVLVInfo* in/out
    -Fiddle::TYPE_CHAR,  # IsCritical : BYTE
    Fiddle::TYPE_VOIDP,  # Control : LDAPControlW** in/out
  ],
  Fiddle::TYPE_INT, Fiddle::Function::CDECL)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"
#[link(name = "wldap32")]
extern "C" {
    fn ldap_create_vlv_controlW(
        ExternalHandle: *mut LDAP,  // LDAP* in/out
        VlvInfo: *mut LDAPVLVInfo,  // LDAPVLVInfo* in/out
        IsCritical: u8,  // BYTE
        Control: *mut *mut LDAPControlW  // LDAPControlW** in/out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("WLDAP32.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern int ldap_create_vlv_controlW(IntPtr ExternalHandle, IntPtr VlvInfo, byte IsCritical, IntPtr Control);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WLDAP32_ldap_create_vlv_controlW' -Namespace Win32 -PassThru
# $api::ldap_create_vlv_controlW(ExternalHandle, VlvInfo, IsCritical, Control)
#uselib "WLDAP32.dll"
#func global ldap_create_vlv_controlW "ldap_create_vlv_controlW" wptr, wptr, wptr, wptr
; ldap_create_vlv_controlW varptr(ExternalHandle), varptr(VlvInfo), IsCritical, varptr(Control)   ; 戻り値は stat
; ExternalHandle : LDAP* in/out -> "wptr"
; VlvInfo : LDAPVLVInfo* in/out -> "wptr"
; IsCritical : BYTE -> "wptr"
; Control : LDAPControlW** in/out -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "WLDAP32.dll"
#cfunc global ldap_create_vlv_controlW "ldap_create_vlv_controlW" var, var, int, var
; res = ldap_create_vlv_controlW(ExternalHandle, VlvInfo, IsCritical, Control)
; ExternalHandle : LDAP* in/out -> "var"
; VlvInfo : LDAPVLVInfo* in/out -> "var"
; IsCritical : BYTE -> "int"
; Control : LDAPControlW** in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; INT ldap_create_vlv_controlW(LDAP* ExternalHandle, LDAPVLVInfo* VlvInfo, BYTE IsCritical, LDAPControlW** Control)
#uselib "WLDAP32.dll"
#cfunc global ldap_create_vlv_controlW "ldap_create_vlv_controlW" var, var, int, var
; res = ldap_create_vlv_controlW(ExternalHandle, VlvInfo, IsCritical, Control)
; ExternalHandle : LDAP* in/out -> "var"
; VlvInfo : LDAPVLVInfo* in/out -> "var"
; IsCritical : BYTE -> "int"
; Control : LDAPControlW** in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	wldap32 = windows.NewLazySystemDLL("WLDAP32.dll")
	procldap_create_vlv_controlW = wldap32.NewProc("ldap_create_vlv_controlW")
)

// ExternalHandle (LDAP* in/out), VlvInfo (LDAPVLVInfo* in/out), IsCritical (BYTE), Control (LDAPControlW** in/out)
r1, _, err := procldap_create_vlv_controlW.Call(
	uintptr(ExternalHandle),
	uintptr(VlvInfo),
	uintptr(IsCritical),
	uintptr(Control),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // INT
function ldap_create_vlv_controlW(
  ExternalHandle: Pointer;   // LDAP* in/out
  VlvInfo: Pointer;   // LDAPVLVInfo* in/out
  IsCritical: Byte;   // BYTE
  Control: Pointer   // LDAPControlW** in/out
): Integer; cdecl;
  external 'WLDAP32.dll' name 'ldap_create_vlv_controlW';
result := DllCall("WLDAP32\ldap_create_vlv_controlW"
    , "Ptr", ExternalHandle   ; LDAP* in/out
    , "Ptr", VlvInfo   ; LDAPVLVInfo* in/out
    , "UChar", IsCritical   ; BYTE
    , "Ptr", Control   ; LDAPControlW** in/out
    , "Cdecl Int")   ; return: INT
●ldap_create_vlv_controlW(ExternalHandle, VlvInfo, IsCritical, Control) = DLL("WLDAP32.dll", "int ldap_create_vlv_controlW(void*, void*, byte, void*)")
# 呼び出し: ldap_create_vlv_controlW(ExternalHandle, VlvInfo, IsCritical, Control)
# ExternalHandle : LDAP* in/out -> "void*"
# VlvInfo : LDAPVLVInfo* in/out -> "void*"
# IsCritical : BYTE -> "byte"
# Control : LDAPControlW** in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。