Win32 API 日本語リファレンス
ホームNetworkManagement.NetManagement › HLOG

HLOG

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

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

フィールド

フィールドサイズx64x86説明
timeDWORD4+0+0ログ操作に関連付けられた時刻情報を示す。
last_flagsDWORD4+4+4前回のログ読み取り操作で設定されたフラグを示す。
offsetDWORD4+8+8ログ内の現在の読み取り位置オフセットを示す。
rec_offsetDWORD4+12+12現在のレコードの開始オフセットを示す。

各言語での定義

#include <windows.h>

// HLOG  (x64 16 / x86 16 バイト)
typedef struct HLOG {
    DWORD time;
    DWORD last_flags;
    DWORD offset;
    DWORD rec_offset;
} HLOG;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct HLOG
{
    public uint time;
    public uint last_flags;
    public uint offset;
    public uint rec_offset;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure HLOG
    Public time As UInteger
    Public last_flags As UInteger
    Public offset As UInteger
    Public rec_offset As UInteger
End Structure
import ctypes
from ctypes import wintypes

class HLOG(ctypes.Structure):
    _fields_ = [
        ("time", wintypes.DWORD),
        ("last_flags", wintypes.DWORD),
        ("offset", wintypes.DWORD),
        ("rec_offset", wintypes.DWORD),
    ]
#[repr(C)]
pub struct HLOG {
    pub time: u32,
    pub last_flags: u32,
    pub offset: u32,
    pub rec_offset: u32,
}
import "golang.org/x/sys/windows"

type HLOG struct {
	time uint32
	last_flags uint32
	offset uint32
	rec_offset uint32
}
type
  HLOG = record
    time: DWORD;
    last_flags: DWORD;
    offset: DWORD;
    rec_offset: DWORD;
  end;
const HLOG = extern struct {
    time: u32,
    last_flags: u32,
    offset: u32,
    rec_offset: u32,
};
type
  HLOG {.bycopy.} = object
    time: uint32
    last_flags: uint32
    offset: uint32
    rec_offset: uint32
struct HLOG
{
    uint time;
    uint last_flags;
    uint offset;
    uint rec_offset;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; HLOG サイズ: 16 バイト(x64)
dim st, 4    ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; time : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; last_flags : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; offset : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; rec_offset : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global HLOG
    #field int time
    #field int last_flags
    #field int offset
    #field int rec_offset
#endstruct

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