Win32 API 日本語リファレンス
ホームSystem.Ioctl › QUERY_BAD_RANGES_INPUT

QUERY_BAD_RANGES_INPUT

構造体
サイズx64: 24 バイト / x86: 24 バイト

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

フィールド

フィールドサイズx64x86説明
FlagsDWORD4+0+0不良範囲問い合わせの動作を制御するフラグ。
NumRangesDWORD4+4+4Ranges配列に含まれる問い合わせ範囲の数。
RangesQUERY_BAD_RANGES_INPUT_RANGE16+8+8問い合わせ対象範囲を表すQUERY_BAD_RANGES_INPUT_RANGE配列の先頭。

各言語での定義

#include <windows.h>

// QUERY_BAD_RANGES_INPUT_RANGE  (x64 16 / x86 16 バイト)
typedef struct QUERY_BAD_RANGES_INPUT_RANGE {
    ULONGLONG StartOffset;
    ULONGLONG LengthInBytes;
} QUERY_BAD_RANGES_INPUT_RANGE;

// QUERY_BAD_RANGES_INPUT  (x64 24 / x86 24 バイト)
typedef struct QUERY_BAD_RANGES_INPUT {
    DWORD Flags;
    DWORD NumRanges;
    QUERY_BAD_RANGES_INPUT_RANGE Ranges[1];
} QUERY_BAD_RANGES_INPUT;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct QUERY_BAD_RANGES_INPUT_RANGE
{
    public ulong StartOffset;
    public ulong LengthInBytes;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct QUERY_BAD_RANGES_INPUT
{
    public uint Flags;
    public uint NumRanges;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public QUERY_BAD_RANGES_INPUT_RANGE[] Ranges;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure QUERY_BAD_RANGES_INPUT_RANGE
    Public StartOffset As ULong
    Public LengthInBytes As ULong
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure QUERY_BAD_RANGES_INPUT
    Public Flags As UInteger
    Public NumRanges As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public Ranges() As QUERY_BAD_RANGES_INPUT_RANGE
End Structure
import ctypes
from ctypes import wintypes

class QUERY_BAD_RANGES_INPUT_RANGE(ctypes.Structure):
    _fields_ = [
        ("StartOffset", ctypes.c_ulonglong),
        ("LengthInBytes", ctypes.c_ulonglong),
    ]

class QUERY_BAD_RANGES_INPUT(ctypes.Structure):
    _fields_ = [
        ("Flags", wintypes.DWORD),
        ("NumRanges", wintypes.DWORD),
        ("Ranges", QUERY_BAD_RANGES_INPUT_RANGE * 1),
    ]
#[repr(C)]
pub struct QUERY_BAD_RANGES_INPUT_RANGE {
    pub StartOffset: u64,
    pub LengthInBytes: u64,
}

#[repr(C)]
pub struct QUERY_BAD_RANGES_INPUT {
    pub Flags: u32,
    pub NumRanges: u32,
    pub Ranges: [QUERY_BAD_RANGES_INPUT_RANGE; 1],
}
import "golang.org/x/sys/windows"

type QUERY_BAD_RANGES_INPUT_RANGE struct {
	StartOffset uint64
	LengthInBytes uint64
}

type QUERY_BAD_RANGES_INPUT struct {
	Flags uint32
	NumRanges uint32
	Ranges [1]QUERY_BAD_RANGES_INPUT_RANGE
}
type
  QUERY_BAD_RANGES_INPUT_RANGE = record
    StartOffset: UInt64;
    LengthInBytes: UInt64;
  end;

  QUERY_BAD_RANGES_INPUT = record
    Flags: DWORD;
    NumRanges: DWORD;
    Ranges: array[0..0] of QUERY_BAD_RANGES_INPUT_RANGE;
  end;
const QUERY_BAD_RANGES_INPUT_RANGE = extern struct {
    StartOffset: u64,
    LengthInBytes: u64,
};

const QUERY_BAD_RANGES_INPUT = extern struct {
    Flags: u32,
    NumRanges: u32,
    Ranges: [1]QUERY_BAD_RANGES_INPUT_RANGE,
};
type
  QUERY_BAD_RANGES_INPUT_RANGE {.bycopy.} = object
    StartOffset: uint64
    LengthInBytes: uint64

  QUERY_BAD_RANGES_INPUT {.bycopy.} = object
    Flags: uint32
    NumRanges: uint32
    Ranges: array[1, QUERY_BAD_RANGES_INPUT_RANGE]
struct QUERY_BAD_RANGES_INPUT_RANGE
{
    ulong StartOffset;
    ulong LengthInBytes;
}

struct QUERY_BAD_RANGES_INPUT
{
    uint Flags;
    uint NumRanges;
    QUERY_BAD_RANGES_INPUT_RANGE[1] Ranges;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; QUERY_BAD_RANGES_INPUT サイズ: 24 バイト(x64)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; Flags : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; NumRanges : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; Ranges : QUERY_BAD_RANGES_INPUT_RANGE (+8, 16byte)  varptr(st)+8 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global QUERY_BAD_RANGES_INPUT_RANGE
    #field int64 StartOffset
    #field int64 LengthInBytes
#endstruct

#defstruct global QUERY_BAD_RANGES_INPUT
    #field int Flags
    #field int NumRanges
    #field QUERY_BAD_RANGES_INPUT_RANGE Ranges 1
#endstruct

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