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

MINIDUMP_SYSTEM_BASIC_INFORMATION

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

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

フィールド

フィールドサイズx64x86説明
TimerResolutionDWORD4+0+0システムタイマの分解能(100ナノ秒単位)。
PageSizeDWORD4+4+4メモリページのサイズ(バイト)。
NumberOfPhysicalPagesDWORD4+8+8物理ページの総数。
LowestPhysicalPageNumberDWORD4+12+12最小の物理ページ番号。
HighestPhysicalPageNumberDWORD4+16+16最大の物理ページ番号。
AllocationGranularityDWORD4+20+20仮想メモリ割り当ての粒度(バイト)。
MinimumUserModeAddressULONGLONG8+24+24ユーザモード仮想アドレスの最小値。
MaximumUserModeAddressULONGLONG8+32+32ユーザモード仮想アドレスの最大値。
ActiveProcessorsAffinityMaskULONGLONG8+40+40アクティブプロセッサのアフィニティマスク。
NumberOfProcessorsDWORD4+48+48論理プロセッサ数。

各言語での定義

#include <windows.h>

// MINIDUMP_SYSTEM_BASIC_INFORMATION  (x64 52 / x86 52 バイト)
#pragma pack(push, 4)
typedef struct MINIDUMP_SYSTEM_BASIC_INFORMATION {
    DWORD TimerResolution;
    DWORD PageSize;
    DWORD NumberOfPhysicalPages;
    DWORD LowestPhysicalPageNumber;
    DWORD HighestPhysicalPageNumber;
    DWORD AllocationGranularity;
    ULONGLONG MinimumUserModeAddress;
    ULONGLONG MaximumUserModeAddress;
    ULONGLONG ActiveProcessorsAffinityMask;
    DWORD NumberOfProcessors;
} MINIDUMP_SYSTEM_BASIC_INFORMATION;
#pragma pack(pop)
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, Pack = 4, CharSet = CharSet.Unicode)]
public struct MINIDUMP_SYSTEM_BASIC_INFORMATION
{
    public uint TimerResolution;
    public uint PageSize;
    public uint NumberOfPhysicalPages;
    public uint LowestPhysicalPageNumber;
    public uint HighestPhysicalPageNumber;
    public uint AllocationGranularity;
    public ulong MinimumUserModeAddress;
    public ulong MaximumUserModeAddress;
    public ulong ActiveProcessorsAffinityMask;
    public uint NumberOfProcessors;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, Pack:=4, CharSet:=CharSet.Unicode)>
Public Structure MINIDUMP_SYSTEM_BASIC_INFORMATION
    Public TimerResolution As UInteger
    Public PageSize As UInteger
    Public NumberOfPhysicalPages As UInteger
    Public LowestPhysicalPageNumber As UInteger
    Public HighestPhysicalPageNumber As UInteger
    Public AllocationGranularity As UInteger
    Public MinimumUserModeAddress As ULong
    Public MaximumUserModeAddress As ULong
    Public ActiveProcessorsAffinityMask As ULong
    Public NumberOfProcessors As UInteger
End Structure
import ctypes
from ctypes import wintypes

class MINIDUMP_SYSTEM_BASIC_INFORMATION(ctypes.Structure):
    _pack_ = 4
    _fields_ = [
        ("TimerResolution", wintypes.DWORD),
        ("PageSize", wintypes.DWORD),
        ("NumberOfPhysicalPages", wintypes.DWORD),
        ("LowestPhysicalPageNumber", wintypes.DWORD),
        ("HighestPhysicalPageNumber", wintypes.DWORD),
        ("AllocationGranularity", wintypes.DWORD),
        ("MinimumUserModeAddress", ctypes.c_ulonglong),
        ("MaximumUserModeAddress", ctypes.c_ulonglong),
        ("ActiveProcessorsAffinityMask", ctypes.c_ulonglong),
        ("NumberOfProcessors", wintypes.DWORD),
    ]
#[repr(C, packed(4))]
pub struct MINIDUMP_SYSTEM_BASIC_INFORMATION {
    pub TimerResolution: u32,
    pub PageSize: u32,
    pub NumberOfPhysicalPages: u32,
    pub LowestPhysicalPageNumber: u32,
    pub HighestPhysicalPageNumber: u32,
    pub AllocationGranularity: u32,
    pub MinimumUserModeAddress: u64,
    pub MaximumUserModeAddress: u64,
    pub ActiveProcessorsAffinityMask: u64,
    pub NumberOfProcessors: u32,
}
import "golang.org/x/sys/windows"

type MINIDUMP_SYSTEM_BASIC_INFORMATION struct {
	TimerResolution uint32
	PageSize uint32
	NumberOfPhysicalPages uint32
	LowestPhysicalPageNumber uint32
	HighestPhysicalPageNumber uint32
	AllocationGranularity uint32
	MinimumUserModeAddress uint64
	MaximumUserModeAddress uint64
	ActiveProcessorsAffinityMask uint64
	NumberOfProcessors uint32
}
type
  MINIDUMP_SYSTEM_BASIC_INFORMATION = packed record
    TimerResolution: DWORD;
    PageSize: DWORD;
    NumberOfPhysicalPages: DWORD;
    LowestPhysicalPageNumber: DWORD;
    HighestPhysicalPageNumber: DWORD;
    AllocationGranularity: DWORD;
    MinimumUserModeAddress: UInt64;
    MaximumUserModeAddress: UInt64;
    ActiveProcessorsAffinityMask: UInt64;
    NumberOfProcessors: DWORD;
  end;
const MINIDUMP_SYSTEM_BASIC_INFORMATION = extern struct {
    TimerResolution: u32,
    PageSize: u32,
    NumberOfPhysicalPages: u32,
    LowestPhysicalPageNumber: u32,
    HighestPhysicalPageNumber: u32,
    AllocationGranularity: u32,
    MinimumUserModeAddress: u64,
    MaximumUserModeAddress: u64,
    ActiveProcessorsAffinityMask: u64,
    NumberOfProcessors: u32,
};
type
  MINIDUMP_SYSTEM_BASIC_INFORMATION {.packed.} = object
    TimerResolution: uint32
    PageSize: uint32
    NumberOfPhysicalPages: uint32
    LowestPhysicalPageNumber: uint32
    HighestPhysicalPageNumber: uint32
    AllocationGranularity: uint32
    MinimumUserModeAddress: uint64
    MaximumUserModeAddress: uint64
    ActiveProcessorsAffinityMask: uint64
    NumberOfProcessors: uint32
align(4)
struct MINIDUMP_SYSTEM_BASIC_INFORMATION
{
    uint TimerResolution;
    uint PageSize;
    uint NumberOfPhysicalPages;
    uint LowestPhysicalPageNumber;
    uint HighestPhysicalPageNumber;
    uint AllocationGranularity;
    ulong MinimumUserModeAddress;
    ulong MaximumUserModeAddress;
    ulong ActiveProcessorsAffinityMask;
    uint NumberOfProcessors;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MINIDUMP_SYSTEM_BASIC_INFORMATION サイズ: 52 バイト(x64)
dim st, 13    ; 4byte整数×13(構造体サイズ 52 / 4 切り上げ)
; TimerResolution : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; PageSize : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; NumberOfPhysicalPages : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; LowestPhysicalPageNumber : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; HighestPhysicalPageNumber : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; AllocationGranularity : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; MinimumUserModeAddress : ULONGLONG (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; MaximumUserModeAddress : ULONGLONG (+32, 8byte)  qpoke st,32,値 / qpeek(st,32)  ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; ActiveProcessorsAffinityMask : ULONGLONG (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; NumberOfProcessors : DWORD (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global MINIDUMP_SYSTEM_BASIC_INFORMATION, pack=4
    #field int TimerResolution
    #field int PageSize
    #field int NumberOfPhysicalPages
    #field int LowestPhysicalPageNumber
    #field int HighestPhysicalPageNumber
    #field int AllocationGranularity
    #field int64 MinimumUserModeAddress
    #field int64 MaximumUserModeAddress
    #field int64 ActiveProcessorsAffinityMask
    #field int NumberOfProcessors
#endstruct

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