Win32 API 日本語リファレンス
ホームSystem.Diagnostics.Debug › MINIDUMP_MEMORY_INFO

MINIDUMP_MEMORY_INFO

構造体
サイズx64: 48 バイト / x86: 48 バイトパッキング4

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

フィールド

フィールドサイズx64x86説明
BaseAddressULONGLONG8+0+0メモリ領域の基底アドレス。
AllocationBaseULONGLONG8+8+8領域を含む割り当て全体の基底アドレス。
AllocationProtectDWORD4+16+16割り当て時に指定された保護属性。
__alignment1DWORD4+20+20アラインメント調整用パディング。
RegionSizeULONGLONG8+24+24領域のバイトサイズ。
StateVIRTUAL_ALLOCATION_TYPE4+32+32領域の状態(VIRTUAL_ALLOCATION_TYPE)。コミット/予約/解放。
ProtectDWORD4+36+36現在のメモリ保護属性(PAGE_*)。
TypeDWORD4+40+40メモリ種別(イメージ/マップ/プライベート)。
__alignment2DWORD4+44+44アラインメント調整用パディング。

各言語での定義

#include <windows.h>

// MINIDUMP_MEMORY_INFO  (x64 48 / x86 48 バイト)
#pragma pack(push, 4)
typedef struct MINIDUMP_MEMORY_INFO {
    ULONGLONG BaseAddress;
    ULONGLONG AllocationBase;
    DWORD AllocationProtect;
    DWORD __alignment1;
    ULONGLONG RegionSize;
    VIRTUAL_ALLOCATION_TYPE State;
    DWORD Protect;
    DWORD Type;
    DWORD __alignment2;
} MINIDUMP_MEMORY_INFO;
#pragma pack(pop)
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, Pack = 4, CharSet = CharSet.Unicode)]
public struct MINIDUMP_MEMORY_INFO
{
    public ulong BaseAddress;
    public ulong AllocationBase;
    public uint AllocationProtect;
    public uint __alignment1;
    public ulong RegionSize;
    public uint State;
    public uint Protect;
    public uint Type;
    public uint __alignment2;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, Pack:=4, CharSet:=CharSet.Unicode)>
Public Structure MINIDUMP_MEMORY_INFO
    Public BaseAddress As ULong
    Public AllocationBase As ULong
    Public AllocationProtect As UInteger
    Public __alignment1 As UInteger
    Public RegionSize As ULong
    Public State As UInteger
    Public Protect As UInteger
    Public Type As UInteger
    Public __alignment2 As UInteger
End Structure
import ctypes
from ctypes import wintypes

class MINIDUMP_MEMORY_INFO(ctypes.Structure):
    _pack_ = 4
    _fields_ = [
        ("BaseAddress", ctypes.c_ulonglong),
        ("AllocationBase", ctypes.c_ulonglong),
        ("AllocationProtect", wintypes.DWORD),
        ("__alignment1", wintypes.DWORD),
        ("RegionSize", ctypes.c_ulonglong),
        ("State", wintypes.DWORD),
        ("Protect", wintypes.DWORD),
        ("Type", wintypes.DWORD),
        ("__alignment2", wintypes.DWORD),
    ]
#[repr(C, packed(4))]
pub struct MINIDUMP_MEMORY_INFO {
    pub BaseAddress: u64,
    pub AllocationBase: u64,
    pub AllocationProtect: u32,
    pub __alignment1: u32,
    pub RegionSize: u64,
    pub State: u32,
    pub Protect: u32,
    pub Type: u32,
    pub __alignment2: u32,
}
import "golang.org/x/sys/windows"

type MINIDUMP_MEMORY_INFO struct {
	BaseAddress uint64
	AllocationBase uint64
	AllocationProtect uint32
	__alignment1 uint32
	RegionSize uint64
	State uint32
	Protect uint32
	Type uint32
	__alignment2 uint32
}
type
  MINIDUMP_MEMORY_INFO = packed record
    BaseAddress: UInt64;
    AllocationBase: UInt64;
    AllocationProtect: DWORD;
    __alignment1: DWORD;
    RegionSize: UInt64;
    State: DWORD;
    Protect: DWORD;
    Type: DWORD;
    __alignment2: DWORD;
  end;
const MINIDUMP_MEMORY_INFO = extern struct {
    BaseAddress: u64,
    AllocationBase: u64,
    AllocationProtect: u32,
    __alignment1: u32,
    RegionSize: u64,
    State: u32,
    Protect: u32,
    Type: u32,
    __alignment2: u32,
};
type
  MINIDUMP_MEMORY_INFO {.packed.} = object
    BaseAddress: uint64
    AllocationBase: uint64
    AllocationProtect: uint32
    __alignment1: uint32
    RegionSize: uint64
    State: uint32
    Protect: uint32
    Type: uint32
    __alignment2: uint32
align(4)
struct MINIDUMP_MEMORY_INFO
{
    ulong BaseAddress;
    ulong AllocationBase;
    uint AllocationProtect;
    uint __alignment1;
    ulong RegionSize;
    uint State;
    uint Protect;
    uint Type;
    uint __alignment2;
}

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_INFO サイズ: 48 バイト(x64)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; BaseAddress : ULONGLONG (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; AllocationBase : ULONGLONG (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; AllocationProtect : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; __alignment1 : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; RegionSize : ULONGLONG (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; State : VIRTUAL_ALLOCATION_TYPE (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; Protect : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; Type : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; __alignment2 : DWORD (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global MINIDUMP_MEMORY_INFO, pack=4
    #field int64 BaseAddress
    #field int64 AllocationBase
    #field int AllocationProtect
    #field int __alignment1
    #field int64 RegionSize
    #field int State
    #field int Protect
    #field int Type
    #field int __alignment2
#endstruct

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