ホーム › Networking.Ldap › ldap_explode_dnA
ldap_explode_dnA
関数DN文字列を構成要素の配列に分解する(ANSI版)。
シグネチャ
// WLDAP32.dll (ANSI / -A)
#include <windows.h>
LPSTR* ldap_explode_dnA(
LPCSTR dn,
DWORD notypes
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| dn | LPCSTR | in |
| notypes | DWORD | in |
戻り値の型: LPSTR*
各言語での呼び出し定義
// WLDAP32.dll (ANSI / -A)
#include <windows.h>
LPSTR* ldap_explode_dnA(
LPCSTR dn,
DWORD notypes
);[DllImport("WLDAP32.dll", CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr ldap_explode_dnA(
[MarshalAs(UnmanagedType.LPStr)] string dn, // LPCSTR
uint notypes // DWORD
);<DllImport("WLDAP32.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ldap_explode_dnA(
<MarshalAs(UnmanagedType.LPStr)> dn As String, ' LPCSTR
notypes As UInteger ' DWORD
) As IntPtr
End Function' dn : LPCSTR
' notypes : DWORD
Declare PtrSafe Function ldap_explode_dnA Lib "wldap32" ( _
ByVal dn As String, _
ByVal notypes As Long) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ldap_explode_dnA = ctypes.cdll.wldap32.ldap_explode_dnA
ldap_explode_dnA.restype = wintypes.LPSTR
ldap_explode_dnA.argtypes = [
wintypes.LPCSTR, # dn : LPCSTR
wintypes.DWORD, # notypes : DWORD
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('WLDAP32.dll')
ldap_explode_dnA = Fiddle::Function.new(
lib['ldap_explode_dnA'],
[
Fiddle::TYPE_VOIDP, # dn : LPCSTR
-Fiddle::TYPE_INT, # notypes : DWORD
],
Fiddle::TYPE_VOIDP, Fiddle::Function::CDECL)#[link(name = "wldap32")]
extern "C" {
fn ldap_explode_dnA(
dn: *const u8, // LPCSTR
notypes: u32 // DWORD
) -> *mut *mut u8;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("WLDAP32.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr ldap_explode_dnA([MarshalAs(UnmanagedType.LPStr)] string dn, uint notypes);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WLDAP32_ldap_explode_dnA' -Namespace Win32 -PassThru
# $api::ldap_explode_dnA(dn, notypes)#uselib "WLDAP32.dll"
#func global ldap_explode_dnA "ldap_explode_dnA" sptr, sptr
; ldap_explode_dnA dn, notypes ; 戻り値は stat
; dn : LPCSTR -> "sptr"
; notypes : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "WLDAP32.dll"
#cfunc global ldap_explode_dnA "ldap_explode_dnA" str, int
; res = ldap_explode_dnA(dn, notypes)
; dn : LPCSTR -> "str"
; notypes : DWORD -> "int"; LPSTR* ldap_explode_dnA(LPCSTR dn, DWORD notypes)
#uselib "WLDAP32.dll"
#cfunc global ldap_explode_dnA "ldap_explode_dnA" str, int
; res = ldap_explode_dnA(dn, notypes)
; dn : LPCSTR -> "str"
; notypes : DWORD -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
wldap32 = windows.NewLazySystemDLL("WLDAP32.dll")
procldap_explode_dnA = wldap32.NewProc("ldap_explode_dnA")
)
// dn (LPCSTR), notypes (DWORD)
r1, _, err := procldap_explode_dnA.Call(
uintptr(unsafe.Pointer(windows.BytePtrFromString(dn))),
uintptr(notypes),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // LPSTR*function ldap_explode_dnA(
dn: PAnsiChar; // LPCSTR
notypes: DWORD // DWORD
): PAnsiChar; cdecl;
external 'WLDAP32.dll' name 'ldap_explode_dnA';result := DllCall("WLDAP32\ldap_explode_dnA"
, "AStr", dn ; LPCSTR
, "UInt", notypes ; DWORD
, "Cdecl Ptr") ; return: LPSTR*●ldap_explode_dnA(dn, notypes) = DLL("WLDAP32.dll", "void* ldap_explode_dnA(char*, dword)")
# 呼び出し: ldap_explode_dnA(dn, notypes)
# dn : LPCSTR -> "char*"
# notypes : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。