ホーム › System.Performance › PDH_LOG_SERVICE_QUERY_INFO_W
PDH_LOG_SERVICE_QUERY_INFO_W
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwSize | DWORD | 4 | +0 | +0 | この構造体のバイトサイズである。 |
| dwFlags | DWORD | 4 | +4 | +4 | ログサービス問い合わせの動作フラグである。 |
| dwLogQuota | DWORD | 4 | +8 | +8 | ログファイルの最大サイズ(クォータ)である。 |
| szLogFileCaption | LPWSTR | 8/4 | +16 | +12 | ログファイルのキャプション文字列(ワイド)である。 |
| szDefaultDir | LPWSTR | 8/4 | +24 | +16 | ログの既定ディレクトリ(ワイド)である。 |
| szBaseFileName | LPWSTR | 8/4 | +32 | +20 | ログのベースファイル名(ワイド)である。 |
| dwFileType | DWORD | 4 | +40 | +24 | ログファイルの種別である。 |
| dwReserved | DWORD | 4 | +44 | +28 | 予約フィールドである。0となる。 |
| Anonymous | _Anonymous_e__Union | 8/4 | +48 | +32 | ログ種別に応じた追加情報(PDL/カウンタ数等)を保持する共用体である。 |
共用体: _Anonymous_e__Union x64 8B / x86 4B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| Anonymous1 | _Anonymous1_e__Struct | 8/4 | +0 | +0 |
| Anonymous2 | _Anonymous2_e__Struct | 8/4 | +0 | +0 |
各言語での定義
#include <windows.h>
// PDH_LOG_SERVICE_QUERY_INFO_W (x64 56 / x86 36 バイト)
typedef struct PDH_LOG_SERVICE_QUERY_INFO_W {
DWORD dwSize;
DWORD dwFlags;
DWORD dwLogQuota;
LPWSTR szLogFileCaption;
LPWSTR szDefaultDir;
LPWSTR szBaseFileName;
DWORD dwFileType;
DWORD dwReserved;
_Anonymous_e__Union Anonymous;
} PDH_LOG_SERVICE_QUERY_INFO_W;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct PDH_LOG_SERVICE_QUERY_INFO_W
{
public uint dwSize;
public uint dwFlags;
public uint dwLogQuota;
public IntPtr szLogFileCaption;
public IntPtr szDefaultDir;
public IntPtr szBaseFileName;
public uint dwFileType;
public uint dwReserved;
public _Anonymous_e__Union Anonymous;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure PDH_LOG_SERVICE_QUERY_INFO_W
Public dwSize As UInteger
Public dwFlags As UInteger
Public dwLogQuota As UInteger
Public szLogFileCaption As IntPtr
Public szDefaultDir As IntPtr
Public szBaseFileName As IntPtr
Public dwFileType As UInteger
Public dwReserved As UInteger
Public Anonymous As _Anonymous_e__Union
End Structureimport ctypes
from ctypes import wintypes
class PDH_LOG_SERVICE_QUERY_INFO_W(ctypes.Structure):
_fields_ = [
("dwSize", wintypes.DWORD),
("dwFlags", wintypes.DWORD),
("dwLogQuota", wintypes.DWORD),
("szLogFileCaption", ctypes.c_void_p),
("szDefaultDir", ctypes.c_void_p),
("szBaseFileName", ctypes.c_void_p),
("dwFileType", wintypes.DWORD),
("dwReserved", wintypes.DWORD),
("Anonymous", _Anonymous_e__Union),
]#[repr(C)]
pub struct PDH_LOG_SERVICE_QUERY_INFO_W {
pub dwSize: u32,
pub dwFlags: u32,
pub dwLogQuota: u32,
pub szLogFileCaption: *mut core::ffi::c_void,
pub szDefaultDir: *mut core::ffi::c_void,
pub szBaseFileName: *mut core::ffi::c_void,
pub dwFileType: u32,
pub dwReserved: u32,
pub Anonymous: _Anonymous_e__Union,
}import "golang.org/x/sys/windows"
type PDH_LOG_SERVICE_QUERY_INFO_W struct {
dwSize uint32
dwFlags uint32
dwLogQuota uint32
szLogFileCaption uintptr
szDefaultDir uintptr
szBaseFileName uintptr
dwFileType uint32
dwReserved uint32
Anonymous _Anonymous_e__Union
}type
PDH_LOG_SERVICE_QUERY_INFO_W = record
dwSize: DWORD;
dwFlags: DWORD;
dwLogQuota: DWORD;
szLogFileCaption: Pointer;
szDefaultDir: Pointer;
szBaseFileName: Pointer;
dwFileType: DWORD;
dwReserved: DWORD;
Anonymous: _Anonymous_e__Union;
end;const PDH_LOG_SERVICE_QUERY_INFO_W = extern struct {
dwSize: u32,
dwFlags: u32,
dwLogQuota: u32,
szLogFileCaption: ?*anyopaque,
szDefaultDir: ?*anyopaque,
szBaseFileName: ?*anyopaque,
dwFileType: u32,
dwReserved: u32,
Anonymous: _Anonymous_e__Union,
};type
PDH_LOG_SERVICE_QUERY_INFO_W {.bycopy.} = object
dwSize: uint32
dwFlags: uint32
dwLogQuota: uint32
szLogFileCaption: pointer
szDefaultDir: pointer
szBaseFileName: pointer
dwFileType: uint32
dwReserved: uint32
Anonymous: _Anonymous_e__Unionstruct PDH_LOG_SERVICE_QUERY_INFO_W
{
uint dwSize;
uint dwFlags;
uint dwLogQuota;
void* szLogFileCaption;
void* szDefaultDir;
void* szBaseFileName;
uint dwFileType;
uint dwReserved;
_Anonymous_e__Union Anonymous;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; PDH_LOG_SERVICE_QUERY_INFO_W サイズ: 36 バイト(x86)
dim st, 9 ; 4byte整数×9(構造体サイズ 36 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwFlags : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; dwLogQuota : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; szLogFileCaption : LPWSTR (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; szDefaultDir : LPWSTR (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; szBaseFileName : LPWSTR (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; dwFileType : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; dwReserved : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; Anonymous : _Anonymous_e__Union (+32, 4byte) varptr(st)+32 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; PDH_LOG_SERVICE_QUERY_INFO_W サイズ: 56 バイト(x64)
dim st, 14 ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwFlags : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; dwLogQuota : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; szLogFileCaption : LPWSTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; szDefaultDir : LPWSTR (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; szBaseFileName : LPWSTR (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; dwFileType : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; dwReserved : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; Anonymous : _Anonymous_e__Union (+48, 8byte) varptr(st)+48 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global PDH_LOG_SERVICE_QUERY_INFO_W
#field int dwSize
#field int dwFlags
#field int dwLogQuota
#field intptr szLogFileCaption
#field intptr szDefaultDir
#field intptr szBaseFileName
#field int dwFileType
#field int dwReserved
#field byte Anonymous 8
#endstruct
stdim st, PDH_LOG_SERVICE_QUERY_INFO_W ; NSTRUCT 変数を確保
st->dwSize = 100
mes "dwSize=" + st->dwSize
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。