Win32 API 日本語リファレンス
ホームGlobalization › utrace_getFunctions

utrace_getFunctions

関数
登録済みのICUトレースコールバック関数を取得する。
DLLicuuc.dll呼出規約cdecl

シグネチャ

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

void utrace_getFunctions(
    const void** context,
    UTraceEntry* e,
    UTraceExit* x,
    UTraceData* d
);

パラメーター

名前方向説明
contextvoid**in現在のトレースコンテキストを受け取るポインタ。
eUTraceEntry*inout現在の入口コールバック(UTraceEntry)を受け取るポインタ。
xUTraceExit*inout現在の出口コールバック(UTraceExit)を受け取るポインタ。
dUTraceData*inout現在のデータコールバック(UTraceData)を受け取るポインタ。

戻り値の型: void

各言語での呼び出し定義

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

void utrace_getFunctions(
    const void** context,
    UTraceEntry* e,
    UTraceExit* x,
    UTraceData* d
);
[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern void utrace_getFunctions(
    IntPtr context,   // void**
    IntPtr e,   // UTraceEntry* in/out
    IntPtr x,   // UTraceExit* in/out
    IntPtr d   // UTraceData* in/out
);
<DllImport("icuuc.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Sub utrace_getFunctions(
    context As IntPtr,   ' void**
    e As IntPtr,   ' UTraceEntry* in/out
    x As IntPtr,   ' UTraceExit* in/out
    d As IntPtr   ' UTraceData* in/out
)
End Sub
' context : void**
' e : UTraceEntry* in/out
' x : UTraceExit* in/out
' d : UTraceData* in/out
Declare PtrSafe Sub utrace_getFunctions Lib "icuuc" ( _
    ByVal context As LongPtr, _
    ByVal e As LongPtr, _
    ByVal x As LongPtr, _
    ByVal d As LongPtr)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

utrace_getFunctions = ctypes.cdll.icuuc.utrace_getFunctions
utrace_getFunctions.restype = None
utrace_getFunctions.argtypes = [
    ctypes.c_void_p,  # context : void**
    ctypes.c_void_p,  # e : UTraceEntry* in/out
    ctypes.c_void_p,  # x : UTraceExit* in/out
    ctypes.c_void_p,  # d : UTraceData* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icuuc.dll')
utrace_getFunctions = Fiddle::Function.new(
  lib['utrace_getFunctions'],
  [
    Fiddle::TYPE_VOIDP,  # context : void**
    Fiddle::TYPE_VOIDP,  # e : UTraceEntry* in/out
    Fiddle::TYPE_VOIDP,  # x : UTraceExit* in/out
    Fiddle::TYPE_VOIDP,  # d : UTraceData* in/out
  ],
  Fiddle::TYPE_VOID, Fiddle::Function::CDECL)
#[link(name = "icuuc")]
extern "C" {
    fn utrace_getFunctions(
        context: *const *const (),  // void**
        e: *mut *const core::ffi::c_void,  // UTraceEntry* in/out
        x: *mut *const core::ffi::c_void,  // UTraceExit* in/out
        d: *mut *const core::ffi::c_void  // UTraceData* in/out
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("icuuc.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void utrace_getFunctions(IntPtr context, IntPtr e, IntPtr x, IntPtr d);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_utrace_getFunctions' -Namespace Win32 -PassThru
# $api::utrace_getFunctions(context, e, x, d)
#uselib "icuuc.dll"
#func global utrace_getFunctions "utrace_getFunctions" sptr, sptr, sptr, sptr
; utrace_getFunctions context, e, x, d
; context : void** -> "sptr"
; e : UTraceEntry* in/out -> "sptr"
; x : UTraceExit* in/out -> "sptr"
; d : UTraceData* in/out -> "sptr"
#uselib "icuuc.dll"
#func global utrace_getFunctions "utrace_getFunctions" sptr, sptr, sptr, sptr
; utrace_getFunctions context, e, x, d
; context : void** -> "sptr"
; e : UTraceEntry* in/out -> "sptr"
; x : UTraceExit* in/out -> "sptr"
; d : UTraceData* in/out -> "sptr"
; void utrace_getFunctions(void** context, UTraceEntry* e, UTraceExit* x, UTraceData* d)
#uselib "icuuc.dll"
#func global utrace_getFunctions "utrace_getFunctions" intptr, intptr, intptr, intptr
; utrace_getFunctions context, e, x, d
; context : void** -> "intptr"
; e : UTraceEntry* in/out -> "intptr"
; x : UTraceExit* in/out -> "intptr"
; d : UTraceData* in/out -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuuc = windows.NewLazySystemDLL("icuuc.dll")
	procutrace_getFunctions = icuuc.NewProc("utrace_getFunctions")
)

// context (void**), e (UTraceEntry* in/out), x (UTraceExit* in/out), d (UTraceData* in/out)
r1, _, err := procutrace_getFunctions.Call(
	uintptr(context),
	uintptr(e),
	uintptr(x),
	uintptr(d),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // void
procedure utrace_getFunctions(
  context: Pointer;   // void**
  e: Pointer;   // UTraceEntry* in/out
  x: Pointer;   // UTraceExit* in/out
  d: Pointer   // UTraceData* in/out
); cdecl;
  external 'icuuc.dll' name 'utrace_getFunctions';
result := DllCall("icuuc\utrace_getFunctions"
    , "Ptr", context   ; void**
    , "Ptr", e   ; UTraceEntry* in/out
    , "Ptr", x   ; UTraceExit* in/out
    , "Ptr", d   ; UTraceData* in/out
    , "Cdecl Int")   ; return: void
●utrace_getFunctions(context, e, x, d) = DLL("icuuc.dll", "int utrace_getFunctions(void*, void*, void*, void*)")
# 呼び出し: utrace_getFunctions(context, e, x, d)
# context : void** -> "void*"
# e : UTraceEntry* in/out -> "void*"
# x : UTraceExit* in/out -> "void*"
# d : UTraceData* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。
const std = @import("std");

extern "icuuc" fn utrace_getFunctions(
    context: ?*anyopaque, // void**
    e: ?*anyopaque, // UTraceEntry* in/out
    x: ?*anyopaque, // UTraceExit* in/out
    d: ?*anyopaque // UTraceData* in/out
) callconv(.c) void;
proc utrace_getFunctions(
    context: pointer,  # void**
    e: pointer,  # UTraceEntry* in/out
    x: pointer,  # UTraceExit* in/out
    d: pointer  # UTraceData* in/out
) {.importc: "utrace_getFunctions", cdecl, dynlib: "icuuc.dll".}
pragma(lib, "icuuc");
extern(C)
void utrace_getFunctions(
    void** context,   // void**
    void* e,   // UTraceEntry* in/out
    void* x,   // UTraceExit* in/out
    void* d   // UTraceData* in/out
);
ccall((:utrace_getFunctions, "icuuc.dll"), Cvoid,
      (Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}),
      context, e, x, d)
# context : void** -> Ptr{Cvoid}
# e : UTraceEntry* in/out -> Ptr{Cvoid}
# x : UTraceExit* in/out -> Ptr{Cvoid}
# d : UTraceData* in/out -> Ptr{Cvoid}
local ffi = require("ffi")
ffi.cdef[[
void utrace_getFunctions(
    void** context,
    void* e,
    void* x,
    void* d);
]]
local icuuc = ffi.load("icuuc")
-- icuuc.utrace_getFunctions(context, e, x, d)
-- context : void**
-- e : UTraceEntry* in/out
-- x : UTraceExit* in/out
-- d : UTraceData* in/out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('icuuc.dll');
const utrace_getFunctions = lib.func('__cdecl', 'utrace_getFunctions', 'void', ['void *', 'void *', 'void *', 'void *']);
// utrace_getFunctions(context, e, x, d)
// context : void** -> 'void *'
// e : UTraceEntry* in/out -> 'void *'
// x : UTraceExit* in/out -> 'void *'
// d : UTraceData* in/out -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
// コールバック(関数ポインタ)は koffi.proto/koffi.register で型を定義して渡す(素の void* では JS 関数を渡せない)。
const lib = Deno.dlopen("icuuc.dll", {
  utrace_getFunctions: { parameters: ["pointer", "pointer", "pointer", "pointer"], result: "void" },
});
// lib.symbols.utrace_getFunctions(context, e, x, d)
// context : void** -> "pointer"
// e : UTraceEntry* in/out -> "pointer"
// x : UTraceExit* in/out -> "pointer"
// d : UTraceData* in/out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
void utrace_getFunctions(
    void** context,
    void* e,
    void* x,
    void* d);
C, "icuuc.dll");
// $ffi->utrace_getFunctions(context, e, x, d);
// context : void**
// e : UTraceEntry* in/out
// x : UTraceExit* in/out
// d : UTraceData* in/out
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;

public interface Icuuc extends Library {
    Icuuc INSTANCE = Native.load("icuuc", Icuuc.class);
    void utrace_getFunctions(
        Pointer context,   // void**
        Callback e,   // UTraceEntry* in/out
        Callback x,   // UTraceExit* in/out
        Callback d   // UTraceData* in/out
    );
}
@[Link("icuuc")]
lib Libicuuc
  fun utrace_getFunctions = utrace_getFunctions(
    context : Void**,   # void**
    e : Void*,   # UTraceEntry* in/out
    x : Void*,   # UTraceExit* in/out
    d : Void*   # UTraceData* in/out
  ) : Void
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef utrace_getFunctionsNative = Void Function(Pointer<Void>, Pointer<Void>, Pointer<Void>, Pointer<Void>);
typedef utrace_getFunctionsDart = void Function(Pointer<Void>, Pointer<Void>, Pointer<Void>, Pointer<Void>);
final utrace_getFunctions = DynamicLibrary.open('icuuc.dll')
    .lookupFunction<utrace_getFunctionsNative, utrace_getFunctionsDart>('utrace_getFunctions');
// context : void** -> Pointer<Void>
// e : UTraceEntry* in/out -> Pointer<Void>
// x : UTraceExit* in/out -> Pointer<Void>
// d : UTraceData* in/out -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
procedure utrace_getFunctions(
  context: Pointer;   // void**
  e: Pointer;   // UTraceEntry* in/out
  x: Pointer;   // UTraceExit* in/out
  d: Pointer   // UTraceData* in/out
); cdecl;
  external 'icuuc.dll' name 'utrace_getFunctions';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import ccall safe "utrace_getFunctions"
  c_utrace_getFunctions :: Ptr () -> Ptr () -> Ptr () -> Ptr () -> IO ()
-- context : void** -> Ptr ()
-- e : UTraceEntry* in/out -> Ptr ()
-- x : UTraceExit* in/out -> Ptr ()
-- d : UTraceData* in/out -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let utrace_getfunctions =
  foreign "utrace_getFunctions"
    ((ptr void) @-> (ptr void) @-> (ptr void) @-> (ptr void) @-> returning void)
(* context : void** -> (ptr void) *)
(* e : UTraceEntry* in/out -> (ptr void) *)
(* x : UTraceExit* in/out -> (ptr void) *)
(* d : UTraceData* in/out -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library icuuc (t "icuuc.dll"))
(cffi:use-foreign-library icuuc)

(cffi:defcfun ("utrace_getFunctions" utrace-get-functions :convention :cdecl) :void
  (context :pointer)   ; void**
  (e :pointer)   ; UTraceEntry* in/out
  (x :pointer)   ; UTraceExit* in/out
  (d :pointer))   ; UTraceData* in/out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $utrace_getFunctions = Win32::API::More->new('icuuc',
    'void utrace_getFunctions(LPVOID context, LPVOID e, LPVOID x, LPVOID d)');
# my $ret = $utrace_getFunctions->Call($context, $e, $x, $d);
# context : void** -> LPVOID
# e : UTraceEntry* in/out -> LPVOID
# x : UTraceExit* in/out -> LPVOID
# d : UTraceData* in/out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。
# コールバック(関数ポインタ)は Perl sub を直接渡せません。Win32::API::Callback を使用してください。

関連項目

使用する型