Win32 API 日本語リファレンス
ホームSystem.ErrorReporting › WerReportAddDump

WerReportAddDump

関数
WERレポートにプロセスのダンプを追加する。
DLLwer.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

HRESULT WerReportAddDump(
    HREPORT hReportHandle,
    HANDLE hProcess,
    HANDLE hThread,   // optional
    WER_DUMP_TYPE dumpType,
    WER_EXCEPTION_INFORMATION* pExceptionParam,   // optional
    WER_DUMP_CUSTOM_OPTIONS* pDumpCustomOptions,   // optional
    DWORD dwFlags
);

パラメーター

名前方向説明
hReportHandleHREPORTin対象レポートのHREPORTハンドル。
hProcessHANDLEinダンプ対象プロセスのハンドル。
hThreadHANDLEinoptional例外発生スレッドのハンドル。不要ならNULL可。
dumpTypeWER_DUMP_TYPEin生成するダンプの種類を指定するWER_DUMP_TYPE列挙値。
pExceptionParamWER_EXCEPTION_INFORMATION*inoptional例外情報を格納したWER_EXCEPTION_INFORMATIONへのポインタ。NULL可。
pDumpCustomOptionsWER_DUMP_CUSTOM_OPTIONS*inoptionalダンプのカスタムオプションを格納した構造体へのポインタ。NULL可。
dwFlagsDWORDinダンプ生成を制御するフラグ。

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT WerReportAddDump(
    HREPORT hReportHandle,
    HANDLE hProcess,
    HANDLE hThread,   // optional
    WER_DUMP_TYPE dumpType,
    WER_EXCEPTION_INFORMATION* pExceptionParam,   // optional
    WER_DUMP_CUSTOM_OPTIONS* pDumpCustomOptions,   // optional
    DWORD dwFlags
);
[DllImport("wer.dll", ExactSpelling = true)]
static extern int WerReportAddDump(
    IntPtr hReportHandle,   // HREPORT
    IntPtr hProcess,   // HANDLE
    IntPtr hThread,   // HANDLE optional
    int dumpType,   // WER_DUMP_TYPE
    IntPtr pExceptionParam,   // WER_EXCEPTION_INFORMATION* optional
    IntPtr pDumpCustomOptions,   // WER_DUMP_CUSTOM_OPTIONS* optional
    uint dwFlags   // DWORD
);
<DllImport("wer.dll", ExactSpelling:=True)>
Public Shared Function WerReportAddDump(
    hReportHandle As IntPtr,   ' HREPORT
    hProcess As IntPtr,   ' HANDLE
    hThread As IntPtr,   ' HANDLE optional
    dumpType As Integer,   ' WER_DUMP_TYPE
    pExceptionParam As IntPtr,   ' WER_EXCEPTION_INFORMATION* optional
    pDumpCustomOptions As IntPtr,   ' WER_DUMP_CUSTOM_OPTIONS* optional
    dwFlags As UInteger   ' DWORD
) As Integer
End Function
' hReportHandle : HREPORT
' hProcess : HANDLE
' hThread : HANDLE optional
' dumpType : WER_DUMP_TYPE
' pExceptionParam : WER_EXCEPTION_INFORMATION* optional
' pDumpCustomOptions : WER_DUMP_CUSTOM_OPTIONS* optional
' dwFlags : DWORD
Declare PtrSafe Function WerReportAddDump Lib "wer" ( _
    ByVal hReportHandle As LongPtr, _
    ByVal hProcess As LongPtr, _
    ByVal hThread As LongPtr, _
    ByVal dumpType As Long, _
    ByVal pExceptionParam As LongPtr, _
    ByVal pDumpCustomOptions As LongPtr, _
    ByVal dwFlags As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

WerReportAddDump = ctypes.windll.wer.WerReportAddDump
WerReportAddDump.restype = ctypes.c_int
WerReportAddDump.argtypes = [
    wintypes.HANDLE,  # hReportHandle : HREPORT
    wintypes.HANDLE,  # hProcess : HANDLE
    wintypes.HANDLE,  # hThread : HANDLE optional
    ctypes.c_int,  # dumpType : WER_DUMP_TYPE
    ctypes.c_void_p,  # pExceptionParam : WER_EXCEPTION_INFORMATION* optional
    ctypes.c_void_p,  # pDumpCustomOptions : WER_DUMP_CUSTOM_OPTIONS* optional
    wintypes.DWORD,  # dwFlags : DWORD
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('wer.dll')
WerReportAddDump = Fiddle::Function.new(
  lib['WerReportAddDump'],
  [
    Fiddle::TYPE_VOIDP,  # hReportHandle : HREPORT
    Fiddle::TYPE_VOIDP,  # hProcess : HANDLE
    Fiddle::TYPE_VOIDP,  # hThread : HANDLE optional
    Fiddle::TYPE_INT,  # dumpType : WER_DUMP_TYPE
    Fiddle::TYPE_VOIDP,  # pExceptionParam : WER_EXCEPTION_INFORMATION* optional
    Fiddle::TYPE_VOIDP,  # pDumpCustomOptions : WER_DUMP_CUSTOM_OPTIONS* optional
    -Fiddle::TYPE_INT,  # dwFlags : DWORD
  ],
  Fiddle::TYPE_INT)
#[link(name = "wer")]
extern "system" {
    fn WerReportAddDump(
        hReportHandle: *mut core::ffi::c_void,  // HREPORT
        hProcess: *mut core::ffi::c_void,  // HANDLE
        hThread: *mut core::ffi::c_void,  // HANDLE optional
        dumpType: i32,  // WER_DUMP_TYPE
        pExceptionParam: *mut WER_EXCEPTION_INFORMATION,  // WER_EXCEPTION_INFORMATION* optional
        pDumpCustomOptions: *mut WER_DUMP_CUSTOM_OPTIONS,  // WER_DUMP_CUSTOM_OPTIONS* optional
        dwFlags: u32  // DWORD
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("wer.dll")]
public static extern int WerReportAddDump(IntPtr hReportHandle, IntPtr hProcess, IntPtr hThread, int dumpType, IntPtr pExceptionParam, IntPtr pDumpCustomOptions, uint dwFlags);
"@
$api = Add-Type -MemberDefinition $sig -Name 'wer_WerReportAddDump' -Namespace Win32 -PassThru
# $api::WerReportAddDump(hReportHandle, hProcess, hThread, dumpType, pExceptionParam, pDumpCustomOptions, dwFlags)
#uselib "wer.dll"
#func global WerReportAddDump "WerReportAddDump" sptr, sptr, sptr, sptr, sptr, sptr, sptr
; WerReportAddDump hReportHandle, hProcess, hThread, dumpType, varptr(pExceptionParam), varptr(pDumpCustomOptions), dwFlags   ; 戻り値は stat
; hReportHandle : HREPORT -> "sptr"
; hProcess : HANDLE -> "sptr"
; hThread : HANDLE optional -> "sptr"
; dumpType : WER_DUMP_TYPE -> "sptr"
; pExceptionParam : WER_EXCEPTION_INFORMATION* optional -> "sptr"
; pDumpCustomOptions : WER_DUMP_CUSTOM_OPTIONS* optional -> "sptr"
; dwFlags : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "wer.dll"
#cfunc global WerReportAddDump "WerReportAddDump" sptr, sptr, sptr, int, var, var, int
; res = WerReportAddDump(hReportHandle, hProcess, hThread, dumpType, pExceptionParam, pDumpCustomOptions, dwFlags)
; hReportHandle : HREPORT -> "sptr"
; hProcess : HANDLE -> "sptr"
; hThread : HANDLE optional -> "sptr"
; dumpType : WER_DUMP_TYPE -> "int"
; pExceptionParam : WER_EXCEPTION_INFORMATION* optional -> "var"
; pDumpCustomOptions : WER_DUMP_CUSTOM_OPTIONS* optional -> "var"
; dwFlags : DWORD -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; HRESULT WerReportAddDump(HREPORT hReportHandle, HANDLE hProcess, HANDLE hThread, WER_DUMP_TYPE dumpType, WER_EXCEPTION_INFORMATION* pExceptionParam, WER_DUMP_CUSTOM_OPTIONS* pDumpCustomOptions, DWORD dwFlags)
#uselib "wer.dll"
#cfunc global WerReportAddDump "WerReportAddDump" intptr, intptr, intptr, int, var, var, int
; res = WerReportAddDump(hReportHandle, hProcess, hThread, dumpType, pExceptionParam, pDumpCustomOptions, dwFlags)
; hReportHandle : HREPORT -> "intptr"
; hProcess : HANDLE -> "intptr"
; hThread : HANDLE optional -> "intptr"
; dumpType : WER_DUMP_TYPE -> "int"
; pExceptionParam : WER_EXCEPTION_INFORMATION* optional -> "var"
; pDumpCustomOptions : WER_DUMP_CUSTOM_OPTIONS* optional -> "var"
; dwFlags : DWORD -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	wer = windows.NewLazySystemDLL("wer.dll")
	procWerReportAddDump = wer.NewProc("WerReportAddDump")
)

// hReportHandle (HREPORT), hProcess (HANDLE), hThread (HANDLE optional), dumpType (WER_DUMP_TYPE), pExceptionParam (WER_EXCEPTION_INFORMATION* optional), pDumpCustomOptions (WER_DUMP_CUSTOM_OPTIONS* optional), dwFlags (DWORD)
r1, _, err := procWerReportAddDump.Call(
	uintptr(hReportHandle),
	uintptr(hProcess),
	uintptr(hThread),
	uintptr(dumpType),
	uintptr(pExceptionParam),
	uintptr(pDumpCustomOptions),
	uintptr(dwFlags),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function WerReportAddDump(
  hReportHandle: THandle;   // HREPORT
  hProcess: THandle;   // HANDLE
  hThread: THandle;   // HANDLE optional
  dumpType: Integer;   // WER_DUMP_TYPE
  pExceptionParam: Pointer;   // WER_EXCEPTION_INFORMATION* optional
  pDumpCustomOptions: Pointer;   // WER_DUMP_CUSTOM_OPTIONS* optional
  dwFlags: DWORD   // DWORD
): Integer; stdcall;
  external 'wer.dll' name 'WerReportAddDump';
result := DllCall("wer\WerReportAddDump"
    , "Ptr", hReportHandle   ; HREPORT
    , "Ptr", hProcess   ; HANDLE
    , "Ptr", hThread   ; HANDLE optional
    , "Int", dumpType   ; WER_DUMP_TYPE
    , "Ptr", pExceptionParam   ; WER_EXCEPTION_INFORMATION* optional
    , "Ptr", pDumpCustomOptions   ; WER_DUMP_CUSTOM_OPTIONS* optional
    , "UInt", dwFlags   ; DWORD
    , "Int")   ; return: HRESULT
●WerReportAddDump(hReportHandle, hProcess, hThread, dumpType, pExceptionParam, pDumpCustomOptions, dwFlags) = DLL("wer.dll", "int WerReportAddDump(void*, void*, void*, int, void*, void*, dword)")
# 呼び出し: WerReportAddDump(hReportHandle, hProcess, hThread, dumpType, pExceptionParam, pDumpCustomOptions, dwFlags)
# hReportHandle : HREPORT -> "void*"
# hProcess : HANDLE -> "void*"
# hThread : HANDLE optional -> "void*"
# dumpType : WER_DUMP_TYPE -> "int"
# pExceptionParam : WER_EXCEPTION_INFORMATION* optional -> "void*"
# pDumpCustomOptions : WER_DUMP_CUSTOM_OPTIONS* optional -> "void*"
# dwFlags : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
const std = @import("std");

extern "wer" fn WerReportAddDump(
    hReportHandle: ?*anyopaque, // HREPORT
    hProcess: ?*anyopaque, // HANDLE
    hThread: ?*anyopaque, // HANDLE optional
    dumpType: i32, // WER_DUMP_TYPE
    pExceptionParam: [*c]WER_EXCEPTION_INFORMATION, // WER_EXCEPTION_INFORMATION* optional
    pDumpCustomOptions: [*c]WER_DUMP_CUSTOM_OPTIONS, // WER_DUMP_CUSTOM_OPTIONS* optional
    dwFlags: u32 // DWORD
) callconv(std.os.windows.WINAPI) i32;
proc WerReportAddDump(
    hReportHandle: pointer,  # HREPORT
    hProcess: pointer,  # HANDLE
    hThread: pointer,  # HANDLE optional
    dumpType: int32,  # WER_DUMP_TYPE
    pExceptionParam: ptr WER_EXCEPTION_INFORMATION,  # WER_EXCEPTION_INFORMATION* optional
    pDumpCustomOptions: ptr WER_DUMP_CUSTOM_OPTIONS,  # WER_DUMP_CUSTOM_OPTIONS* optional
    dwFlags: uint32  # DWORD
): int32 {.importc: "WerReportAddDump", stdcall, dynlib: "wer.dll".}
pragma(lib, "wer");
extern(Windows)
int WerReportAddDump(
    void* hReportHandle,   // HREPORT
    void* hProcess,   // HANDLE
    void* hThread,   // HANDLE optional
    int dumpType,   // WER_DUMP_TYPE
    WER_EXCEPTION_INFORMATION* pExceptionParam,   // WER_EXCEPTION_INFORMATION* optional
    WER_DUMP_CUSTOM_OPTIONS* pDumpCustomOptions,   // WER_DUMP_CUSTOM_OPTIONS* optional
    uint dwFlags   // DWORD
);
ccall((:WerReportAddDump, "wer.dll"), stdcall, Int32,
      (Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, Int32, Ptr{WER_EXCEPTION_INFORMATION}, Ptr{WER_DUMP_CUSTOM_OPTIONS}, UInt32),
      hReportHandle, hProcess, hThread, dumpType, pExceptionParam, pDumpCustomOptions, dwFlags)
# hReportHandle : HREPORT -> Ptr{Cvoid}
# hProcess : HANDLE -> Ptr{Cvoid}
# hThread : HANDLE optional -> Ptr{Cvoid}
# dumpType : WER_DUMP_TYPE -> Int32
# pExceptionParam : WER_EXCEPTION_INFORMATION* optional -> Ptr{WER_EXCEPTION_INFORMATION}
# pDumpCustomOptions : WER_DUMP_CUSTOM_OPTIONS* optional -> Ptr{WER_DUMP_CUSTOM_OPTIONS}
# dwFlags : DWORD -> UInt32
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
int32_t WerReportAddDump(
    void* hReportHandle,
    void* hProcess,
    void* hThread,
    int32_t dumpType,
    void* pExceptionParam,
    void* pDumpCustomOptions,
    uint32_t dwFlags);
]]
local wer = ffi.load("wer")
-- wer.WerReportAddDump(hReportHandle, hProcess, hThread, dumpType, pExceptionParam, pDumpCustomOptions, dwFlags)
-- hReportHandle : HREPORT
-- hProcess : HANDLE
-- hThread : HANDLE optional
-- dumpType : WER_DUMP_TYPE
-- pExceptionParam : WER_EXCEPTION_INFORMATION* optional
-- pDumpCustomOptions : WER_DUMP_CUSTOM_OPTIONS* optional
-- dwFlags : DWORD
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('wer.dll');
const WerReportAddDump = lib.func('__stdcall', 'WerReportAddDump', 'int32_t', ['void *', 'void *', 'void *', 'int32_t', 'void *', 'void *', 'uint32_t']);
// WerReportAddDump(hReportHandle, hProcess, hThread, dumpType, pExceptionParam, pDumpCustomOptions, dwFlags)
// hReportHandle : HREPORT -> 'void *'
// hProcess : HANDLE -> 'void *'
// hThread : HANDLE optional -> 'void *'
// dumpType : WER_DUMP_TYPE -> 'int32_t'
// pExceptionParam : WER_EXCEPTION_INFORMATION* optional -> 'void *'
// pDumpCustomOptions : WER_DUMP_CUSTOM_OPTIONS* optional -> 'void *'
// dwFlags : DWORD -> 'uint32_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("wer.dll", {
  WerReportAddDump: { parameters: ["pointer", "pointer", "pointer", "i32", "pointer", "pointer", "u32"], result: "i32" },
});
// lib.symbols.WerReportAddDump(hReportHandle, hProcess, hThread, dumpType, pExceptionParam, pDumpCustomOptions, dwFlags)
// hReportHandle : HREPORT -> "pointer"
// hProcess : HANDLE -> "pointer"
// hThread : HANDLE optional -> "pointer"
// dumpType : WER_DUMP_TYPE -> "i32"
// pExceptionParam : WER_EXCEPTION_INFORMATION* optional -> "pointer"
// pDumpCustomOptions : WER_DUMP_CUSTOM_OPTIONS* optional -> "pointer"
// dwFlags : DWORD -> "u32"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int32_t WerReportAddDump(
    void* hReportHandle,
    void* hProcess,
    void* hThread,
    int32_t dumpType,
    void* pExceptionParam,
    void* pDumpCustomOptions,
    uint32_t dwFlags);
C, "wer.dll");
// $ffi->WerReportAddDump(hReportHandle, hProcess, hThread, dumpType, pExceptionParam, pDumpCustomOptions, dwFlags);
// hReportHandle : HREPORT
// hProcess : HANDLE
// hThread : HANDLE optional
// dumpType : WER_DUMP_TYPE
// pExceptionParam : WER_EXCEPTION_INFORMATION* optional
// pDumpCustomOptions : WER_DUMP_CUSTOM_OPTIONS* optional
// dwFlags : DWORD
// 構造体/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 Wer extends StdCallLibrary {
    Wer INSTANCE = Native.load("wer", Wer.class);
    int WerReportAddDump(
        Pointer hReportHandle,   // HREPORT
        Pointer hProcess,   // HANDLE
        Pointer hThread,   // HANDLE optional
        int dumpType,   // WER_DUMP_TYPE
        Pointer pExceptionParam,   // WER_EXCEPTION_INFORMATION* optional
        Pointer pDumpCustomOptions,   // WER_DUMP_CUSTOM_OPTIONS* optional
        int dwFlags   // DWORD
    );
}
@[Link("wer")]
lib Libwer
  fun WerReportAddDump = WerReportAddDump(
    hReportHandle : Void*,   # HREPORT
    hProcess : Void*,   # HANDLE
    hThread : Void*,   # HANDLE optional
    dumpType : Int32,   # WER_DUMP_TYPE
    pExceptionParam : WER_EXCEPTION_INFORMATION*,   # WER_EXCEPTION_INFORMATION* optional
    pDumpCustomOptions : WER_DUMP_CUSTOM_OPTIONS*,   # WER_DUMP_CUSTOM_OPTIONS* optional
    dwFlags : UInt32   # DWORD
  ) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef WerReportAddDumpNative = Int32 Function(Pointer<Void>, Pointer<Void>, Pointer<Void>, Int32, Pointer<Void>, Pointer<Void>, Uint32);
typedef WerReportAddDumpDart = int Function(Pointer<Void>, Pointer<Void>, Pointer<Void>, int, Pointer<Void>, Pointer<Void>, int);
final WerReportAddDump = DynamicLibrary.open('wer.dll')
    .lookupFunction<WerReportAddDumpNative, WerReportAddDumpDart>('WerReportAddDump');
// hReportHandle : HREPORT -> Pointer<Void>
// hProcess : HANDLE -> Pointer<Void>
// hThread : HANDLE optional -> Pointer<Void>
// dumpType : WER_DUMP_TYPE -> Int32
// pExceptionParam : WER_EXCEPTION_INFORMATION* optional -> Pointer<Void>
// pDumpCustomOptions : WER_DUMP_CUSTOM_OPTIONS* optional -> Pointer<Void>
// dwFlags : DWORD -> Uint32
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function WerReportAddDump(
  hReportHandle: THandle;   // HREPORT
  hProcess: THandle;   // HANDLE
  hThread: THandle;   // HANDLE optional
  dumpType: Integer;   // WER_DUMP_TYPE
  pExceptionParam: Pointer;   // WER_EXCEPTION_INFORMATION* optional
  pDumpCustomOptions: Pointer;   // WER_DUMP_CUSTOM_OPTIONS* optional
  dwFlags: DWORD   // DWORD
): Integer; stdcall;
  external 'wer.dll' name 'WerReportAddDump';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "WerReportAddDump"
  c_WerReportAddDump :: Ptr () -> Ptr () -> Ptr () -> Int32 -> Ptr () -> Ptr () -> Word32 -> IO Int32
-- hReportHandle : HREPORT -> Ptr ()
-- hProcess : HANDLE -> Ptr ()
-- hThread : HANDLE optional -> Ptr ()
-- dumpType : WER_DUMP_TYPE -> Int32
-- pExceptionParam : WER_EXCEPTION_INFORMATION* optional -> Ptr ()
-- pDumpCustomOptions : WER_DUMP_CUSTOM_OPTIONS* optional -> Ptr ()
-- dwFlags : DWORD -> Word32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let werreportadddump =
  foreign "WerReportAddDump"
    ((ptr void) @-> (ptr void) @-> (ptr void) @-> int32_t @-> (ptr void) @-> (ptr void) @-> uint32_t @-> returning int32_t)
(* hReportHandle : HREPORT -> (ptr void) *)
(* hProcess : HANDLE -> (ptr void) *)
(* hThread : HANDLE optional -> (ptr void) *)
(* dumpType : WER_DUMP_TYPE -> int32_t *)
(* pExceptionParam : WER_EXCEPTION_INFORMATION* optional -> (ptr void) *)
(* pDumpCustomOptions : WER_DUMP_CUSTOM_OPTIONS* optional -> (ptr void) *)
(* dwFlags : DWORD -> uint32_t *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library wer (t "wer.dll"))
(cffi:use-foreign-library wer)

(cffi:defcfun ("WerReportAddDump" wer-report-add-dump :convention :stdcall) :int32
  (h-report-handle :pointer)   ; HREPORT
  (h-process :pointer)   ; HANDLE
  (h-thread :pointer)   ; HANDLE optional
  (dump-type :int32)   ; WER_DUMP_TYPE
  (p-exception-param :pointer)   ; WER_EXCEPTION_INFORMATION* optional
  (p-dump-custom-options :pointer)   ; WER_DUMP_CUSTOM_OPTIONS* optional
  (dw-flags :uint32))   ; DWORD
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $WerReportAddDump = Win32::API::More->new('wer',
    'int WerReportAddDump(HANDLE hReportHandle, HANDLE hProcess, HANDLE hThread, int dumpType, LPVOID pExceptionParam, LPVOID pDumpCustomOptions, DWORD dwFlags)');
# my $ret = $WerReportAddDump->Call($hReportHandle, $hProcess, $hThread, $dumpType, $pExceptionParam, $pDumpCustomOptions, $dwFlags);
# hReportHandle : HREPORT -> HANDLE
# hProcess : HANDLE -> HANDLE
# hThread : HANDLE optional -> HANDLE
# dumpType : WER_DUMP_TYPE -> int
# pExceptionParam : WER_EXCEPTION_INFORMATION* optional -> LPVOID
# pDumpCustomOptions : WER_DUMP_CUSTOM_OPTIONS* optional -> LPVOID
# dwFlags : DWORD -> DWORD
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

使用する型