ホーム › Networking.Ldap › ldap_memfreeW
ldap_memfreeW
関数LDAPが割り当てたメモリブロックを解放する(Unicode版)。
シグネチャ
// WLDAP32.dll (Unicode / -W)
#include <windows.h>
void ldap_memfreeW(
LPWSTR Block
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| Block | LPWSTR | in |
戻り値の型: void
各言語での呼び出し定義
// WLDAP32.dll (Unicode / -W)
#include <windows.h>
void ldap_memfreeW(
LPWSTR Block
);[DllImport("WLDAP32.dll", CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern void ldap_memfreeW(
[MarshalAs(UnmanagedType.LPWStr)] string Block // LPWSTR
);<DllImport("WLDAP32.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Sub ldap_memfreeW(
<MarshalAs(UnmanagedType.LPWStr)> Block As String ' LPWSTR
)
End Sub' Block : LPWSTR
Declare PtrSafe Sub ldap_memfreeW Lib "wldap32" ( _
ByVal Block 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_memfreeW = ctypes.cdll.wldap32.ldap_memfreeW
ldap_memfreeW.restype = None
ldap_memfreeW.argtypes = [
wintypes.LPCWSTR, # Block : LPWSTR
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('WLDAP32.dll')
ldap_memfreeW = Fiddle::Function.new(
lib['ldap_memfreeW'],
[
Fiddle::TYPE_VOIDP, # Block : LPWSTR
],
Fiddle::TYPE_VOID, Fiddle::Function::CDECL)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"#[link(name = "wldap32")]
extern "C" {
fn ldap_memfreeW(
Block: *mut u16 // LPWSTR
);
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("WLDAP32.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern void ldap_memfreeW([MarshalAs(UnmanagedType.LPWStr)] string Block);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WLDAP32_ldap_memfreeW' -Namespace Win32 -PassThru
# $api::ldap_memfreeW(Block)#uselib "WLDAP32.dll"
#func global ldap_memfreeW "ldap_memfreeW" wptr
; ldap_memfreeW Block
; Block : LPWSTR -> "wptr"#uselib "WLDAP32.dll"
#func global ldap_memfreeW "ldap_memfreeW" wstr
; ldap_memfreeW Block
; Block : LPWSTR -> "wstr"; void ldap_memfreeW(LPWSTR Block)
#uselib "WLDAP32.dll"
#func global ldap_memfreeW "ldap_memfreeW" wstr
; ldap_memfreeW Block
; Block : LPWSTR -> "wstr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
wldap32 = windows.NewLazySystemDLL("WLDAP32.dll")
procldap_memfreeW = wldap32.NewProc("ldap_memfreeW")
)
// Block (LPWSTR)
r1, _, err := procldap_memfreeW.Call(
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(Block))),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // voidprocedure ldap_memfreeW(
Block: PWideChar // LPWSTR
); cdecl;
external 'WLDAP32.dll' name 'ldap_memfreeW';result := DllCall("WLDAP32\ldap_memfreeW"
, "WStr", Block ; LPWSTR
, "Cdecl Int") ; return: void●ldap_memfreeW(Block) = DLL("WLDAP32.dll", "int ldap_memfreeW(char*)")
# 呼び出し: ldap_memfreeW(Block)
# Block : LPWSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。