ホーム › System.Diagnostics.Debug › LOAD_DLL_DEBUG_INFO
LOAD_DLL_DEBUG_INFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| hFile | HANDLE | 8/4 | +0 | +0 | ロードされたDLLのファイルハンドル。使用後にクローズが必要。 |
| lpBaseOfDll | void* | 8/4 | +8 | +4 | DLLがロードされた基底アドレス。 |
| dwDebugInfoFileOffset | DWORD | 4 | +16 | +8 | デバッグ情報のファイルオフセット。 |
| nDebugInfoSize | DWORD | 4 | +20 | +12 | デバッグ情報のバイトサイズ。 |
| lpImageName | void* | 8/4 | +24 | +16 | DLL名文字列へのポインタ(対象プロセス空間)。NULL可。 |
| fUnicode | WORD | 2 | +32 | +20 | lpImageNameがUnicodeなら非0。 |
各言語での定義
#include <windows.h>
// LOAD_DLL_DEBUG_INFO (x64 40 / x86 24 バイト)
typedef struct LOAD_DLL_DEBUG_INFO {
HANDLE hFile;
void* lpBaseOfDll;
DWORD dwDebugInfoFileOffset;
DWORD nDebugInfoSize;
void* lpImageName;
WORD fUnicode;
} LOAD_DLL_DEBUG_INFO;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct LOAD_DLL_DEBUG_INFO
{
public IntPtr hFile;
public IntPtr lpBaseOfDll;
public uint dwDebugInfoFileOffset;
public uint nDebugInfoSize;
public IntPtr lpImageName;
public ushort fUnicode;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure LOAD_DLL_DEBUG_INFO
Public hFile As IntPtr
Public lpBaseOfDll As IntPtr
Public dwDebugInfoFileOffset As UInteger
Public nDebugInfoSize As UInteger
Public lpImageName As IntPtr
Public fUnicode As UShort
End Structureimport ctypes
from ctypes import wintypes
class LOAD_DLL_DEBUG_INFO(ctypes.Structure):
_fields_ = [
("hFile", ctypes.c_void_p),
("lpBaseOfDll", ctypes.c_void_p),
("dwDebugInfoFileOffset", wintypes.DWORD),
("nDebugInfoSize", wintypes.DWORD),
("lpImageName", ctypes.c_void_p),
("fUnicode", ctypes.c_ushort),
]#[repr(C)]
pub struct LOAD_DLL_DEBUG_INFO {
pub hFile: *mut core::ffi::c_void,
pub lpBaseOfDll: *mut core::ffi::c_void,
pub dwDebugInfoFileOffset: u32,
pub nDebugInfoSize: u32,
pub lpImageName: *mut core::ffi::c_void,
pub fUnicode: u16,
}import "golang.org/x/sys/windows"
type LOAD_DLL_DEBUG_INFO struct {
hFile uintptr
lpBaseOfDll uintptr
dwDebugInfoFileOffset uint32
nDebugInfoSize uint32
lpImageName uintptr
fUnicode uint16
}type
LOAD_DLL_DEBUG_INFO = record
hFile: Pointer;
lpBaseOfDll: Pointer;
dwDebugInfoFileOffset: DWORD;
nDebugInfoSize: DWORD;
lpImageName: Pointer;
fUnicode: Word;
end;const LOAD_DLL_DEBUG_INFO = extern struct {
hFile: ?*anyopaque,
lpBaseOfDll: ?*anyopaque,
dwDebugInfoFileOffset: u32,
nDebugInfoSize: u32,
lpImageName: ?*anyopaque,
fUnicode: u16,
};type
LOAD_DLL_DEBUG_INFO {.bycopy.} = object
hFile: pointer
lpBaseOfDll: pointer
dwDebugInfoFileOffset: uint32
nDebugInfoSize: uint32
lpImageName: pointer
fUnicode: uint16struct LOAD_DLL_DEBUG_INFO
{
void* hFile;
void* lpBaseOfDll;
uint dwDebugInfoFileOffset;
uint nDebugInfoSize;
void* lpImageName;
ushort fUnicode;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; LOAD_DLL_DEBUG_INFO サイズ: 24 バイト(x86)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; hFile : HANDLE (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; lpBaseOfDll : void* (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; dwDebugInfoFileOffset : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; nDebugInfoSize : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; lpImageName : void* (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; fUnicode : WORD (+20, 2byte) wpoke st,20,値 / 値 = wpeek(st,20)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; LOAD_DLL_DEBUG_INFO サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; hFile : HANDLE (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; lpBaseOfDll : void* (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; dwDebugInfoFileOffset : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; nDebugInfoSize : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; lpImageName : void* (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; fUnicode : WORD (+32, 2byte) wpoke st,32,値 / 値 = wpeek(st,32)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global LOAD_DLL_DEBUG_INFO
#field intptr hFile
#field intptr lpBaseOfDll
#field int dwDebugInfoFileOffset
#field int nDebugInfoSize
#field intptr lpImageName
#field short fUnicode
#endstruct
stdim st, LOAD_DLL_DEBUG_INFO ; NSTRUCT 変数を確保
st->dwDebugInfoFileOffset = 100
mes "dwDebugInfoFileOffset=" + st->dwDebugInfoFileOffset