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