ホーム › NetworkManagement.Rras › RasFreeEapUserIdentityA
RasFreeEapUserIdentityA
関数取得したEAPユーザーID構造体のメモリを解放する(ANSI版)。
シグネチャ
// RASAPI32.dll (ANSI / -A)
#include <windows.h>
void RasFreeEapUserIdentityA(
RASEAPUSERIDENTITYA* pRasEapUserIdentity
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| pRasEapUserIdentity | RASEAPUSERIDENTITYA* | in | RasGetEapUserIdentityAで確保したRASEAPUSERIDENTITYA構造体へのポインタ。これを解放する。 |
戻り値の型: void
各言語での呼び出し定義
// RASAPI32.dll (ANSI / -A)
#include <windows.h>
void RasFreeEapUserIdentityA(
RASEAPUSERIDENTITYA* pRasEapUserIdentity
);[DllImport("RASAPI32.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern void RasFreeEapUserIdentityA(
IntPtr pRasEapUserIdentity // RASEAPUSERIDENTITYA*
);<DllImport("RASAPI32.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Sub RasFreeEapUserIdentityA(
pRasEapUserIdentity As IntPtr ' RASEAPUSERIDENTITYA*
)
End Sub' pRasEapUserIdentity : RASEAPUSERIDENTITYA*
Declare PtrSafe Sub RasFreeEapUserIdentityA Lib "rasapi32" ( _
ByVal pRasEapUserIdentity As LongPtr)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
RasFreeEapUserIdentityA = ctypes.windll.rasapi32.RasFreeEapUserIdentityA
RasFreeEapUserIdentityA.restype = None
RasFreeEapUserIdentityA.argtypes = [
ctypes.c_void_p, # pRasEapUserIdentity : RASEAPUSERIDENTITYA*
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('RASAPI32.dll')
RasFreeEapUserIdentityA = Fiddle::Function.new(
lib['RasFreeEapUserIdentityA'],
[
Fiddle::TYPE_VOIDP, # pRasEapUserIdentity : RASEAPUSERIDENTITYA*
],
Fiddle::TYPE_VOID)#[link(name = "rasapi32")]
extern "system" {
fn RasFreeEapUserIdentityA(
pRasEapUserIdentity: *mut RASEAPUSERIDENTITYA // RASEAPUSERIDENTITYA*
);
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("RASAPI32.dll", CharSet = CharSet.Ansi)]
public static extern void RasFreeEapUserIdentityA(IntPtr pRasEapUserIdentity);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RASAPI32_RasFreeEapUserIdentityA' -Namespace Win32 -PassThru
# $api::RasFreeEapUserIdentityA(pRasEapUserIdentity)#uselib "RASAPI32.dll"
#func global RasFreeEapUserIdentityA "RasFreeEapUserIdentityA" sptr
; RasFreeEapUserIdentityA varptr(pRasEapUserIdentity)
; pRasEapUserIdentity : RASEAPUSERIDENTITYA* -> "sptr"出力引数:
#uselib "RASAPI32.dll" #func global RasFreeEapUserIdentityA "RasFreeEapUserIdentityA" var ; RasFreeEapUserIdentityA pRasEapUserIdentity ; pRasEapUserIdentity : RASEAPUSERIDENTITYA* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "RASAPI32.dll" #func global RasFreeEapUserIdentityA "RasFreeEapUserIdentityA" sptr ; RasFreeEapUserIdentityA varptr(pRasEapUserIdentity) ; pRasEapUserIdentity : RASEAPUSERIDENTITYA* -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; void RasFreeEapUserIdentityA(RASEAPUSERIDENTITYA* pRasEapUserIdentity) #uselib "RASAPI32.dll" #func global RasFreeEapUserIdentityA "RasFreeEapUserIdentityA" var ; RasFreeEapUserIdentityA pRasEapUserIdentity ; pRasEapUserIdentity : RASEAPUSERIDENTITYA* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; void RasFreeEapUserIdentityA(RASEAPUSERIDENTITYA* pRasEapUserIdentity) #uselib "RASAPI32.dll" #func global RasFreeEapUserIdentityA "RasFreeEapUserIdentityA" intptr ; RasFreeEapUserIdentityA varptr(pRasEapUserIdentity) ; pRasEapUserIdentity : RASEAPUSERIDENTITYA* -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
rasapi32 = windows.NewLazySystemDLL("RASAPI32.dll")
procRasFreeEapUserIdentityA = rasapi32.NewProc("RasFreeEapUserIdentityA")
)
// pRasEapUserIdentity (RASEAPUSERIDENTITYA*)
r1, _, err := procRasFreeEapUserIdentityA.Call(
uintptr(pRasEapUserIdentity),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // voidprocedure RasFreeEapUserIdentityA(
pRasEapUserIdentity: Pointer // RASEAPUSERIDENTITYA*
); stdcall;
external 'RASAPI32.dll' name 'RasFreeEapUserIdentityA';result := DllCall("RASAPI32\RasFreeEapUserIdentityA"
, "Ptr", pRasEapUserIdentity ; RASEAPUSERIDENTITYA*
, "Int") ; return: void●RasFreeEapUserIdentityA(pRasEapUserIdentity) = DLL("RASAPI32.dll", "int RasFreeEapUserIdentityA(void*)")
# 呼び出し: RasFreeEapUserIdentityA(pRasEapUserIdentity)
# pRasEapUserIdentity : RASEAPUSERIDENTITYA* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "rasapi32" fn RasFreeEapUserIdentityA(
pRasEapUserIdentity: [*c]RASEAPUSERIDENTITYA // RASEAPUSERIDENTITYA*
) callconv(std.os.windows.WINAPI) void;proc RasFreeEapUserIdentityA(
pRasEapUserIdentity: ptr RASEAPUSERIDENTITYA # RASEAPUSERIDENTITYA*
) {.importc: "RasFreeEapUserIdentityA", stdcall, dynlib: "RASAPI32.dll".}pragma(lib, "rasapi32");
extern(Windows)
void RasFreeEapUserIdentityA(
RASEAPUSERIDENTITYA* pRasEapUserIdentity // RASEAPUSERIDENTITYA*
);ccall((:RasFreeEapUserIdentityA, "RASAPI32.dll"), stdcall, Cvoid,
(Ptr{RASEAPUSERIDENTITYA},),
pRasEapUserIdentity)
# pRasEapUserIdentity : RASEAPUSERIDENTITYA* -> Ptr{RASEAPUSERIDENTITYA}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
void RasFreeEapUserIdentityA(
void* pRasEapUserIdentity);
]]
local rasapi32 = ffi.load("rasapi32")
-- rasapi32.RasFreeEapUserIdentityA(pRasEapUserIdentity)
-- pRasEapUserIdentity : RASEAPUSERIDENTITYA*
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('RASAPI32.dll');
const RasFreeEapUserIdentityA = lib.func('__stdcall', 'RasFreeEapUserIdentityA', 'void', ['void *']);
// RasFreeEapUserIdentityA(pRasEapUserIdentity)
// pRasEapUserIdentity : RASEAPUSERIDENTITYA* -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("RASAPI32.dll", {
RasFreeEapUserIdentityA: { parameters: ["pointer"], result: "void" },
});
// lib.symbols.RasFreeEapUserIdentityA(pRasEapUserIdentity)
// pRasEapUserIdentity : RASEAPUSERIDENTITYA* -> "pointer"
// 文字列は "buffer"。ANSI(-A) は new TextEncoder() で UTF-8/ANSI バイト列(末尾に \x00)を渡す。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
void RasFreeEapUserIdentityA(
void* pRasEapUserIdentity);
C, "RASAPI32.dll");
// $ffi->RasFreeEapUserIdentityA(pRasEapUserIdentity);
// pRasEapUserIdentity : RASEAPUSERIDENTITYA*
// 構造体/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 Rasapi32 extends StdCallLibrary {
Rasapi32 INSTANCE = Native.load("rasapi32", Rasapi32.class, W32APIOptions.ASCII_OPTIONS);
void RasFreeEapUserIdentityA(
Pointer pRasEapUserIdentity // RASEAPUSERIDENTITYA*
);
}@[Link("rasapi32")]
lib LibRASAPI32
fun RasFreeEapUserIdentityA = RasFreeEapUserIdentityA(
pRasEapUserIdentity : RASEAPUSERIDENTITYA* # RASEAPUSERIDENTITYA*
) : Void
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef RasFreeEapUserIdentityANative = Void Function(Pointer<Void>);
typedef RasFreeEapUserIdentityADart = void Function(Pointer<Void>);
final RasFreeEapUserIdentityA = DynamicLibrary.open('RASAPI32.dll')
.lookupFunction<RasFreeEapUserIdentityANative, RasFreeEapUserIdentityADart>('RasFreeEapUserIdentityA');
// pRasEapUserIdentity : RASEAPUSERIDENTITYA* -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
procedure RasFreeEapUserIdentityA(
pRasEapUserIdentity: Pointer // RASEAPUSERIDENTITYA*
); stdcall;
external 'RASAPI32.dll' name 'RasFreeEapUserIdentityA';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "RasFreeEapUserIdentityA"
c_RasFreeEapUserIdentityA :: Ptr () -> IO ()
-- pRasEapUserIdentity : RASEAPUSERIDENTITYA* -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let rasfreeeapuseridentitya =
foreign "RasFreeEapUserIdentityA"
((ptr void) @-> returning void)
(* pRasEapUserIdentity : RASEAPUSERIDENTITYA* -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library rasapi32 (t "RASAPI32.dll"))
(cffi:use-foreign-library rasapi32)
(cffi:defcfun ("RasFreeEapUserIdentityA" ras-free-eap-user-identity-a :convention :stdcall) :void
(p-ras-eap-user-identity :pointer)) ; RASEAPUSERIDENTITYA*
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $RasFreeEapUserIdentityA = Win32::API::More->new('RASAPI32',
'void RasFreeEapUserIdentityA(LPVOID pRasEapUserIdentity)');
# my $ret = $RasFreeEapUserIdentityA->Call($pRasEapUserIdentity);
# pRasEapUserIdentity : RASEAPUSERIDENTITYA* -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。関連項目
文字セット違い
- f RasFreeEapUserIdentityW (Unicode版) — 取得したEAPユーザーID構造体のメモリを解放する(Unicode版)。