ホーム › Devices.Cdrom › CDROM_PERFORMANCE_REQUEST
CDROM_PERFORMANCE_REQUEST
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| RequestType | CDROM_PERFORMANCE_REQUEST_TYPE | 4 | +0 | +0 | パフォーマンス情報要求の種類を示す列挙値。 |
| PerformanceType | CDROM_PERFORMANCE_TYPE | 4 | +4 | +4 | 取得するパフォーマンスの種類を示す列挙値。読み・書き性能を表す。 |
| Exceptions | CDROM_PERFORMANCE_EXCEPTION_TYPE | 4 | +8 | +8 | 例外情報の扱いを示す列挙値。ノミナルか例外かを指定。 |
| Tolerance | CDROM_PERFORMANCE_TOLERANCE_TYPE | 4 | +12 | +12 | 許容誤差の扱いを示す列挙値。 |
| StaringLba | DWORD | 4 | +16 | +16 | パフォーマンス測定の開始論理ブロックアドレスを示す。 |
各言語での定義
#include <windows.h>
// CDROM_PERFORMANCE_REQUEST (x64 20 / x86 20 バイト)
typedef struct CDROM_PERFORMANCE_REQUEST {
CDROM_PERFORMANCE_REQUEST_TYPE RequestType;
CDROM_PERFORMANCE_TYPE PerformanceType;
CDROM_PERFORMANCE_EXCEPTION_TYPE Exceptions;
CDROM_PERFORMANCE_TOLERANCE_TYPE Tolerance;
DWORD StaringLba;
} CDROM_PERFORMANCE_REQUEST;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CDROM_PERFORMANCE_REQUEST
{
public int RequestType;
public int PerformanceType;
public int Exceptions;
public int Tolerance;
public uint StaringLba;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CDROM_PERFORMANCE_REQUEST
Public RequestType As Integer
Public PerformanceType As Integer
Public Exceptions As Integer
Public Tolerance As Integer
Public StaringLba As UInteger
End Structureimport ctypes
from ctypes import wintypes
class CDROM_PERFORMANCE_REQUEST(ctypes.Structure):
_fields_ = [
("RequestType", ctypes.c_int),
("PerformanceType", ctypes.c_int),
("Exceptions", ctypes.c_int),
("Tolerance", ctypes.c_int),
("StaringLba", wintypes.DWORD),
]#[repr(C)]
pub struct CDROM_PERFORMANCE_REQUEST {
pub RequestType: i32,
pub PerformanceType: i32,
pub Exceptions: i32,
pub Tolerance: i32,
pub StaringLba: u32,
}import "golang.org/x/sys/windows"
type CDROM_PERFORMANCE_REQUEST struct {
RequestType int32
PerformanceType int32
Exceptions int32
Tolerance int32
StaringLba uint32
}type
CDROM_PERFORMANCE_REQUEST = record
RequestType: Integer;
PerformanceType: Integer;
Exceptions: Integer;
Tolerance: Integer;
StaringLba: DWORD;
end;const CDROM_PERFORMANCE_REQUEST = extern struct {
RequestType: i32,
PerformanceType: i32,
Exceptions: i32,
Tolerance: i32,
StaringLba: u32,
};type
CDROM_PERFORMANCE_REQUEST {.bycopy.} = object
RequestType: int32
PerformanceType: int32
Exceptions: int32
Tolerance: int32
StaringLba: uint32struct CDROM_PERFORMANCE_REQUEST
{
int RequestType;
int PerformanceType;
int Exceptions;
int Tolerance;
uint StaringLba;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CDROM_PERFORMANCE_REQUEST サイズ: 20 バイト(x64)
dim st, 5 ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; RequestType : CDROM_PERFORMANCE_REQUEST_TYPE (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; PerformanceType : CDROM_PERFORMANCE_TYPE (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Exceptions : CDROM_PERFORMANCE_EXCEPTION_TYPE (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; Tolerance : CDROM_PERFORMANCE_TOLERANCE_TYPE (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; StaringLba : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global CDROM_PERFORMANCE_REQUEST
#field int RequestType
#field int PerformanceType
#field int Exceptions
#field int Tolerance
#field int StaringLba
#endstruct
stdim st, CDROM_PERFORMANCE_REQUEST ; NSTRUCT 変数を確保
st->RequestType = 100
mes "RequestType=" + st->RequestType