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

ldap_count_values_len

関数
berval形式の属性値配列に含まれる値の個数を返す。
DLLWLDAP32.dll呼出規約cdecl対応OSWindows Vista 以降

シグネチャ

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

DWORD ldap_count_values_len(
    LDAP_BERVAL** vals
);

パラメーター

名前方向
valsLDAP_BERVAL**inout

戻り値の型: DWORD

各言語での呼び出し定義

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

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

ldap_count_values_len = ctypes.cdll.wldap32.ldap_count_values_len
ldap_count_values_len.restype = wintypes.DWORD
ldap_count_values_len.argtypes = [
    ctypes.c_void_p,  # vals : LDAP_BERVAL** in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	wldap32 = windows.NewLazySystemDLL("WLDAP32.dll")
	procldap_count_values_len = wldap32.NewProc("ldap_count_values_len")
)

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