ホーム › System.Diagnostics.Debug › MINIDUMP_MEMORY_LIST
MINIDUMP_MEMORY_LIST
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| NumberOfMemoryRanges | DWORD | 4 | +0 | +0 | メモリ範囲の数。 |
| MemoryRanges | MINIDUMP_MEMORY_DESCRIPTOR | 16 | +4 | +4 | メモリ記述子(MINIDUMP_MEMORY_DESCRIPTOR)の配列。 |
各言語での定義
#include <windows.h>
// MINIDUMP_LOCATION_DESCRIPTOR (x64 8 / x86 8 バイト)
#pragma pack(push, 4)
typedef struct MINIDUMP_LOCATION_DESCRIPTOR {
DWORD DataSize;
DWORD Rva;
} MINIDUMP_LOCATION_DESCRIPTOR;
#pragma pack(pop)
// MINIDUMP_MEMORY_DESCRIPTOR (x64 16 / x86 16 バイト)
#pragma pack(push, 4)
typedef struct MINIDUMP_MEMORY_DESCRIPTOR {
ULONGLONG StartOfMemoryRange;
MINIDUMP_LOCATION_DESCRIPTOR Memory;
} MINIDUMP_MEMORY_DESCRIPTOR;
#pragma pack(pop)
// MINIDUMP_MEMORY_LIST (x64 20 / x86 20 バイト)
#pragma pack(push, 4)
typedef struct MINIDUMP_MEMORY_LIST {
DWORD NumberOfMemoryRanges;
MINIDUMP_MEMORY_DESCRIPTOR MemoryRanges[1];
} MINIDUMP_MEMORY_LIST;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 4, CharSet = CharSet.Unicode)]
public struct MINIDUMP_LOCATION_DESCRIPTOR
{
public uint DataSize;
public uint Rva;
}
[StructLayout(LayoutKind.Sequential, Pack = 4, CharSet = CharSet.Unicode)]
public struct MINIDUMP_MEMORY_DESCRIPTOR
{
public ulong StartOfMemoryRange;
public MINIDUMP_LOCATION_DESCRIPTOR Memory;
}
[StructLayout(LayoutKind.Sequential, Pack = 4, CharSet = CharSet.Unicode)]
public struct MINIDUMP_MEMORY_LIST
{
public uint NumberOfMemoryRanges;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public MINIDUMP_MEMORY_DESCRIPTOR[] MemoryRanges;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=4, CharSet:=CharSet.Unicode)>
Public Structure MINIDUMP_LOCATION_DESCRIPTOR
Public DataSize As UInteger
Public Rva As UInteger
End Structure
<StructLayout(LayoutKind.Sequential, Pack:=4, CharSet:=CharSet.Unicode)>
Public Structure MINIDUMP_MEMORY_DESCRIPTOR
Public StartOfMemoryRange As ULong
Public Memory As MINIDUMP_LOCATION_DESCRIPTOR
End Structure
<StructLayout(LayoutKind.Sequential, Pack:=4, CharSet:=CharSet.Unicode)>
Public Structure MINIDUMP_MEMORY_LIST
Public NumberOfMemoryRanges As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public MemoryRanges() As MINIDUMP_MEMORY_DESCRIPTOR
End Structureimport ctypes
from ctypes import wintypes
class MINIDUMP_LOCATION_DESCRIPTOR(ctypes.Structure):
_pack_ = 4
_fields_ = [
("DataSize", wintypes.DWORD),
("Rva", wintypes.DWORD),
]
class MINIDUMP_MEMORY_DESCRIPTOR(ctypes.Structure):
_pack_ = 4
_fields_ = [
("StartOfMemoryRange", ctypes.c_ulonglong),
("Memory", MINIDUMP_LOCATION_DESCRIPTOR),
]
class MINIDUMP_MEMORY_LIST(ctypes.Structure):
_pack_ = 4
_fields_ = [
("NumberOfMemoryRanges", wintypes.DWORD),
("MemoryRanges", MINIDUMP_MEMORY_DESCRIPTOR * 1),
]#[repr(C, packed(4))]
pub struct MINIDUMP_LOCATION_DESCRIPTOR {
pub DataSize: u32,
pub Rva: u32,
}
#[repr(C, packed(4))]
pub struct MINIDUMP_MEMORY_DESCRIPTOR {
pub StartOfMemoryRange: u64,
pub Memory: MINIDUMP_LOCATION_DESCRIPTOR,
}
#[repr(C, packed(4))]
pub struct MINIDUMP_MEMORY_LIST {
pub NumberOfMemoryRanges: u32,
pub MemoryRanges: [MINIDUMP_MEMORY_DESCRIPTOR; 1],
}import "golang.org/x/sys/windows"
type MINIDUMP_LOCATION_DESCRIPTOR struct {
DataSize uint32
Rva uint32
}
type MINIDUMP_MEMORY_DESCRIPTOR struct {
StartOfMemoryRange uint64
Memory MINIDUMP_LOCATION_DESCRIPTOR
}
type MINIDUMP_MEMORY_LIST struct {
NumberOfMemoryRanges uint32
MemoryRanges [1]MINIDUMP_MEMORY_DESCRIPTOR
}type
MINIDUMP_LOCATION_DESCRIPTOR = packed record
DataSize: DWORD;
Rva: DWORD;
end;
MINIDUMP_MEMORY_DESCRIPTOR = packed record
StartOfMemoryRange: UInt64;
Memory: MINIDUMP_LOCATION_DESCRIPTOR;
end;
MINIDUMP_MEMORY_LIST = packed record
NumberOfMemoryRanges: DWORD;
MemoryRanges: array[0..0] of MINIDUMP_MEMORY_DESCRIPTOR;
end;const MINIDUMP_LOCATION_DESCRIPTOR = extern struct {
DataSize: u32,
Rva: u32,
};
const MINIDUMP_MEMORY_DESCRIPTOR = extern struct {
StartOfMemoryRange: u64,
Memory: MINIDUMP_LOCATION_DESCRIPTOR,
};
const MINIDUMP_MEMORY_LIST = extern struct {
NumberOfMemoryRanges: u32,
MemoryRanges: [1]MINIDUMP_MEMORY_DESCRIPTOR,
};type
MINIDUMP_LOCATION_DESCRIPTOR {.packed.} = object
DataSize: uint32
Rva: uint32
MINIDUMP_MEMORY_DESCRIPTOR {.packed.} = object
StartOfMemoryRange: uint64
Memory: MINIDUMP_LOCATION_DESCRIPTOR
MINIDUMP_MEMORY_LIST {.packed.} = object
NumberOfMemoryRanges: uint32
MemoryRanges: array[1, MINIDUMP_MEMORY_DESCRIPTOR]align(4)
struct MINIDUMP_LOCATION_DESCRIPTOR
{
uint DataSize;
uint Rva;
}
align(4)
struct MINIDUMP_MEMORY_DESCRIPTOR
{
ulong StartOfMemoryRange;
MINIDUMP_LOCATION_DESCRIPTOR Memory;
}
align(4)
struct MINIDUMP_MEMORY_LIST
{
uint NumberOfMemoryRanges;
MINIDUMP_MEMORY_DESCRIPTOR[1] MemoryRanges;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MINIDUMP_MEMORY_LIST サイズ: 20 バイト(x64)
dim st, 5 ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; NumberOfMemoryRanges : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; MemoryRanges : MINIDUMP_MEMORY_DESCRIPTOR (+4, 16byte) varptr(st)+4 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global MINIDUMP_LOCATION_DESCRIPTOR, pack=4
#field int DataSize
#field int Rva
#endstruct
#defstruct global MINIDUMP_MEMORY_DESCRIPTOR, pack=4
#field int64 StartOfMemoryRange
#field MINIDUMP_LOCATION_DESCRIPTOR Memory
#endstruct
#defstruct global MINIDUMP_MEMORY_LIST, pack=4
#field int NumberOfMemoryRanges
#field MINIDUMP_MEMORY_DESCRIPTOR MemoryRanges 1
#endstruct
stdim st, MINIDUMP_MEMORY_LIST ; NSTRUCT 変数を確保
st->NumberOfMemoryRanges = 100
mes "NumberOfMemoryRanges=" + st->NumberOfMemoryRanges