ホーム › NetworkManagement.WindowsConnectionManager › WcmFreeMemory
WcmFreeMemory
関数WCM APIが割り当てたメモリを解放する。
シグネチャ
// wcmapi.dll
#include <windows.h>
void WcmFreeMemory(
void* pMemory
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pMemory | void* | out |
戻り値の型: void
各言語での呼び出し定義
// wcmapi.dll
#include <windows.h>
void WcmFreeMemory(
void* pMemory
);[DllImport("wcmapi.dll", ExactSpelling = true)]
static extern void WcmFreeMemory(
IntPtr pMemory // void* out
);<DllImport("wcmapi.dll", ExactSpelling:=True)>
Public Shared Sub WcmFreeMemory(
pMemory As IntPtr ' void* out
)
End Sub' pMemory : void* out
Declare PtrSafe Sub WcmFreeMemory Lib "wcmapi" ( _
ByVal pMemory As LongPtr)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
WcmFreeMemory = ctypes.windll.wcmapi.WcmFreeMemory
WcmFreeMemory.restype = None
WcmFreeMemory.argtypes = [
ctypes.POINTER(None), # pMemory : void* out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('wcmapi.dll')
WcmFreeMemory = Fiddle::Function.new(
lib['WcmFreeMemory'],
[
Fiddle::TYPE_VOIDP, # pMemory : void* out
],
Fiddle::TYPE_VOID)#[link(name = "wcmapi")]
extern "system" {
fn WcmFreeMemory(
pMemory: *mut () // void* out
);
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("wcmapi.dll")]
public static extern void WcmFreeMemory(IntPtr pMemory);
"@
$api = Add-Type -MemberDefinition $sig -Name 'wcmapi_WcmFreeMemory' -Namespace Win32 -PassThru
# $api::WcmFreeMemory(pMemory)#uselib "wcmapi.dll"
#func global WcmFreeMemory "WcmFreeMemory" sptr
; WcmFreeMemory pMemory
; pMemory : void* out -> "sptr"#uselib "wcmapi.dll"
#func global WcmFreeMemory "WcmFreeMemory" sptr
; WcmFreeMemory pMemory
; pMemory : void* out -> "sptr"; void WcmFreeMemory(void* pMemory)
#uselib "wcmapi.dll"
#func global WcmFreeMemory "WcmFreeMemory" intptr
; WcmFreeMemory pMemory
; pMemory : void* out -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
wcmapi = windows.NewLazySystemDLL("wcmapi.dll")
procWcmFreeMemory = wcmapi.NewProc("WcmFreeMemory")
)
// pMemory (void* out)
r1, _, err := procWcmFreeMemory.Call(
uintptr(pMemory),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // voidprocedure WcmFreeMemory(
pMemory: Pointer // void* out
); stdcall;
external 'wcmapi.dll' name 'WcmFreeMemory';result := DllCall("wcmapi\WcmFreeMemory"
, "Ptr", pMemory ; void* out
, "Int") ; return: void●WcmFreeMemory(pMemory) = DLL("wcmapi.dll", "int WcmFreeMemory(void*)")
# 呼び出し: WcmFreeMemory(pMemory)
# pMemory : void* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。