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

FreeADsMem

関数
AllocADsMemで確保したメモリを解放する。
DLLACTIVEDS.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

// ACTIVEDS.dll
#include <windows.h>

BOOL FreeADsMem(
    void* pMem
);

パラメーター

名前方向
pMemvoid*inout

戻り値の型: BOOL

各言語での呼び出し定義

// ACTIVEDS.dll
#include <windows.h>

BOOL FreeADsMem(
    void* pMem
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("ACTIVEDS.dll", ExactSpelling = true)]
static extern bool FreeADsMem(
    IntPtr pMem   // void* in/out
);
<DllImport("ACTIVEDS.dll", ExactSpelling:=True)>
Public Shared Function FreeADsMem(
    pMem As IntPtr   ' void* in/out
) As Boolean
End Function
' pMem : void* in/out
Declare PtrSafe Function FreeADsMem Lib "activeds" ( _
    ByVal pMem As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

FreeADsMem = ctypes.windll.activeds.FreeADsMem
FreeADsMem.restype = wintypes.BOOL
FreeADsMem.argtypes = [
    ctypes.POINTER(None),  # pMem : void* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('ACTIVEDS.dll')
FreeADsMem = Fiddle::Function.new(
  lib['FreeADsMem'],
  [
    Fiddle::TYPE_VOIDP,  # pMem : void* in/out
  ],
  Fiddle::TYPE_INT)
#[link(name = "activeds")]
extern "system" {
    fn FreeADsMem(
        pMem: *mut ()  // void* in/out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("ACTIVEDS.dll")]
public static extern bool FreeADsMem(IntPtr pMem);
"@
$api = Add-Type -MemberDefinition $sig -Name 'ACTIVEDS_FreeADsMem' -Namespace Win32 -PassThru
# $api::FreeADsMem(pMem)
#uselib "ACTIVEDS.dll"
#func global FreeADsMem "FreeADsMem" sptr
; FreeADsMem pMem   ; 戻り値は stat
; pMem : void* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "ACTIVEDS.dll"
#cfunc global FreeADsMem "FreeADsMem" sptr
; res = FreeADsMem(pMem)
; pMem : void* in/out -> "sptr"
; BOOL FreeADsMem(void* pMem)
#uselib "ACTIVEDS.dll"
#cfunc global FreeADsMem "FreeADsMem" intptr
; res = FreeADsMem(pMem)
; pMem : void* in/out -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	activeds = windows.NewLazySystemDLL("ACTIVEDS.dll")
	procFreeADsMem = activeds.NewProc("FreeADsMem")
)

// pMem (void* in/out)
r1, _, err := procFreeADsMem.Call(
	uintptr(pMem),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function FreeADsMem(
  pMem: Pointer   // void* in/out
): BOOL; stdcall;
  external 'ACTIVEDS.dll' name 'FreeADsMem';
result := DllCall("ACTIVEDS\FreeADsMem"
    , "Ptr", pMem   ; void* in/out
    , "Int")   ; return: BOOL
●FreeADsMem(pMem) = DLL("ACTIVEDS.dll", "bool FreeADsMem(void*)")
# 呼び出し: FreeADsMem(pMem)
# pMem : void* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。