ホーム › Devices.DeviceAndDriverInstallation › MEM_LARGE_DES
MEM_LARGE_DES
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| MLD_Count | DWORD | 4 | +0 | +0 | 後続のMEM_LARGE_RANGE配列の要素数。 |
| MLD_Type | DWORD | 4 | +4 | +4 | 大容量メモリ記述子の種別を示す値。 |
| MLD_Alloc_Base | ULONGLONG | 8 | +8 | +8 | 割り当てられた大容量メモリ範囲の開始物理アドレス。 |
| MLD_Alloc_End | ULONGLONG | 8 | +16 | +16 | 割り当てられた大容量メモリ範囲の終了物理アドレス。 |
| MLD_Flags | DWORD | 4 | +24 | +24 | 大容量メモリ記述子のフラグ群。 |
| MLD_Reserved | DWORD | 4 | +28 | +28 | システム内部利用の予約領域。 |
各言語での定義
#include <windows.h>
// MEM_LARGE_DES (x64 32 / x86 32 バイト)
#pragma pack(push, 1)
typedef struct MEM_LARGE_DES {
DWORD MLD_Count;
DWORD MLD_Type;
ULONGLONG MLD_Alloc_Base;
ULONGLONG MLD_Alloc_End;
DWORD MLD_Flags;
DWORD MLD_Reserved;
} MEM_LARGE_DES;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct MEM_LARGE_DES
{
public uint MLD_Count;
public uint MLD_Type;
public ulong MLD_Alloc_Base;
public ulong MLD_Alloc_End;
public uint MLD_Flags;
public uint MLD_Reserved;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure MEM_LARGE_DES
Public MLD_Count As UInteger
Public MLD_Type As UInteger
Public MLD_Alloc_Base As ULong
Public MLD_Alloc_End As ULong
Public MLD_Flags As UInteger
Public MLD_Reserved As UInteger
End Structureimport ctypes
from ctypes import wintypes
class MEM_LARGE_DES(ctypes.Structure):
_pack_ = 1
_fields_ = [
("MLD_Count", wintypes.DWORD),
("MLD_Type", wintypes.DWORD),
("MLD_Alloc_Base", ctypes.c_ulonglong),
("MLD_Alloc_End", ctypes.c_ulonglong),
("MLD_Flags", wintypes.DWORD),
("MLD_Reserved", wintypes.DWORD),
]#[repr(C, packed(1))]
pub struct MEM_LARGE_DES {
pub MLD_Count: u32,
pub MLD_Type: u32,
pub MLD_Alloc_Base: u64,
pub MLD_Alloc_End: u64,
pub MLD_Flags: u32,
pub MLD_Reserved: u32,
}import "golang.org/x/sys/windows"
type MEM_LARGE_DES struct {
MLD_Count uint32
MLD_Type uint32
MLD_Alloc_Base uint64
MLD_Alloc_End uint64
MLD_Flags uint32
MLD_Reserved uint32
}type
MEM_LARGE_DES = packed record
MLD_Count: DWORD;
MLD_Type: DWORD;
MLD_Alloc_Base: UInt64;
MLD_Alloc_End: UInt64;
MLD_Flags: DWORD;
MLD_Reserved: DWORD;
end;const MEM_LARGE_DES = extern struct {
MLD_Count: u32,
MLD_Type: u32,
MLD_Alloc_Base: u64,
MLD_Alloc_End: u64,
MLD_Flags: u32,
MLD_Reserved: u32,
};type
MEM_LARGE_DES {.packed.} = object
MLD_Count: uint32
MLD_Type: uint32
MLD_Alloc_Base: uint64
MLD_Alloc_End: uint64
MLD_Flags: uint32
MLD_Reserved: uint32align(1)
struct MEM_LARGE_DES
{
uint MLD_Count;
uint MLD_Type;
ulong MLD_Alloc_Base;
ulong MLD_Alloc_End;
uint MLD_Flags;
uint MLD_Reserved;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MEM_LARGE_DES サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; MLD_Count : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; MLD_Type : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; MLD_Alloc_Base : ULONGLONG (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; MLD_Alloc_End : ULONGLONG (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; MLD_Flags : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; MLD_Reserved : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global MEM_LARGE_DES, pack=1
#field int MLD_Count
#field int MLD_Type
#field int64 MLD_Alloc_Base
#field int64 MLD_Alloc_End
#field int MLD_Flags
#field int MLD_Reserved
#endstruct
stdim st, MEM_LARGE_DES ; NSTRUCT 変数を確保
st->MLD_Count = 100
mes "MLD_Count=" + st->MLD_Count