ホーム › Globalization › uspoof_openFromSerialized
uspoof_openFromSerialized
関数直列化データから検査オブジェクトを復元生成する。
シグネチャ
// icuin.dll
#include <windows.h>
USpoofChecker* uspoof_openFromSerialized(
const void* data,
INT length,
INT* pActualLength,
UErrorCode* pErrorCode
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| data | void* | in |
| length | INT | in |
| pActualLength | INT* | inout |
| pErrorCode | UErrorCode* | inout |
戻り値の型: USpoofChecker*
各言語での呼び出し定義
// icuin.dll
#include <windows.h>
USpoofChecker* uspoof_openFromSerialized(
const void* data,
INT length,
INT* pActualLength,
UErrorCode* pErrorCode
);[DllImport("icuin.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr uspoof_openFromSerialized(
IntPtr data, // void*
int length, // INT
ref int pActualLength, // INT* in/out
ref int pErrorCode // UErrorCode* in/out
);<DllImport("icuin.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function uspoof_openFromSerialized(
data As IntPtr, ' void*
length As Integer, ' INT
ByRef pActualLength As Integer, ' INT* in/out
ByRef pErrorCode As Integer ' UErrorCode* in/out
) As IntPtr
End Function' data : void*
' length : INT
' pActualLength : INT* in/out
' pErrorCode : UErrorCode* in/out
Declare PtrSafe Function uspoof_openFromSerialized Lib "icuin" ( _
ByVal data As LongPtr, _
ByVal length As Long, _
ByRef pActualLength As Long, _
ByRef pErrorCode As Long) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
uspoof_openFromSerialized = ctypes.cdll.icuin.uspoof_openFromSerialized
uspoof_openFromSerialized.restype = ctypes.c_void_p
uspoof_openFromSerialized.argtypes = [
ctypes.POINTER(None), # data : void*
ctypes.c_int, # length : INT
ctypes.POINTER(ctypes.c_int), # pActualLength : INT* in/out
ctypes.c_void_p, # pErrorCode : UErrorCode* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('icuin.dll')
uspoof_openFromSerialized = Fiddle::Function.new(
lib['uspoof_openFromSerialized'],
[
Fiddle::TYPE_VOIDP, # data : void*
Fiddle::TYPE_INT, # length : INT
Fiddle::TYPE_VOIDP, # pActualLength : INT* in/out
Fiddle::TYPE_VOIDP, # pErrorCode : UErrorCode* in/out
],
Fiddle::TYPE_VOIDP, Fiddle::Function::CDECL)#[link(name = "icuin")]
extern "C" {
fn uspoof_openFromSerialized(
data: *const (), // void*
length: i32, // INT
pActualLength: *mut i32, // INT* in/out
pErrorCode: *mut i32 // UErrorCode* in/out
) -> *mut isize;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("icuin.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr uspoof_openFromSerialized(IntPtr data, int length, ref int pActualLength, ref int pErrorCode);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuin_uspoof_openFromSerialized' -Namespace Win32 -PassThru
# $api::uspoof_openFromSerialized(data, length, pActualLength, pErrorCode)#uselib "icuin.dll"
#func global uspoof_openFromSerialized "uspoof_openFromSerialized" sptr, sptr, sptr, sptr
; uspoof_openFromSerialized data, length, varptr(pActualLength), pErrorCode ; 戻り値は stat
; data : void* -> "sptr"
; length : INT -> "sptr"
; pActualLength : INT* in/out -> "sptr"
; pErrorCode : UErrorCode* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "icuin.dll" #cfunc global uspoof_openFromSerialized "uspoof_openFromSerialized" sptr, int, var, int ; res = uspoof_openFromSerialized(data, length, pActualLength, pErrorCode) ; data : void* -> "sptr" ; length : INT -> "int" ; pActualLength : INT* in/out -> "var" ; pErrorCode : UErrorCode* in/out -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "icuin.dll" #cfunc global uspoof_openFromSerialized "uspoof_openFromSerialized" sptr, int, sptr, int ; res = uspoof_openFromSerialized(data, length, varptr(pActualLength), pErrorCode) ; data : void* -> "sptr" ; length : INT -> "int" ; pActualLength : INT* in/out -> "sptr" ; pErrorCode : UErrorCode* in/out -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; USpoofChecker* uspoof_openFromSerialized(void* data, INT length, INT* pActualLength, UErrorCode* pErrorCode) #uselib "icuin.dll" #cfunc global uspoof_openFromSerialized "uspoof_openFromSerialized" intptr, int, var, int ; res = uspoof_openFromSerialized(data, length, pActualLength, pErrorCode) ; data : void* -> "intptr" ; length : INT -> "int" ; pActualLength : INT* in/out -> "var" ; pErrorCode : UErrorCode* in/out -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; USpoofChecker* uspoof_openFromSerialized(void* data, INT length, INT* pActualLength, UErrorCode* pErrorCode) #uselib "icuin.dll" #cfunc global uspoof_openFromSerialized "uspoof_openFromSerialized" intptr, int, intptr, int ; res = uspoof_openFromSerialized(data, length, varptr(pActualLength), pErrorCode) ; data : void* -> "intptr" ; length : INT -> "int" ; pActualLength : INT* in/out -> "intptr" ; pErrorCode : UErrorCode* in/out -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
icuin = windows.NewLazySystemDLL("icuin.dll")
procuspoof_openFromSerialized = icuin.NewProc("uspoof_openFromSerialized")
)
// data (void*), length (INT), pActualLength (INT* in/out), pErrorCode (UErrorCode* in/out)
r1, _, err := procuspoof_openFromSerialized.Call(
uintptr(data),
uintptr(length),
uintptr(pActualLength),
uintptr(pErrorCode),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // USpoofChecker*function uspoof_openFromSerialized(
data: Pointer; // void*
length: Integer; // INT
pActualLength: Pointer; // INT* in/out
pErrorCode: Pointer // UErrorCode* in/out
): Pointer; cdecl;
external 'icuin.dll' name 'uspoof_openFromSerialized';result := DllCall("icuin\uspoof_openFromSerialized"
, "Ptr", data ; void*
, "Int", length ; INT
, "Ptr", pActualLength ; INT* in/out
, "Ptr", pErrorCode ; UErrorCode* in/out
, "Cdecl Ptr") ; return: USpoofChecker*●uspoof_openFromSerialized(data, length, pActualLength, pErrorCode) = DLL("icuin.dll", "void* uspoof_openFromSerialized(void*, int, void*, void*)")
# 呼び出し: uspoof_openFromSerialized(data, length, pActualLength, pErrorCode)
# data : void* -> "void*"
# length : INT -> "int"
# pActualLength : INT* in/out -> "void*"
# pErrorCode : UErrorCode* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。