ホーム › Networking.Ldap › ldap_get_next_page_s
ldap_get_next_page_s
関数ページ検索で次のページを同期的に取得する。
シグネチャ
// WLDAP32.dll
#include <windows.h>
DWORD ldap_get_next_page_s(
LDAP* ExternalHandle,
PLDAPSearch SearchHandle,
LDAP_TIMEVAL* timeout,
DWORD PageSize,
DWORD* TotalCount,
LDAPMessage** Results
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| ExternalHandle | LDAP* | inout | 対象のLDAPセッションハンドル。ページ検索を実行中の接続を指す。 |
| SearchHandle | PLDAPSearch | in | ldap_search_init_pageで取得した検索ブロックハンドル。ページ状態を保持する。 |
| timeout | LDAP_TIMEVAL* | inout | 応答待ちのタイムアウト値(timeval構造体)。NULLで無制限待機。 |
| PageSize | DWORD | in | 今回取得するページのエントリ数。1ページ分の件数を指定する。 |
| TotalCount | DWORD* | inout | サーバ見積もりの総エントリ数を受け取る出力先。 |
| Results | LDAPMessage** | inout | 取得したページの結果メッセージを受け取る出力先。ldap_msgfreeで解放する。 |
戻り値の型: DWORD
各言語での呼び出し定義
// WLDAP32.dll
#include <windows.h>
DWORD ldap_get_next_page_s(
LDAP* ExternalHandle,
PLDAPSearch SearchHandle,
LDAP_TIMEVAL* timeout,
DWORD PageSize,
DWORD* TotalCount,
LDAPMessage** Results
);[DllImport("WLDAP32.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern uint ldap_get_next_page_s(
IntPtr ExternalHandle, // LDAP* in/out
IntPtr SearchHandle, // PLDAPSearch
IntPtr timeout, // LDAP_TIMEVAL* in/out
uint PageSize, // DWORD
ref uint TotalCount, // DWORD* in/out
IntPtr Results // LDAPMessage** in/out
);<DllImport("WLDAP32.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ldap_get_next_page_s(
ExternalHandle As IntPtr, ' LDAP* in/out
SearchHandle As IntPtr, ' PLDAPSearch
timeout As IntPtr, ' LDAP_TIMEVAL* in/out
PageSize As UInteger, ' DWORD
ByRef TotalCount As UInteger, ' DWORD* in/out
Results As IntPtr ' LDAPMessage** in/out
) As UInteger
End Function' ExternalHandle : LDAP* in/out
' SearchHandle : PLDAPSearch
' timeout : LDAP_TIMEVAL* in/out
' PageSize : DWORD
' TotalCount : DWORD* in/out
' Results : LDAPMessage** in/out
Declare PtrSafe Function ldap_get_next_page_s Lib "wldap32" ( _
ByVal ExternalHandle As LongPtr, _
ByVal SearchHandle As LongPtr, _
ByVal timeout As LongPtr, _
ByVal PageSize As Long, _
ByRef TotalCount As Long, _
ByVal Results As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ldap_get_next_page_s = ctypes.cdll.wldap32.ldap_get_next_page_s
ldap_get_next_page_s.restype = wintypes.DWORD
ldap_get_next_page_s.argtypes = [
ctypes.c_void_p, # ExternalHandle : LDAP* in/out
ctypes.c_ssize_t, # SearchHandle : PLDAPSearch
ctypes.c_void_p, # timeout : LDAP_TIMEVAL* in/out
wintypes.DWORD, # PageSize : DWORD
ctypes.POINTER(wintypes.DWORD), # TotalCount : DWORD* in/out
ctypes.c_void_p, # Results : LDAPMessage** in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('WLDAP32.dll')
ldap_get_next_page_s = Fiddle::Function.new(
lib['ldap_get_next_page_s'],
[
Fiddle::TYPE_VOIDP, # ExternalHandle : LDAP* in/out
Fiddle::TYPE_INTPTR_T, # SearchHandle : PLDAPSearch
Fiddle::TYPE_VOIDP, # timeout : LDAP_TIMEVAL* in/out
-Fiddle::TYPE_INT, # PageSize : DWORD
Fiddle::TYPE_VOIDP, # TotalCount : DWORD* in/out
Fiddle::TYPE_VOIDP, # Results : LDAPMessage** in/out
],
-Fiddle::TYPE_INT, Fiddle::Function::CDECL)#[link(name = "wldap32")]
extern "C" {
fn ldap_get_next_page_s(
ExternalHandle: *mut LDAP, // LDAP* in/out
SearchHandle: isize, // PLDAPSearch
timeout: *mut LDAP_TIMEVAL, // LDAP_TIMEVAL* in/out
PageSize: u32, // DWORD
TotalCount: *mut u32, // DWORD* in/out
Results: *mut *mut LDAPMessage // LDAPMessage** 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_get_next_page_s(IntPtr ExternalHandle, IntPtr SearchHandle, IntPtr timeout, uint PageSize, ref uint TotalCount, IntPtr Results);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WLDAP32_ldap_get_next_page_s' -Namespace Win32 -PassThru
# $api::ldap_get_next_page_s(ExternalHandle, SearchHandle, timeout, PageSize, TotalCount, Results)#uselib "WLDAP32.dll"
#func global ldap_get_next_page_s "ldap_get_next_page_s" sptr, sptr, sptr, sptr, sptr, sptr
; ldap_get_next_page_s varptr(ExternalHandle), SearchHandle, varptr(timeout), PageSize, varptr(TotalCount), varptr(Results) ; 戻り値は stat
; ExternalHandle : LDAP* in/out -> "sptr"
; SearchHandle : PLDAPSearch -> "sptr"
; timeout : LDAP_TIMEVAL* in/out -> "sptr"
; PageSize : DWORD -> "sptr"
; TotalCount : DWORD* in/out -> "sptr"
; Results : LDAPMessage** in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "WLDAP32.dll" #cfunc global ldap_get_next_page_s "ldap_get_next_page_s" var, sptr, var, int, var, var ; res = ldap_get_next_page_s(ExternalHandle, SearchHandle, timeout, PageSize, TotalCount, Results) ; ExternalHandle : LDAP* in/out -> "var" ; SearchHandle : PLDAPSearch -> "sptr" ; timeout : LDAP_TIMEVAL* in/out -> "var" ; PageSize : DWORD -> "int" ; TotalCount : DWORD* in/out -> "var" ; Results : LDAPMessage** in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "WLDAP32.dll" #cfunc global ldap_get_next_page_s "ldap_get_next_page_s" sptr, sptr, sptr, int, sptr, sptr ; res = ldap_get_next_page_s(varptr(ExternalHandle), SearchHandle, varptr(timeout), PageSize, varptr(TotalCount), varptr(Results)) ; ExternalHandle : LDAP* in/out -> "sptr" ; SearchHandle : PLDAPSearch -> "sptr" ; timeout : LDAP_TIMEVAL* in/out -> "sptr" ; PageSize : DWORD -> "int" ; TotalCount : DWORD* in/out -> "sptr" ; Results : LDAPMessage** in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; DWORD ldap_get_next_page_s(LDAP* ExternalHandle, PLDAPSearch SearchHandle, LDAP_TIMEVAL* timeout, DWORD PageSize, DWORD* TotalCount, LDAPMessage** Results) #uselib "WLDAP32.dll" #cfunc global ldap_get_next_page_s "ldap_get_next_page_s" var, intptr, var, int, var, var ; res = ldap_get_next_page_s(ExternalHandle, SearchHandle, timeout, PageSize, TotalCount, Results) ; ExternalHandle : LDAP* in/out -> "var" ; SearchHandle : PLDAPSearch -> "intptr" ; timeout : LDAP_TIMEVAL* in/out -> "var" ; PageSize : DWORD -> "int" ; TotalCount : DWORD* in/out -> "var" ; Results : LDAPMessage** in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; DWORD ldap_get_next_page_s(LDAP* ExternalHandle, PLDAPSearch SearchHandle, LDAP_TIMEVAL* timeout, DWORD PageSize, DWORD* TotalCount, LDAPMessage** Results) #uselib "WLDAP32.dll" #cfunc global ldap_get_next_page_s "ldap_get_next_page_s" intptr, intptr, intptr, int, intptr, intptr ; res = ldap_get_next_page_s(varptr(ExternalHandle), SearchHandle, varptr(timeout), PageSize, varptr(TotalCount), varptr(Results)) ; ExternalHandle : LDAP* in/out -> "intptr" ; SearchHandle : PLDAPSearch -> "intptr" ; timeout : LDAP_TIMEVAL* in/out -> "intptr" ; PageSize : DWORD -> "int" ; TotalCount : DWORD* in/out -> "intptr" ; Results : LDAPMessage** in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
wldap32 = windows.NewLazySystemDLL("WLDAP32.dll")
procldap_get_next_page_s = wldap32.NewProc("ldap_get_next_page_s")
)
// ExternalHandle (LDAP* in/out), SearchHandle (PLDAPSearch), timeout (LDAP_TIMEVAL* in/out), PageSize (DWORD), TotalCount (DWORD* in/out), Results (LDAPMessage** in/out)
r1, _, err := procldap_get_next_page_s.Call(
uintptr(ExternalHandle),
uintptr(SearchHandle),
uintptr(timeout),
uintptr(PageSize),
uintptr(TotalCount),
uintptr(Results),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction ldap_get_next_page_s(
ExternalHandle: Pointer; // LDAP* in/out
SearchHandle: NativeInt; // PLDAPSearch
timeout: Pointer; // LDAP_TIMEVAL* in/out
PageSize: DWORD; // DWORD
TotalCount: Pointer; // DWORD* in/out
Results: Pointer // LDAPMessage** in/out
): DWORD; cdecl;
external 'WLDAP32.dll' name 'ldap_get_next_page_s';result := DllCall("WLDAP32\ldap_get_next_page_s"
, "Ptr", ExternalHandle ; LDAP* in/out
, "Ptr", SearchHandle ; PLDAPSearch
, "Ptr", timeout ; LDAP_TIMEVAL* in/out
, "UInt", PageSize ; DWORD
, "Ptr", TotalCount ; DWORD* in/out
, "Ptr", Results ; LDAPMessage** in/out
, "Cdecl UInt") ; return: DWORD●ldap_get_next_page_s(ExternalHandle, SearchHandle, timeout, PageSize, TotalCount, Results) = DLL("WLDAP32.dll", "dword ldap_get_next_page_s(void*, int, void*, dword, void*, void*)")
# 呼び出し: ldap_get_next_page_s(ExternalHandle, SearchHandle, timeout, PageSize, TotalCount, Results)
# ExternalHandle : LDAP* in/out -> "void*"
# SearchHandle : PLDAPSearch -> "int"
# timeout : LDAP_TIMEVAL* in/out -> "void*"
# PageSize : DWORD -> "dword"
# TotalCount : DWORD* in/out -> "void*"
# Results : LDAPMessage** in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。