ホーム › Security.DiagnosticDataQuery › DdqGetDiagnosticRecordStats
DdqGetDiagnosticRecordStats
関数検索条件に一致する診断レコードの統計情報を取得する。
シグネチャ
// DiagnosticDataQuery.dll
#include <windows.h>
HRESULT DdqGetDiagnosticRecordStats(
HDIAGNOSTIC_DATA_QUERY_SESSION hSession,
const DIAGNOSTIC_DATA_SEARCH_CRITERIA* searchCriteria,
DWORD* recordCount,
LONGLONG* minRowId,
LONGLONG* maxRowId
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| hSession | HDIAGNOSTIC_DATA_QUERY_SESSION | in | 対象の診断データクエリセッションのハンドル。 |
| searchCriteria | DIAGNOSTIC_DATA_SEARCH_CRITERIA* | in | 検索条件を指定するDIAGNOSTIC_DATA_SEARCH_CRITERIA構造体へのポインタ。NULLで全件対象。 |
| recordCount | DWORD* | out | 条件に一致するレコード数を受け取るポインタ。 |
| minRowId | LONGLONG* | out | 条件範囲内の最小行IDを受け取るポインタ。 |
| maxRowId | LONGLONG* | out | 条件範囲内の最大行IDを受け取るポインタ。 |
戻り値の型: HRESULT
各言語での呼び出し定義
// DiagnosticDataQuery.dll
#include <windows.h>
HRESULT DdqGetDiagnosticRecordStats(
HDIAGNOSTIC_DATA_QUERY_SESSION hSession,
const DIAGNOSTIC_DATA_SEARCH_CRITERIA* searchCriteria,
DWORD* recordCount,
LONGLONG* minRowId,
LONGLONG* maxRowId
);[DllImport("DiagnosticDataQuery.dll", ExactSpelling = true)]
static extern int DdqGetDiagnosticRecordStats(
IntPtr hSession, // HDIAGNOSTIC_DATA_QUERY_SESSION
IntPtr searchCriteria, // DIAGNOSTIC_DATA_SEARCH_CRITERIA*
out uint recordCount, // DWORD* out
out long minRowId, // LONGLONG* out
out long maxRowId // LONGLONG* out
);<DllImport("DiagnosticDataQuery.dll", ExactSpelling:=True)>
Public Shared Function DdqGetDiagnosticRecordStats(
hSession As IntPtr, ' HDIAGNOSTIC_DATA_QUERY_SESSION
searchCriteria As IntPtr, ' DIAGNOSTIC_DATA_SEARCH_CRITERIA*
<Out> ByRef recordCount As UInteger, ' DWORD* out
<Out> ByRef minRowId As Long, ' LONGLONG* out
<Out> ByRef maxRowId As Long ' LONGLONG* out
) As Integer
End Function' hSession : HDIAGNOSTIC_DATA_QUERY_SESSION
' searchCriteria : DIAGNOSTIC_DATA_SEARCH_CRITERIA*
' recordCount : DWORD* out
' minRowId : LONGLONG* out
' maxRowId : LONGLONG* out
Declare PtrSafe Function DdqGetDiagnosticRecordStats Lib "diagnosticdataquery" ( _
ByVal hSession As LongPtr, _
ByVal searchCriteria As LongPtr, _
ByRef recordCount As Long, _
ByRef minRowId As LongLong, _
ByRef maxRowId As LongLong) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
DdqGetDiagnosticRecordStats = ctypes.windll.diagnosticdataquery.DdqGetDiagnosticRecordStats
DdqGetDiagnosticRecordStats.restype = ctypes.c_int
DdqGetDiagnosticRecordStats.argtypes = [
wintypes.HANDLE, # hSession : HDIAGNOSTIC_DATA_QUERY_SESSION
ctypes.c_void_p, # searchCriteria : DIAGNOSTIC_DATA_SEARCH_CRITERIA*
ctypes.POINTER(wintypes.DWORD), # recordCount : DWORD* out
ctypes.POINTER(ctypes.c_longlong), # minRowId : LONGLONG* out
ctypes.POINTER(ctypes.c_longlong), # maxRowId : LONGLONG* out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('DiagnosticDataQuery.dll')
DdqGetDiagnosticRecordStats = Fiddle::Function.new(
lib['DdqGetDiagnosticRecordStats'],
[
Fiddle::TYPE_VOIDP, # hSession : HDIAGNOSTIC_DATA_QUERY_SESSION
Fiddle::TYPE_VOIDP, # searchCriteria : DIAGNOSTIC_DATA_SEARCH_CRITERIA*
Fiddle::TYPE_VOIDP, # recordCount : DWORD* out
Fiddle::TYPE_VOIDP, # minRowId : LONGLONG* out
Fiddle::TYPE_VOIDP, # maxRowId : LONGLONG* out
],
Fiddle::TYPE_INT)#[link(name = "diagnosticdataquery")]
extern "system" {
fn DdqGetDiagnosticRecordStats(
hSession: *mut core::ffi::c_void, // HDIAGNOSTIC_DATA_QUERY_SESSION
searchCriteria: *const DIAGNOSTIC_DATA_SEARCH_CRITERIA, // DIAGNOSTIC_DATA_SEARCH_CRITERIA*
recordCount: *mut u32, // DWORD* out
minRowId: *mut i64, // LONGLONG* out
maxRowId: *mut i64 // LONGLONG* out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("DiagnosticDataQuery.dll")]
public static extern int DdqGetDiagnosticRecordStats(IntPtr hSession, IntPtr searchCriteria, out uint recordCount, out long minRowId, out long maxRowId);
"@
$api = Add-Type -MemberDefinition $sig -Name 'DiagnosticDataQuery_DdqGetDiagnosticRecordStats' -Namespace Win32 -PassThru
# $api::DdqGetDiagnosticRecordStats(hSession, searchCriteria, recordCount, minRowId, maxRowId)#uselib "DiagnosticDataQuery.dll"
#func global DdqGetDiagnosticRecordStats "DdqGetDiagnosticRecordStats" sptr, sptr, sptr, sptr, sptr
; DdqGetDiagnosticRecordStats hSession, varptr(searchCriteria), varptr(recordCount), varptr(minRowId), varptr(maxRowId) ; 戻り値は stat
; hSession : HDIAGNOSTIC_DATA_QUERY_SESSION -> "sptr"
; searchCriteria : DIAGNOSTIC_DATA_SEARCH_CRITERIA* -> "sptr"
; recordCount : DWORD* out -> "sptr"
; minRowId : LONGLONG* out -> "sptr"
; maxRowId : LONGLONG* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "DiagnosticDataQuery.dll" #cfunc global DdqGetDiagnosticRecordStats "DdqGetDiagnosticRecordStats" sptr, var, var, var, var ; res = DdqGetDiagnosticRecordStats(hSession, searchCriteria, recordCount, minRowId, maxRowId) ; hSession : HDIAGNOSTIC_DATA_QUERY_SESSION -> "sptr" ; searchCriteria : DIAGNOSTIC_DATA_SEARCH_CRITERIA* -> "var" ; recordCount : DWORD* out -> "var" ; minRowId : LONGLONG* out -> "var" ; maxRowId : LONGLONG* out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "DiagnosticDataQuery.dll" #cfunc global DdqGetDiagnosticRecordStats "DdqGetDiagnosticRecordStats" sptr, sptr, sptr, sptr, sptr ; res = DdqGetDiagnosticRecordStats(hSession, varptr(searchCriteria), varptr(recordCount), varptr(minRowId), varptr(maxRowId)) ; hSession : HDIAGNOSTIC_DATA_QUERY_SESSION -> "sptr" ; searchCriteria : DIAGNOSTIC_DATA_SEARCH_CRITERIA* -> "sptr" ; recordCount : DWORD* out -> "sptr" ; minRowId : LONGLONG* out -> "sptr" ; maxRowId : LONGLONG* out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; HRESULT DdqGetDiagnosticRecordStats(HDIAGNOSTIC_DATA_QUERY_SESSION hSession, DIAGNOSTIC_DATA_SEARCH_CRITERIA* searchCriteria, DWORD* recordCount, LONGLONG* minRowId, LONGLONG* maxRowId) #uselib "DiagnosticDataQuery.dll" #cfunc global DdqGetDiagnosticRecordStats "DdqGetDiagnosticRecordStats" intptr, var, var, var, var ; res = DdqGetDiagnosticRecordStats(hSession, searchCriteria, recordCount, minRowId, maxRowId) ; hSession : HDIAGNOSTIC_DATA_QUERY_SESSION -> "intptr" ; searchCriteria : DIAGNOSTIC_DATA_SEARCH_CRITERIA* -> "var" ; recordCount : DWORD* out -> "var" ; minRowId : LONGLONG* out -> "var" ; maxRowId : LONGLONG* out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HRESULT DdqGetDiagnosticRecordStats(HDIAGNOSTIC_DATA_QUERY_SESSION hSession, DIAGNOSTIC_DATA_SEARCH_CRITERIA* searchCriteria, DWORD* recordCount, LONGLONG* minRowId, LONGLONG* maxRowId) #uselib "DiagnosticDataQuery.dll" #cfunc global DdqGetDiagnosticRecordStats "DdqGetDiagnosticRecordStats" intptr, intptr, intptr, intptr, intptr ; res = DdqGetDiagnosticRecordStats(hSession, varptr(searchCriteria), varptr(recordCount), varptr(minRowId), varptr(maxRowId)) ; hSession : HDIAGNOSTIC_DATA_QUERY_SESSION -> "intptr" ; searchCriteria : DIAGNOSTIC_DATA_SEARCH_CRITERIA* -> "intptr" ; recordCount : DWORD* out -> "intptr" ; minRowId : LONGLONG* out -> "intptr" ; maxRowId : LONGLONG* out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
diagnosticdataquery = windows.NewLazySystemDLL("DiagnosticDataQuery.dll")
procDdqGetDiagnosticRecordStats = diagnosticdataquery.NewProc("DdqGetDiagnosticRecordStats")
)
// hSession (HDIAGNOSTIC_DATA_QUERY_SESSION), searchCriteria (DIAGNOSTIC_DATA_SEARCH_CRITERIA*), recordCount (DWORD* out), minRowId (LONGLONG* out), maxRowId (LONGLONG* out)
r1, _, err := procDdqGetDiagnosticRecordStats.Call(
uintptr(hSession),
uintptr(searchCriteria),
uintptr(recordCount),
uintptr(minRowId),
uintptr(maxRowId),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction DdqGetDiagnosticRecordStats(
hSession: THandle; // HDIAGNOSTIC_DATA_QUERY_SESSION
searchCriteria: Pointer; // DIAGNOSTIC_DATA_SEARCH_CRITERIA*
recordCount: Pointer; // DWORD* out
minRowId: Pointer; // LONGLONG* out
maxRowId: Pointer // LONGLONG* out
): Integer; stdcall;
external 'DiagnosticDataQuery.dll' name 'DdqGetDiagnosticRecordStats';result := DllCall("DiagnosticDataQuery\DdqGetDiagnosticRecordStats"
, "Ptr", hSession ; HDIAGNOSTIC_DATA_QUERY_SESSION
, "Ptr", searchCriteria ; DIAGNOSTIC_DATA_SEARCH_CRITERIA*
, "Ptr", recordCount ; DWORD* out
, "Ptr", minRowId ; LONGLONG* out
, "Ptr", maxRowId ; LONGLONG* out
, "Int") ; return: HRESULT●DdqGetDiagnosticRecordStats(hSession, searchCriteria, recordCount, minRowId, maxRowId) = DLL("DiagnosticDataQuery.dll", "int DdqGetDiagnosticRecordStats(void*, void*, void*, void*, void*)")
# 呼び出し: DdqGetDiagnosticRecordStats(hSession, searchCriteria, recordCount, minRowId, maxRowId)
# hSession : HDIAGNOSTIC_DATA_QUERY_SESSION -> "void*"
# searchCriteria : DIAGNOSTIC_DATA_SEARCH_CRITERIA* -> "void*"
# recordCount : DWORD* out -> "void*"
# minRowId : LONGLONG* out -> "void*"
# maxRowId : LONGLONG* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "diagnosticdataquery" fn DdqGetDiagnosticRecordStats(
hSession: ?*anyopaque, // HDIAGNOSTIC_DATA_QUERY_SESSION
searchCriteria: [*c]DIAGNOSTIC_DATA_SEARCH_CRITERIA, // DIAGNOSTIC_DATA_SEARCH_CRITERIA*
recordCount: [*c]u32, // DWORD* out
minRowId: [*c]i64, // LONGLONG* out
maxRowId: [*c]i64 // LONGLONG* out
) callconv(std.os.windows.WINAPI) i32;proc DdqGetDiagnosticRecordStats(
hSession: pointer, # HDIAGNOSTIC_DATA_QUERY_SESSION
searchCriteria: ptr DIAGNOSTIC_DATA_SEARCH_CRITERIA, # DIAGNOSTIC_DATA_SEARCH_CRITERIA*
recordCount: ptr uint32, # DWORD* out
minRowId: ptr int64, # LONGLONG* out
maxRowId: ptr int64 # LONGLONG* out
): int32 {.importc: "DdqGetDiagnosticRecordStats", stdcall, dynlib: "DiagnosticDataQuery.dll".}pragma(lib, "diagnosticdataquery");
extern(Windows)
int DdqGetDiagnosticRecordStats(
void* hSession, // HDIAGNOSTIC_DATA_QUERY_SESSION
DIAGNOSTIC_DATA_SEARCH_CRITERIA* searchCriteria, // DIAGNOSTIC_DATA_SEARCH_CRITERIA*
uint* recordCount, // DWORD* out
long* minRowId, // LONGLONG* out
long* maxRowId // LONGLONG* out
);ccall((:DdqGetDiagnosticRecordStats, "DiagnosticDataQuery.dll"), stdcall, Int32,
(Ptr{Cvoid}, Ptr{DIAGNOSTIC_DATA_SEARCH_CRITERIA}, Ptr{UInt32}, Ptr{Int64}, Ptr{Int64}),
hSession, searchCriteria, recordCount, minRowId, maxRowId)
# hSession : HDIAGNOSTIC_DATA_QUERY_SESSION -> Ptr{Cvoid}
# searchCriteria : DIAGNOSTIC_DATA_SEARCH_CRITERIA* -> Ptr{DIAGNOSTIC_DATA_SEARCH_CRITERIA}
# recordCount : DWORD* out -> Ptr{UInt32}
# minRowId : LONGLONG* out -> Ptr{Int64}
# maxRowId : LONGLONG* out -> Ptr{Int64}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
int32_t DdqGetDiagnosticRecordStats(
void* hSession,
void* searchCriteria,
uint32_t* recordCount,
int64_t* minRowId,
int64_t* maxRowId);
]]
local diagnosticdataquery = ffi.load("diagnosticdataquery")
-- diagnosticdataquery.DdqGetDiagnosticRecordStats(hSession, searchCriteria, recordCount, minRowId, maxRowId)
-- hSession : HDIAGNOSTIC_DATA_QUERY_SESSION
-- searchCriteria : DIAGNOSTIC_DATA_SEARCH_CRITERIA*
-- recordCount : DWORD* out
-- minRowId : LONGLONG* out
-- maxRowId : LONGLONG* out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('DiagnosticDataQuery.dll');
const DdqGetDiagnosticRecordStats = lib.func('__stdcall', 'DdqGetDiagnosticRecordStats', 'int32_t', ['void *', 'void *', 'uint32_t *', 'int64_t *', 'int64_t *']);
// DdqGetDiagnosticRecordStats(hSession, searchCriteria, recordCount, minRowId, maxRowId)
// hSession : HDIAGNOSTIC_DATA_QUERY_SESSION -> 'void *'
// searchCriteria : DIAGNOSTIC_DATA_SEARCH_CRITERIA* -> 'void *'
// recordCount : DWORD* out -> 'uint32_t *'
// minRowId : LONGLONG* out -> 'int64_t *'
// maxRowId : LONGLONG* out -> 'int64_t *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("DiagnosticDataQuery.dll", {
DdqGetDiagnosticRecordStats: { parameters: ["pointer", "pointer", "pointer", "pointer", "pointer"], result: "i32" },
});
// lib.symbols.DdqGetDiagnosticRecordStats(hSession, searchCriteria, recordCount, minRowId, maxRowId)
// hSession : HDIAGNOSTIC_DATA_QUERY_SESSION -> "pointer"
// searchCriteria : DIAGNOSTIC_DATA_SEARCH_CRITERIA* -> "pointer"
// recordCount : DWORD* out -> "pointer"
// minRowId : LONGLONG* out -> "pointer"
// maxRowId : LONGLONG* out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t DdqGetDiagnosticRecordStats(
void* hSession,
void* searchCriteria,
uint32_t* recordCount,
int64_t* minRowId,
int64_t* maxRowId);
C, "DiagnosticDataQuery.dll");
// $ffi->DdqGetDiagnosticRecordStats(hSession, searchCriteria, recordCount, minRowId, maxRowId);
// hSession : HDIAGNOSTIC_DATA_QUERY_SESSION
// searchCriteria : DIAGNOSTIC_DATA_SEARCH_CRITERIA*
// recordCount : DWORD* out
// minRowId : LONGLONG* out
// maxRowId : LONGLONG* out
// 構造体/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 Diagnosticdataquery extends StdCallLibrary {
Diagnosticdataquery INSTANCE = Native.load("diagnosticdataquery", Diagnosticdataquery.class);
int DdqGetDiagnosticRecordStats(
Pointer hSession, // HDIAGNOSTIC_DATA_QUERY_SESSION
Pointer searchCriteria, // DIAGNOSTIC_DATA_SEARCH_CRITERIA*
IntByReference recordCount, // DWORD* out
LongByReference minRowId, // LONGLONG* out
LongByReference maxRowId // LONGLONG* out
);
}@[Link("diagnosticdataquery")]
lib LibDiagnosticDataQuery
fun DdqGetDiagnosticRecordStats = DdqGetDiagnosticRecordStats(
hSession : Void*, # HDIAGNOSTIC_DATA_QUERY_SESSION
searchCriteria : DIAGNOSTIC_DATA_SEARCH_CRITERIA*, # DIAGNOSTIC_DATA_SEARCH_CRITERIA*
recordCount : UInt32*, # DWORD* out
minRowId : Int64*, # LONGLONG* out
maxRowId : Int64* # LONGLONG* out
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef DdqGetDiagnosticRecordStatsNative = Int32 Function(Pointer<Void>, Pointer<Void>, Pointer<Uint32>, Pointer<Int64>, Pointer<Int64>);
typedef DdqGetDiagnosticRecordStatsDart = int Function(Pointer<Void>, Pointer<Void>, Pointer<Uint32>, Pointer<Int64>, Pointer<Int64>);
final DdqGetDiagnosticRecordStats = DynamicLibrary.open('DiagnosticDataQuery.dll')
.lookupFunction<DdqGetDiagnosticRecordStatsNative, DdqGetDiagnosticRecordStatsDart>('DdqGetDiagnosticRecordStats');
// hSession : HDIAGNOSTIC_DATA_QUERY_SESSION -> Pointer<Void>
// searchCriteria : DIAGNOSTIC_DATA_SEARCH_CRITERIA* -> Pointer<Void>
// recordCount : DWORD* out -> Pointer<Uint32>
// minRowId : LONGLONG* out -> Pointer<Int64>
// maxRowId : LONGLONG* out -> Pointer<Int64>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function DdqGetDiagnosticRecordStats(
hSession: THandle; // HDIAGNOSTIC_DATA_QUERY_SESSION
searchCriteria: Pointer; // DIAGNOSTIC_DATA_SEARCH_CRITERIA*
recordCount: Pointer; // DWORD* out
minRowId: Pointer; // LONGLONG* out
maxRowId: Pointer // LONGLONG* out
): Integer; stdcall;
external 'DiagnosticDataQuery.dll' name 'DdqGetDiagnosticRecordStats';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "DdqGetDiagnosticRecordStats"
c_DdqGetDiagnosticRecordStats :: Ptr () -> Ptr () -> Ptr Word32 -> Ptr Int64 -> Ptr Int64 -> IO Int32
-- hSession : HDIAGNOSTIC_DATA_QUERY_SESSION -> Ptr ()
-- searchCriteria : DIAGNOSTIC_DATA_SEARCH_CRITERIA* -> Ptr ()
-- recordCount : DWORD* out -> Ptr Word32
-- minRowId : LONGLONG* out -> Ptr Int64
-- maxRowId : LONGLONG* out -> Ptr Int64
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let ddqgetdiagnosticrecordstats =
foreign "DdqGetDiagnosticRecordStats"
((ptr void) @-> (ptr void) @-> (ptr uint32_t) @-> (ptr int64_t) @-> (ptr int64_t) @-> returning int32_t)
(* hSession : HDIAGNOSTIC_DATA_QUERY_SESSION -> (ptr void) *)
(* searchCriteria : DIAGNOSTIC_DATA_SEARCH_CRITERIA* -> (ptr void) *)
(* recordCount : DWORD* out -> (ptr uint32_t) *)
(* minRowId : LONGLONG* out -> (ptr int64_t) *)
(* maxRowId : LONGLONG* out -> (ptr int64_t) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library diagnosticdataquery (t "DiagnosticDataQuery.dll"))
(cffi:use-foreign-library diagnosticdataquery)
(cffi:defcfun ("DdqGetDiagnosticRecordStats" ddq-get-diagnostic-record-stats :convention :stdcall) :int32
(h-session :pointer) ; HDIAGNOSTIC_DATA_QUERY_SESSION
(search-criteria :pointer) ; DIAGNOSTIC_DATA_SEARCH_CRITERIA*
(record-count :pointer) ; DWORD* out
(min-row-id :pointer) ; LONGLONG* out
(max-row-id :pointer)) ; LONGLONG* out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $DdqGetDiagnosticRecordStats = Win32::API::More->new('DiagnosticDataQuery',
'int DdqGetDiagnosticRecordStats(HANDLE hSession, LPVOID searchCriteria, LPVOID recordCount, LPVOID minRowId, LPVOID maxRowId)');
# my $ret = $DdqGetDiagnosticRecordStats->Call($hSession, $searchCriteria, $recordCount, $minRowId, $maxRowId);
# hSession : HDIAGNOSTIC_DATA_QUERY_SESSION -> HANDLE
# searchCriteria : DIAGNOSTIC_DATA_SEARCH_CRITERIA* -> LPVOID
# recordCount : DWORD* out -> LPVOID
# minRowId : LONGLONG* out -> LPVOID
# maxRowId : LONGLONG* out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。