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