ホーム › Devices.DeviceAndDriverInstallation › IRQ_DES_32
IRQ_DES_32
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| IRQD_Count | DWORD | 4 | +0 | +0 | 後続のIRQ_RANGE配列の要素数。 |
| IRQD_Type | DWORD | 4 | +4 | +4 | IRQ記述子の種別を示す値。 |
| IRQD_Flags | IRQD_FLAGS | 4 | +8 | +8 | IRQ記述子のフラグ群(IRQD_FLAGS)。 |
| IRQD_Alloc_Num | DWORD | 4 | +12 | +12 | 割り当てられたIRQ番号。 |
| IRQD_Affinity | DWORD | 4 | +16 | +16 | IRQの割り込みアフィニティを示す32ビットマスク。 |
各言語での定義
#include <windows.h>
// IRQ_DES_32 (x64 20 / x86 20 バイト)
#pragma pack(push, 1)
typedef struct IRQ_DES_32 {
DWORD IRQD_Count;
DWORD IRQD_Type;
IRQD_FLAGS IRQD_Flags;
DWORD IRQD_Alloc_Num;
DWORD IRQD_Affinity;
} IRQ_DES_32;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct IRQ_DES_32
{
public uint IRQD_Count;
public uint IRQD_Type;
public uint IRQD_Flags;
public uint IRQD_Alloc_Num;
public uint IRQD_Affinity;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure IRQ_DES_32
Public IRQD_Count As UInteger
Public IRQD_Type As UInteger
Public IRQD_Flags As UInteger
Public IRQD_Alloc_Num As UInteger
Public IRQD_Affinity As UInteger
End Structureimport ctypes
from ctypes import wintypes
class IRQ_DES_32(ctypes.Structure):
_pack_ = 1
_fields_ = [
("IRQD_Count", wintypes.DWORD),
("IRQD_Type", wintypes.DWORD),
("IRQD_Flags", wintypes.DWORD),
("IRQD_Alloc_Num", wintypes.DWORD),
("IRQD_Affinity", wintypes.DWORD),
]#[repr(C, packed(1))]
pub struct IRQ_DES_32 {
pub IRQD_Count: u32,
pub IRQD_Type: u32,
pub IRQD_Flags: u32,
pub IRQD_Alloc_Num: u32,
pub IRQD_Affinity: u32,
}import "golang.org/x/sys/windows"
type IRQ_DES_32 struct {
IRQD_Count uint32
IRQD_Type uint32
IRQD_Flags uint32
IRQD_Alloc_Num uint32
IRQD_Affinity uint32
}type
IRQ_DES_32 = packed record
IRQD_Count: DWORD;
IRQD_Type: DWORD;
IRQD_Flags: DWORD;
IRQD_Alloc_Num: DWORD;
IRQD_Affinity: DWORD;
end;const IRQ_DES_32 = extern struct {
IRQD_Count: u32,
IRQD_Type: u32,
IRQD_Flags: u32,
IRQD_Alloc_Num: u32,
IRQD_Affinity: u32,
};type
IRQ_DES_32 {.packed.} = object
IRQD_Count: uint32
IRQD_Type: uint32
IRQD_Flags: uint32
IRQD_Alloc_Num: uint32
IRQD_Affinity: uint32align(1)
struct IRQ_DES_32
{
uint IRQD_Count;
uint IRQD_Type;
uint IRQD_Flags;
uint IRQD_Alloc_Num;
uint IRQD_Affinity;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; IRQ_DES_32 サイズ: 20 バイト(x64)
dim st, 5 ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; IRQD_Count : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; IRQD_Type : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; IRQD_Flags : IRQD_FLAGS (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; IRQD_Alloc_Num : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; IRQD_Affinity : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global IRQ_DES_32, pack=1
#field int IRQD_Count
#field int IRQD_Type
#field int IRQD_Flags
#field int IRQD_Alloc_Num
#field int IRQD_Affinity
#endstruct
stdim st, IRQ_DES_32 ; NSTRUCT 変数を確保
st->IRQD_Count = 100
mes "IRQD_Count=" + st->IRQD_Count