ホーム › Security.DiagnosticDataQuery › DdqGetDiagnosticRecordProducers
DdqGetDiagnosticRecordProducers
関数診断レコードのプロデューサー記述を取得する。
シグネチャ
// DiagnosticDataQuery.dll
#include <windows.h>
HRESULT DdqGetDiagnosticRecordProducers(
HDIAGNOSTIC_DATA_QUERY_SESSION hSession,
HDIAGNOSTIC_EVENT_PRODUCER_DESCRIPTION* hProducerDescription
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hSession | HDIAGNOSTIC_DATA_QUERY_SESSION | in |
| hProducerDescription | HDIAGNOSTIC_EVENT_PRODUCER_DESCRIPTION* | out |
戻り値の型: HRESULT
各言語での呼び出し定義
// DiagnosticDataQuery.dll
#include <windows.h>
HRESULT DdqGetDiagnosticRecordProducers(
HDIAGNOSTIC_DATA_QUERY_SESSION hSession,
HDIAGNOSTIC_EVENT_PRODUCER_DESCRIPTION* hProducerDescription
);[DllImport("DiagnosticDataQuery.dll", ExactSpelling = true)]
static extern int DdqGetDiagnosticRecordProducers(
IntPtr hSession, // HDIAGNOSTIC_DATA_QUERY_SESSION
IntPtr hProducerDescription // HDIAGNOSTIC_EVENT_PRODUCER_DESCRIPTION* out
);<DllImport("DiagnosticDataQuery.dll", ExactSpelling:=True)>
Public Shared Function DdqGetDiagnosticRecordProducers(
hSession As IntPtr, ' HDIAGNOSTIC_DATA_QUERY_SESSION
hProducerDescription As IntPtr ' HDIAGNOSTIC_EVENT_PRODUCER_DESCRIPTION* out
) As Integer
End Function' hSession : HDIAGNOSTIC_DATA_QUERY_SESSION
' hProducerDescription : HDIAGNOSTIC_EVENT_PRODUCER_DESCRIPTION* out
Declare PtrSafe Function DdqGetDiagnosticRecordProducers Lib "diagnosticdataquery" ( _
ByVal hSession As LongPtr, _
ByVal hProducerDescription As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
DdqGetDiagnosticRecordProducers = ctypes.windll.diagnosticdataquery.DdqGetDiagnosticRecordProducers
DdqGetDiagnosticRecordProducers.restype = ctypes.c_int
DdqGetDiagnosticRecordProducers.argtypes = [
wintypes.HANDLE, # hSession : HDIAGNOSTIC_DATA_QUERY_SESSION
ctypes.c_void_p, # hProducerDescription : HDIAGNOSTIC_EVENT_PRODUCER_DESCRIPTION* out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('DiagnosticDataQuery.dll')
DdqGetDiagnosticRecordProducers = Fiddle::Function.new(
lib['DdqGetDiagnosticRecordProducers'],
[
Fiddle::TYPE_VOIDP, # hSession : HDIAGNOSTIC_DATA_QUERY_SESSION
Fiddle::TYPE_VOIDP, # hProducerDescription : HDIAGNOSTIC_EVENT_PRODUCER_DESCRIPTION* out
],
Fiddle::TYPE_INT)#[link(name = "diagnosticdataquery")]
extern "system" {
fn DdqGetDiagnosticRecordProducers(
hSession: *mut core::ffi::c_void, // HDIAGNOSTIC_DATA_QUERY_SESSION
hProducerDescription: *mut *mut core::ffi::c_void // HDIAGNOSTIC_EVENT_PRODUCER_DESCRIPTION* out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("DiagnosticDataQuery.dll")]
public static extern int DdqGetDiagnosticRecordProducers(IntPtr hSession, IntPtr hProducerDescription);
"@
$api = Add-Type -MemberDefinition $sig -Name 'DiagnosticDataQuery_DdqGetDiagnosticRecordProducers' -Namespace Win32 -PassThru
# $api::DdqGetDiagnosticRecordProducers(hSession, hProducerDescription)#uselib "DiagnosticDataQuery.dll"
#func global DdqGetDiagnosticRecordProducers "DdqGetDiagnosticRecordProducers" sptr, sptr
; DdqGetDiagnosticRecordProducers hSession, hProducerDescription ; 戻り値は stat
; hSession : HDIAGNOSTIC_DATA_QUERY_SESSION -> "sptr"
; hProducerDescription : HDIAGNOSTIC_EVENT_PRODUCER_DESCRIPTION* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "DiagnosticDataQuery.dll"
#cfunc global DdqGetDiagnosticRecordProducers "DdqGetDiagnosticRecordProducers" sptr, sptr
; res = DdqGetDiagnosticRecordProducers(hSession, hProducerDescription)
; hSession : HDIAGNOSTIC_DATA_QUERY_SESSION -> "sptr"
; hProducerDescription : HDIAGNOSTIC_EVENT_PRODUCER_DESCRIPTION* out -> "sptr"; HRESULT DdqGetDiagnosticRecordProducers(HDIAGNOSTIC_DATA_QUERY_SESSION hSession, HDIAGNOSTIC_EVENT_PRODUCER_DESCRIPTION* hProducerDescription)
#uselib "DiagnosticDataQuery.dll"
#cfunc global DdqGetDiagnosticRecordProducers "DdqGetDiagnosticRecordProducers" intptr, intptr
; res = DdqGetDiagnosticRecordProducers(hSession, hProducerDescription)
; hSession : HDIAGNOSTIC_DATA_QUERY_SESSION -> "intptr"
; hProducerDescription : HDIAGNOSTIC_EVENT_PRODUCER_DESCRIPTION* out -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
diagnosticdataquery = windows.NewLazySystemDLL("DiagnosticDataQuery.dll")
procDdqGetDiagnosticRecordProducers = diagnosticdataquery.NewProc("DdqGetDiagnosticRecordProducers")
)
// hSession (HDIAGNOSTIC_DATA_QUERY_SESSION), hProducerDescription (HDIAGNOSTIC_EVENT_PRODUCER_DESCRIPTION* out)
r1, _, err := procDdqGetDiagnosticRecordProducers.Call(
uintptr(hSession),
uintptr(hProducerDescription),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction DdqGetDiagnosticRecordProducers(
hSession: THandle; // HDIAGNOSTIC_DATA_QUERY_SESSION
hProducerDescription: Pointer // HDIAGNOSTIC_EVENT_PRODUCER_DESCRIPTION* out
): Integer; stdcall;
external 'DiagnosticDataQuery.dll' name 'DdqGetDiagnosticRecordProducers';result := DllCall("DiagnosticDataQuery\DdqGetDiagnosticRecordProducers"
, "Ptr", hSession ; HDIAGNOSTIC_DATA_QUERY_SESSION
, "Ptr", hProducerDescription ; HDIAGNOSTIC_EVENT_PRODUCER_DESCRIPTION* out
, "Int") ; return: HRESULT●DdqGetDiagnosticRecordProducers(hSession, hProducerDescription) = DLL("DiagnosticDataQuery.dll", "int DdqGetDiagnosticRecordProducers(void*, void*)")
# 呼び出し: DdqGetDiagnosticRecordProducers(hSession, hProducerDescription)
# hSession : HDIAGNOSTIC_DATA_QUERY_SESSION -> "void*"
# hProducerDescription : HDIAGNOSTIC_EVENT_PRODUCER_DESCRIPTION* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。