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

HSE_TRACE_INFO

構造体
サイズx64: 28 バイト / x86: 28 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
fTraceRequestBOOL4+0+0このリクエストをトレース対象とするかを示すBOOLである。
TraceContextIdBYTE16+4+4トレースコンテキストを識別するID(BYTE配列/GUID相当)である。
dwReserved1DWORD4+20+20予約フィールド。0とする。
dwReserved2DWORD4+24+24予約フィールド。0とする。

各言語での定義

#include <windows.h>

// HSE_TRACE_INFO  (x64 28 / x86 28 バイト)
typedef struct HSE_TRACE_INFO {
    BOOL fTraceRequest;
    BYTE TraceContextId[16];
    DWORD dwReserved1;
    DWORD dwReserved2;
} HSE_TRACE_INFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct HSE_TRACE_INFO
{
    [MarshalAs(UnmanagedType.Bool)] public bool fTraceRequest;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public byte[] TraceContextId;
    public uint dwReserved1;
    public uint dwReserved2;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure HSE_TRACE_INFO
    <MarshalAs(UnmanagedType.Bool)> Public fTraceRequest As Boolean
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=16)> Public TraceContextId() As Byte
    Public dwReserved1 As UInteger
    Public dwReserved2 As UInteger
End Structure
import ctypes
from ctypes import wintypes

class HSE_TRACE_INFO(ctypes.Structure):
    _fields_ = [
        ("fTraceRequest", wintypes.BOOL),
        ("TraceContextId", ctypes.c_ubyte * 16),
        ("dwReserved1", wintypes.DWORD),
        ("dwReserved2", wintypes.DWORD),
    ]
#[repr(C)]
pub struct HSE_TRACE_INFO {
    pub fTraceRequest: i32,
    pub TraceContextId: [u8; 16],
    pub dwReserved1: u32,
    pub dwReserved2: u32,
}
import "golang.org/x/sys/windows"

type HSE_TRACE_INFO struct {
	fTraceRequest int32
	TraceContextId [16]byte
	dwReserved1 uint32
	dwReserved2 uint32
}
type
  HSE_TRACE_INFO = record
    fTraceRequest: BOOL;
    TraceContextId: array[0..15] of Byte;
    dwReserved1: DWORD;
    dwReserved2: DWORD;
  end;
const HSE_TRACE_INFO = extern struct {
    fTraceRequest: i32,
    TraceContextId: [16]u8,
    dwReserved1: u32,
    dwReserved2: u32,
};
type
  HSE_TRACE_INFO {.bycopy.} = object
    fTraceRequest: int32
    TraceContextId: array[16, uint8]
    dwReserved1: uint32
    dwReserved2: uint32
struct HSE_TRACE_INFO
{
    int fTraceRequest;
    ubyte[16] TraceContextId;
    uint dwReserved1;
    uint dwReserved2;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; HSE_TRACE_INFO サイズ: 28 バイト(x64)
dim st, 7    ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; fTraceRequest : BOOL (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; TraceContextId : BYTE (+4, 16byte)  varptr(st)+4 を基点に操作(16byte:入れ子/配列)
; dwReserved1 : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; dwReserved2 : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global HSE_TRACE_INFO
    #field bool fTraceRequest
    #field byte TraceContextId 16
    #field int dwReserved1
    #field int dwReserved2
#endstruct

stdim st, HSE_TRACE_INFO        ; NSTRUCT 変数を確保
st->fTraceRequest = 100
mes "fTraceRequest=" + st->fTraceRequest