ホーム › UI.WindowsAndMessaging › DEBUGHOOKINFO
DEBUGHOOKINFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| idThread | DWORD | 4 | +0 | +0 | フィルター関数を含むスレッドへのハンドルです。 |
| idThreadInstaller | DWORD | 4 | +4 | +4 | デバッグ用フィルター関数をインストールしたスレッドへのハンドルです。 |
| lParam | LPARAM | 8/4 | +8 | +8 | DebugProc コールバック関数の lParam パラメーターでフックに渡される値です。 |
| wParam | WPARAM | 8/4 | +16 | +12 | DebugProc コールバック関数の wParam パラメーターでフックに渡される値です。 |
| code | INT | 4 | +24 | +16 | DebugProc コールバック関数の nCode パラメーターでフックに渡される値です。 |
公式ドキュメント
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// DEBUGHOOKINFO (x64 32 / x86 20 バイト)
typedef struct DEBUGHOOKINFO {
DWORD idThread;
DWORD idThreadInstaller;
LPARAM lParam;
WPARAM wParam;
INT code;
} DEBUGHOOKINFO;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DEBUGHOOKINFO
{
public uint idThread;
public uint idThreadInstaller;
public IntPtr lParam;
public UIntPtr wParam;
public int code;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DEBUGHOOKINFO
Public idThread As UInteger
Public idThreadInstaller As UInteger
Public lParam As IntPtr
Public wParam As UIntPtr
Public code As Integer
End Structureimport ctypes
from ctypes import wintypes
class DEBUGHOOKINFO(ctypes.Structure):
_fields_ = [
("idThread", wintypes.DWORD),
("idThreadInstaller", wintypes.DWORD),
("lParam", ctypes.c_ssize_t),
("wParam", ctypes.c_size_t),
("code", ctypes.c_int),
]#[repr(C)]
pub struct DEBUGHOOKINFO {
pub idThread: u32,
pub idThreadInstaller: u32,
pub lParam: isize,
pub wParam: usize,
pub code: i32,
}import "golang.org/x/sys/windows"
type DEBUGHOOKINFO struct {
idThread uint32
idThreadInstaller uint32
lParam uintptr
wParam uintptr
code int32
}type
DEBUGHOOKINFO = record
idThread: DWORD;
idThreadInstaller: DWORD;
lParam: NativeInt;
wParam: NativeUInt;
code: Integer;
end;const DEBUGHOOKINFO = extern struct {
idThread: u32,
idThreadInstaller: u32,
lParam: isize,
wParam: usize,
code: i32,
};type
DEBUGHOOKINFO {.bycopy.} = object
idThread: uint32
idThreadInstaller: uint32
lParam: int
wParam: uint
code: int32struct DEBUGHOOKINFO
{
uint idThread;
uint idThreadInstaller;
ptrdiff_t lParam;
size_t wParam;
int code;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DEBUGHOOKINFO サイズ: 20 バイト(x86)
dim st, 5 ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; idThread : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; idThreadInstaller : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; lParam : LPARAM (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; wParam : WPARAM (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; code : INT (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DEBUGHOOKINFO サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; idThread : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; idThreadInstaller : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; lParam : LPARAM (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; wParam : WPARAM (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; code : INT (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DEBUGHOOKINFO
#field int idThread
#field int idThreadInstaller
#field intptr lParam
#field intptr wParam
#field int code
#endstruct
stdim st, DEBUGHOOKINFO ; NSTRUCT 変数を確保
st->idThread = 100
mes "idThread=" + st->idThread