ホーム › Devices.DeviceAndDriverInstallation › MEM_LARGE_RANGE
MEM_LARGE_RANGE
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| MLR_Align | ULONGLONG | 8 | +0 | +0 | 大容量メモリ範囲のアライメント要件を示すビットマスク。 |
| MLR_nBytes | ULONGLONG | 8 | +8 | +8 | 要求する大容量メモリ範囲のバイト数(64ビット)。 |
| MLR_Min | ULONGLONG | 8 | +16 | +16 | 許容される物理アドレスの下限値。 |
| MLR_Max | ULONGLONG | 8 | +24 | +24 | 許容される物理アドレスの上限値。 |
| MLR_Flags | DWORD | 4 | +32 | +32 | 大容量メモリ記述子のフラグ群。 |
| MLR_Reserved | DWORD | 4 | +36 | +36 | システム内部利用の予約領域。 |
各言語での定義
#include <windows.h>
// MEM_LARGE_RANGE (x64 40 / x86 40 バイト)
#pragma pack(push, 1)
typedef struct MEM_LARGE_RANGE {
ULONGLONG MLR_Align;
ULONGLONG MLR_nBytes;
ULONGLONG MLR_Min;
ULONGLONG MLR_Max;
DWORD MLR_Flags;
DWORD MLR_Reserved;
} MEM_LARGE_RANGE;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct MEM_LARGE_RANGE
{
public ulong MLR_Align;
public ulong MLR_nBytes;
public ulong MLR_Min;
public ulong MLR_Max;
public uint MLR_Flags;
public uint MLR_Reserved;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure MEM_LARGE_RANGE
Public MLR_Align As ULong
Public MLR_nBytes As ULong
Public MLR_Min As ULong
Public MLR_Max As ULong
Public MLR_Flags As UInteger
Public MLR_Reserved As UInteger
End Structureimport ctypes
from ctypes import wintypes
class MEM_LARGE_RANGE(ctypes.Structure):
_pack_ = 1
_fields_ = [
("MLR_Align", ctypes.c_ulonglong),
("MLR_nBytes", ctypes.c_ulonglong),
("MLR_Min", ctypes.c_ulonglong),
("MLR_Max", ctypes.c_ulonglong),
("MLR_Flags", wintypes.DWORD),
("MLR_Reserved", wintypes.DWORD),
]#[repr(C, packed(1))]
pub struct MEM_LARGE_RANGE {
pub MLR_Align: u64,
pub MLR_nBytes: u64,
pub MLR_Min: u64,
pub MLR_Max: u64,
pub MLR_Flags: u32,
pub MLR_Reserved: u32,
}import "golang.org/x/sys/windows"
type MEM_LARGE_RANGE struct {
MLR_Align uint64
MLR_nBytes uint64
MLR_Min uint64
MLR_Max uint64
MLR_Flags uint32
MLR_Reserved uint32
}type
MEM_LARGE_RANGE = packed record
MLR_Align: UInt64;
MLR_nBytes: UInt64;
MLR_Min: UInt64;
MLR_Max: UInt64;
MLR_Flags: DWORD;
MLR_Reserved: DWORD;
end;const MEM_LARGE_RANGE = extern struct {
MLR_Align: u64,
MLR_nBytes: u64,
MLR_Min: u64,
MLR_Max: u64,
MLR_Flags: u32,
MLR_Reserved: u32,
};type
MEM_LARGE_RANGE {.packed.} = object
MLR_Align: uint64
MLR_nBytes: uint64
MLR_Min: uint64
MLR_Max: uint64
MLR_Flags: uint32
MLR_Reserved: uint32align(1)
struct MEM_LARGE_RANGE
{
ulong MLR_Align;
ulong MLR_nBytes;
ulong MLR_Min;
ulong MLR_Max;
uint MLR_Flags;
uint MLR_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_RANGE サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; MLR_Align : ULONGLONG (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; MLR_nBytes : ULONGLONG (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; MLR_Min : ULONGLONG (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; MLR_Max : ULONGLONG (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; MLR_Flags : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; MLR_Reserved : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global MEM_LARGE_RANGE, pack=1
#field int64 MLR_Align
#field int64 MLR_nBytes
#field int64 MLR_Min
#field int64 MLR_Max
#field int MLR_Flags
#field int MLR_Reserved
#endstruct
stdim st, MEM_LARGE_RANGE ; NSTRUCT 変数を確保
st->MLR_Align = 100
mes "MLR_Align=" + st->MLR_Align