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

ldap_parse_sort_controlA

関数
ソート結果コントロールを解析する(ANSI版)。
DLLWLDAP32.dll文字セットANSI (-A)呼出規約cdecl対応OSWindows Vista 以降

シグネチャ

// WLDAP32.dll  (ANSI / -A)
#include <windows.h>

DWORD ldap_parse_sort_controlA(
    LDAP* ExternalHandle,
    LDAPControlA** Control,
    DWORD* Result,
    LPSTR* Attribute   // optional
);

パラメーター

名前方向
ExternalHandleLDAP*inout
ControlLDAPControlA**inout
ResultDWORD*inout
AttributeLPSTR*outoptional

戻り値の型: DWORD

各言語での呼び出し定義

// WLDAP32.dll  (ANSI / -A)
#include <windows.h>

DWORD ldap_parse_sort_controlA(
    LDAP* ExternalHandle,
    LDAPControlA** Control,
    DWORD* Result,
    LPSTR* Attribute   // optional
);
[DllImport("WLDAP32.dll", CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern uint ldap_parse_sort_controlA(
    IntPtr ExternalHandle,   // LDAP* in/out
    IntPtr Control,   // LDAPControlA** in/out
    ref uint Result,   // DWORD* in/out
    IntPtr Attribute   // LPSTR* optional, out
);
<DllImport("WLDAP32.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ldap_parse_sort_controlA(
    ExternalHandle As IntPtr,   ' LDAP* in/out
    Control As IntPtr,   ' LDAPControlA** in/out
    ByRef Result As UInteger,   ' DWORD* in/out
    Attribute As IntPtr   ' LPSTR* optional, out
) As UInteger
End Function
' ExternalHandle : LDAP* in/out
' Control : LDAPControlA** in/out
' Result : DWORD* in/out
' Attribute : LPSTR* optional, out
Declare PtrSafe Function ldap_parse_sort_controlA Lib "wldap32" ( _
    ByVal ExternalHandle As LongPtr, _
    ByVal Control As LongPtr, _
    ByRef Result As Long, _
    ByVal Attribute As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ldap_parse_sort_controlA = ctypes.cdll.wldap32.ldap_parse_sort_controlA
ldap_parse_sort_controlA.restype = wintypes.DWORD
ldap_parse_sort_controlA.argtypes = [
    ctypes.c_void_p,  # ExternalHandle : LDAP* in/out
    ctypes.c_void_p,  # Control : LDAPControlA** in/out
    ctypes.POINTER(wintypes.DWORD),  # Result : DWORD* in/out
    ctypes.c_void_p,  # Attribute : LPSTR* optional, out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('WLDAP32.dll')
ldap_parse_sort_controlA = Fiddle::Function.new(
  lib['ldap_parse_sort_controlA'],
  [
    Fiddle::TYPE_VOIDP,  # ExternalHandle : LDAP* in/out
    Fiddle::TYPE_VOIDP,  # Control : LDAPControlA** in/out
    Fiddle::TYPE_VOIDP,  # Result : DWORD* in/out
    Fiddle::TYPE_VOIDP,  # Attribute : LPSTR* optional, out
  ],
  -Fiddle::TYPE_INT, Fiddle::Function::CDECL)
#[link(name = "wldap32")]
extern "C" {
    fn ldap_parse_sort_controlA(
        ExternalHandle: *mut LDAP,  // LDAP* in/out
        Control: *mut *mut LDAPControlA,  // LDAPControlA** in/out
        Result: *mut u32,  // DWORD* in/out
        Attribute: *mut *mut u8  // LPSTR* optional, 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_parse_sort_controlA(IntPtr ExternalHandle, IntPtr Control, ref uint Result, IntPtr Attribute);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WLDAP32_ldap_parse_sort_controlA' -Namespace Win32 -PassThru
# $api::ldap_parse_sort_controlA(ExternalHandle, Control, Result, Attribute)
#uselib "WLDAP32.dll"
#func global ldap_parse_sort_controlA "ldap_parse_sort_controlA" sptr, sptr, sptr, sptr
; ldap_parse_sort_controlA varptr(ExternalHandle), varptr(Control), varptr(Result), varptr(Attribute)   ; 戻り値は stat
; ExternalHandle : LDAP* in/out -> "sptr"
; Control : LDAPControlA** in/out -> "sptr"
; Result : DWORD* in/out -> "sptr"
; Attribute : LPSTR* optional, out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "WLDAP32.dll"
#cfunc global ldap_parse_sort_controlA "ldap_parse_sort_controlA" var, var, var, var
; res = ldap_parse_sort_controlA(ExternalHandle, Control, Result, Attribute)
; ExternalHandle : LDAP* in/out -> "var"
; Control : LDAPControlA** in/out -> "var"
; Result : DWORD* in/out -> "var"
; Attribute : LPSTR* optional, out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; DWORD ldap_parse_sort_controlA(LDAP* ExternalHandle, LDAPControlA** Control, DWORD* Result, LPSTR* Attribute)
#uselib "WLDAP32.dll"
#cfunc global ldap_parse_sort_controlA "ldap_parse_sort_controlA" var, var, var, var
; res = ldap_parse_sort_controlA(ExternalHandle, Control, Result, Attribute)
; ExternalHandle : LDAP* in/out -> "var"
; Control : LDAPControlA** in/out -> "var"
; Result : DWORD* in/out -> "var"
; Attribute : LPSTR* optional, out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	wldap32 = windows.NewLazySystemDLL("WLDAP32.dll")
	procldap_parse_sort_controlA = wldap32.NewProc("ldap_parse_sort_controlA")
)

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