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

ldap_free_controlsW

関数
LDAPコントロール配列を解放する(Unicode版)。
DLLWLDAP32.dll文字セットUnicode (-W)呼出規約cdecl対応OSWindows Vista 以降

シグネチャ

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

DWORD ldap_free_controlsW(
    LDAPControlW** Controls
);

パラメーター

名前方向説明
ControlsLDAPControlW**inout解放するLDAPControlW構造体配列。ldap_controls_freeWの別名で同等の動作をする。NULL可。

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD ldap_free_controlsW(
    LDAPControlW** Controls
);
[DllImport("WLDAP32.dll", CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern uint ldap_free_controlsW(
    IntPtr Controls   // LDAPControlW** in/out
);
<DllImport("WLDAP32.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ldap_free_controlsW(
    Controls As IntPtr   ' LDAPControlW** in/out
) As UInteger
End Function
' Controls : LDAPControlW** in/out
Declare PtrSafe Function ldap_free_controlsW Lib "wldap32" ( _
    ByVal Controls 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_free_controlsW = ctypes.cdll.wldap32.ldap_free_controlsW
ldap_free_controlsW.restype = wintypes.DWORD
ldap_free_controlsW.argtypes = [
    ctypes.c_void_p,  # Controls : LDAPControlW** in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('WLDAP32.dll')
ldap_free_controlsW = Fiddle::Function.new(
  lib['ldap_free_controlsW'],
  [
    Fiddle::TYPE_VOIDP,  # Controls : 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_free_controlsW(
        Controls: *mut *mut LDAPControlW  // LDAPControlW** in/out
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("WLDAP32.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern uint ldap_free_controlsW(IntPtr Controls);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WLDAP32_ldap_free_controlsW' -Namespace Win32 -PassThru
# $api::ldap_free_controlsW(Controls)
#uselib "WLDAP32.dll"
#func global ldap_free_controlsW "ldap_free_controlsW" wptr
; ldap_free_controlsW varptr(Controls)   ; 戻り値は stat
; Controls : LDAPControlW** in/out -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "WLDAP32.dll"
#cfunc global ldap_free_controlsW "ldap_free_controlsW" var
; res = ldap_free_controlsW(Controls)
; Controls : LDAPControlW** in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; DWORD ldap_free_controlsW(LDAPControlW** Controls)
#uselib "WLDAP32.dll"
#cfunc global ldap_free_controlsW "ldap_free_controlsW" var
; res = ldap_free_controlsW(Controls)
; Controls : LDAPControlW** in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	wldap32 = windows.NewLazySystemDLL("WLDAP32.dll")
	procldap_free_controlsW = wldap32.NewProc("ldap_free_controlsW")
)

// Controls (LDAPControlW** in/out)
r1, _, err := procldap_free_controlsW.Call(
	uintptr(Controls),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function ldap_free_controlsW(
  Controls: Pointer   // LDAPControlW** in/out
): DWORD; cdecl;
  external 'WLDAP32.dll' name 'ldap_free_controlsW';
result := DllCall("WLDAP32\ldap_free_controlsW"
    , "Ptr", Controls   ; LDAPControlW** in/out
    , "Cdecl UInt")   ; return: DWORD
●ldap_free_controlsW(Controls) = DLL("WLDAP32.dll", "dword ldap_free_controlsW(void*)")
# 呼び出し: ldap_free_controlsW(Controls)
# Controls : 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`,…) を使用。