Win32 API 日本語リファレンス
ホームSecurity.ExtensibleAuthenticationProtocol › EapHostPeerFreeMemory

EapHostPeerFreeMemory

関数
EAPホストAPIが割り当てたメモリを解放する。
DLLeappcfg.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

void EapHostPeerFreeMemory(
    BYTE* pData
);

パラメーター

名前方向説明
pDataBYTE*inoutEAPHost APIが割り当てたメモリブロックへのポインタ。これを解放する。

戻り値の型: void

各言語での呼び出し定義

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

void EapHostPeerFreeMemory(
    BYTE* pData
);
[DllImport("eappcfg.dll", ExactSpelling = true)]
static extern void EapHostPeerFreeMemory(
    IntPtr pData   // BYTE* in/out
);
<DllImport("eappcfg.dll", ExactSpelling:=True)>
Public Shared Sub EapHostPeerFreeMemory(
    pData As IntPtr   ' BYTE* in/out
)
End Sub
' pData : BYTE* in/out
Declare PtrSafe Sub EapHostPeerFreeMemory Lib "eappcfg" ( _
    ByVal pData As LongPtr)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

EapHostPeerFreeMemory = ctypes.windll.eappcfg.EapHostPeerFreeMemory
EapHostPeerFreeMemory.restype = None
EapHostPeerFreeMemory.argtypes = [
    ctypes.POINTER(ctypes.c_ubyte),  # pData : BYTE* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('eappcfg.dll')
EapHostPeerFreeMemory = Fiddle::Function.new(
  lib['EapHostPeerFreeMemory'],
  [
    Fiddle::TYPE_VOIDP,  # pData : BYTE* in/out
  ],
  Fiddle::TYPE_VOID)
#[link(name = "eappcfg")]
extern "system" {
    fn EapHostPeerFreeMemory(
        pData: *mut u8  // BYTE* in/out
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("eappcfg.dll")]
public static extern void EapHostPeerFreeMemory(IntPtr pData);
"@
$api = Add-Type -MemberDefinition $sig -Name 'eappcfg_EapHostPeerFreeMemory' -Namespace Win32 -PassThru
# $api::EapHostPeerFreeMemory(pData)
#uselib "eappcfg.dll"
#func global EapHostPeerFreeMemory "EapHostPeerFreeMemory" sptr
; EapHostPeerFreeMemory varptr(pData)
; pData : BYTE* in/out -> "sptr"
出力引数:
#uselib "eappcfg.dll"
#func global EapHostPeerFreeMemory "EapHostPeerFreeMemory" var
; EapHostPeerFreeMemory pData
; pData : BYTE* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; void EapHostPeerFreeMemory(BYTE* pData)
#uselib "eappcfg.dll"
#func global EapHostPeerFreeMemory "EapHostPeerFreeMemory" var
; EapHostPeerFreeMemory pData
; pData : BYTE* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	eappcfg = windows.NewLazySystemDLL("eappcfg.dll")
	procEapHostPeerFreeMemory = eappcfg.NewProc("EapHostPeerFreeMemory")
)

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

extern "eappcfg" fn EapHostPeerFreeMemory(
    pData: [*c]u8 // BYTE* in/out
) callconv(std.os.windows.WINAPI) void;
proc EapHostPeerFreeMemory(
    pData: ptr uint8  # BYTE* in/out
) {.importc: "EapHostPeerFreeMemory", stdcall, dynlib: "eappcfg.dll".}
pragma(lib, "eappcfg");
extern(Windows)
void EapHostPeerFreeMemory(
    ubyte* pData   // BYTE* in/out
);
ccall((:EapHostPeerFreeMemory, "eappcfg.dll"), stdcall, Cvoid,
      (Ptr{UInt8},),
      pData)
# pData : BYTE* in/out -> Ptr{UInt8}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
void EapHostPeerFreeMemory(
    uint8_t* pData);
]]
local eappcfg = ffi.load("eappcfg")
-- eappcfg.EapHostPeerFreeMemory(pData)
-- pData : BYTE* in/out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('eappcfg.dll');
const EapHostPeerFreeMemory = lib.func('__stdcall', 'EapHostPeerFreeMemory', 'void', ['uint8_t *']);
// EapHostPeerFreeMemory(pData)
// pData : BYTE* in/out -> 'uint8_t *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("eappcfg.dll", {
  EapHostPeerFreeMemory: { parameters: ["pointer"], result: "void" },
});
// lib.symbols.EapHostPeerFreeMemory(pData)
// pData : BYTE* in/out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
void EapHostPeerFreeMemory(
    uint8_t* pData);
C, "eappcfg.dll");
// $ffi->EapHostPeerFreeMemory(pData);
// pData : BYTE* in/out
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。
import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;

public interface Eappcfg extends StdCallLibrary {
    Eappcfg INSTANCE = Native.load("eappcfg", Eappcfg.class);
    void EapHostPeerFreeMemory(
        byte[] pData   // BYTE* in/out
    );
}
@[Link("eappcfg")]
lib Libeappcfg
  fun EapHostPeerFreeMemory = EapHostPeerFreeMemory(
    pData : UInt8*   # BYTE* in/out
  ) : Void
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef EapHostPeerFreeMemoryNative = Void Function(Pointer<Uint8>);
typedef EapHostPeerFreeMemoryDart = void Function(Pointer<Uint8>);
final EapHostPeerFreeMemory = DynamicLibrary.open('eappcfg.dll')
    .lookupFunction<EapHostPeerFreeMemoryNative, EapHostPeerFreeMemoryDart>('EapHostPeerFreeMemory');
// pData : BYTE* in/out -> Pointer<Uint8>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
procedure EapHostPeerFreeMemory(
  pData: Pointer   // BYTE* in/out
); stdcall;
  external 'eappcfg.dll' name 'EapHostPeerFreeMemory';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "EapHostPeerFreeMemory"
  c_EapHostPeerFreeMemory :: Ptr Word8 -> IO ()
-- pData : BYTE* in/out -> Ptr Word8
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let eaphostpeerfreememory =
  foreign "EapHostPeerFreeMemory"
    ((ptr uint8_t) @-> returning void)
(* pData : BYTE* in/out -> (ptr uint8_t) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library eappcfg (t "eappcfg.dll"))
(cffi:use-foreign-library eappcfg)

(cffi:defcfun ("EapHostPeerFreeMemory" eap-host-peer-free-memory :convention :stdcall) :void
  (p-data :pointer))   ; BYTE* in/out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $EapHostPeerFreeMemory = Win32::API::More->new('eappcfg',
    'void EapHostPeerFreeMemory(LPVOID pData)');
# my $ret = $EapHostPeerFreeMemory->Call($pData);
# pData : BYTE* in/out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。