ホーム › Devices.Usb › USBD_ENDPOINT_OFFLOAD_INFORMATION
USBD_ENDPOINT_OFFLOAD_INFORMATION
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Size | DWORD | 4 | +0 | +0 | この構造体のサイズをバイト単位で示す。 |
| EndpointAddress | WORD | 2 | +4 | +4 | オフロード対象エンドポイントのアドレスを示す。 |
| ResourceId | DWORD | 4 | +6 | +6 | オフロードリソースを識別するIDを示す。 |
| Mode | USBD_ENDPOINT_OFFLOAD_MODE | 4 | +10 | +10 | エンドポイントオフロードのモードを示すUSBD_ENDPOINT_OFFLOAD_MODE列挙値。 |
| _bitfield1 | DWORD | 4 | +14 | +14 | オフロード状態を示すビットフィールド(第1ワード)。 |
| _bitfield2 | DWORD | 4 | +18 | +18 | オフロード状態を示すビットフィールド(第2ワード)。 |
| TransferSegmentLA | LONGLONG | 8 | +22 | +22 | 転送リングセグメントの論理アドレスを示す。 |
| TransferSegmentVA | void* | 8/4 | +30 | +30 | 転送リングセグメントの仮想アドレスへのポインタ。 |
| TransferRingSize | UINT_PTR | 8/4 | +38 | +34 | 転送リングのサイズを示す。 |
| TransferRingInitialCycleBit | DWORD | 4 | +46 | +38 | 転送リング初期サイクルビットを示す。 |
| MessageNumber | DWORD | 4 | +50 | +42 | MSI割り込みのメッセージ番号を示す。 |
| EventRingSegmentLA | LONGLONG | 8 | +54 | +46 | イベントリングセグメントの論理アドレスを示す。 |
| EventRingSegmentVA | void* | 8/4 | +62 | +54 | イベントリングセグメントの仮想アドレスへのポインタ。 |
| EventRingSize | UINT_PTR | 8/4 | +70 | +58 | イベントリングのサイズを示す。 |
| EventRingInitialCycleBit | DWORD | 4 | +78 | +62 | イベントリング初期サイクルビットを示す。 |
| ClientTransferRingSegmentPAIn | LONGLONG | 8 | +82 | +66 | クライアント転送リングセグメントの物理アドレス(入力)を示す。 |
| ClientTransferRingSizeIn | UINT_PTR | 8/4 | +90 | +74 | クライアント転送リングのサイズ(入力)を示す。 |
| ClientDataBufferPAIn | LONGLONG | 8 | +98 | +78 | クライアントデータバッファの物理アドレス(入力)を示す。 |
| ClientDataBufferSizeIn | UINT_PTR | 8/4 | +106 | +86 | クライアントデータバッファのサイズ(入力)を示す。 |
| ClientDataBufferLAOut | LONGLONG | 8 | +114 | +90 | クライアントデータバッファの論理アドレス(出力)を示す。 |
| ClientDataBufferVAOut | void* | 8/4 | +122 | +98 | クライアントデータバッファの仮想アドレス(出力)へのポインタ。 |
各言語での定義
#include <windows.h>
// USBD_ENDPOINT_OFFLOAD_INFORMATION (x64 130 / x86 102 バイト)
#pragma pack(push, 1)
typedef struct USBD_ENDPOINT_OFFLOAD_INFORMATION {
DWORD Size;
WORD EndpointAddress;
DWORD ResourceId;
USBD_ENDPOINT_OFFLOAD_MODE Mode;
DWORD _bitfield1;
DWORD _bitfield2;
LONGLONG TransferSegmentLA;
void* TransferSegmentVA;
UINT_PTR TransferRingSize;
DWORD TransferRingInitialCycleBit;
DWORD MessageNumber;
LONGLONG EventRingSegmentLA;
void* EventRingSegmentVA;
UINT_PTR EventRingSize;
DWORD EventRingInitialCycleBit;
LONGLONG ClientTransferRingSegmentPAIn;
UINT_PTR ClientTransferRingSizeIn;
LONGLONG ClientDataBufferPAIn;
UINT_PTR ClientDataBufferSizeIn;
LONGLONG ClientDataBufferLAOut;
void* ClientDataBufferVAOut;
} USBD_ENDPOINT_OFFLOAD_INFORMATION;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct USBD_ENDPOINT_OFFLOAD_INFORMATION
{
public uint Size;
public ushort EndpointAddress;
public uint ResourceId;
public int Mode;
public uint _bitfield1;
public uint _bitfield2;
public long TransferSegmentLA;
public IntPtr TransferSegmentVA;
public UIntPtr TransferRingSize;
public uint TransferRingInitialCycleBit;
public uint MessageNumber;
public long EventRingSegmentLA;
public IntPtr EventRingSegmentVA;
public UIntPtr EventRingSize;
public uint EventRingInitialCycleBit;
public long ClientTransferRingSegmentPAIn;
public UIntPtr ClientTransferRingSizeIn;
public long ClientDataBufferPAIn;
public UIntPtr ClientDataBufferSizeIn;
public long ClientDataBufferLAOut;
public IntPtr ClientDataBufferVAOut;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure USBD_ENDPOINT_OFFLOAD_INFORMATION
Public Size As UInteger
Public EndpointAddress As UShort
Public ResourceId As UInteger
Public Mode As Integer
Public _bitfield1 As UInteger
Public _bitfield2 As UInteger
Public TransferSegmentLA As Long
Public TransferSegmentVA As IntPtr
Public TransferRingSize As UIntPtr
Public TransferRingInitialCycleBit As UInteger
Public MessageNumber As UInteger
Public EventRingSegmentLA As Long
Public EventRingSegmentVA As IntPtr
Public EventRingSize As UIntPtr
Public EventRingInitialCycleBit As UInteger
Public ClientTransferRingSegmentPAIn As Long
Public ClientTransferRingSizeIn As UIntPtr
Public ClientDataBufferPAIn As Long
Public ClientDataBufferSizeIn As UIntPtr
Public ClientDataBufferLAOut As Long
Public ClientDataBufferVAOut As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class USBD_ENDPOINT_OFFLOAD_INFORMATION(ctypes.Structure):
_pack_ = 1
_fields_ = [
("Size", wintypes.DWORD),
("EndpointAddress", ctypes.c_ushort),
("ResourceId", wintypes.DWORD),
("Mode", ctypes.c_int),
("_bitfield1", wintypes.DWORD),
("_bitfield2", wintypes.DWORD),
("TransferSegmentLA", ctypes.c_longlong),
("TransferSegmentVA", ctypes.c_void_p),
("TransferRingSize", ctypes.c_size_t),
("TransferRingInitialCycleBit", wintypes.DWORD),
("MessageNumber", wintypes.DWORD),
("EventRingSegmentLA", ctypes.c_longlong),
("EventRingSegmentVA", ctypes.c_void_p),
("EventRingSize", ctypes.c_size_t),
("EventRingInitialCycleBit", wintypes.DWORD),
("ClientTransferRingSegmentPAIn", ctypes.c_longlong),
("ClientTransferRingSizeIn", ctypes.c_size_t),
("ClientDataBufferPAIn", ctypes.c_longlong),
("ClientDataBufferSizeIn", ctypes.c_size_t),
("ClientDataBufferLAOut", ctypes.c_longlong),
("ClientDataBufferVAOut", ctypes.c_void_p),
]#[repr(C, packed(1))]
pub struct USBD_ENDPOINT_OFFLOAD_INFORMATION {
pub Size: u32,
pub EndpointAddress: u16,
pub ResourceId: u32,
pub Mode: i32,
pub _bitfield1: u32,
pub _bitfield2: u32,
pub TransferSegmentLA: i64,
pub TransferSegmentVA: *mut core::ffi::c_void,
pub TransferRingSize: usize,
pub TransferRingInitialCycleBit: u32,
pub MessageNumber: u32,
pub EventRingSegmentLA: i64,
pub EventRingSegmentVA: *mut core::ffi::c_void,
pub EventRingSize: usize,
pub EventRingInitialCycleBit: u32,
pub ClientTransferRingSegmentPAIn: i64,
pub ClientTransferRingSizeIn: usize,
pub ClientDataBufferPAIn: i64,
pub ClientDataBufferSizeIn: usize,
pub ClientDataBufferLAOut: i64,
pub ClientDataBufferVAOut: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type USBD_ENDPOINT_OFFLOAD_INFORMATION struct {
Size uint32
EndpointAddress uint16
ResourceId uint32
Mode int32
_bitfield1 uint32
_bitfield2 uint32
TransferSegmentLA int64
TransferSegmentVA uintptr
TransferRingSize uintptr
TransferRingInitialCycleBit uint32
MessageNumber uint32
EventRingSegmentLA int64
EventRingSegmentVA uintptr
EventRingSize uintptr
EventRingInitialCycleBit uint32
ClientTransferRingSegmentPAIn int64
ClientTransferRingSizeIn uintptr
ClientDataBufferPAIn int64
ClientDataBufferSizeIn uintptr
ClientDataBufferLAOut int64
ClientDataBufferVAOut uintptr
}type
USBD_ENDPOINT_OFFLOAD_INFORMATION = packed record
Size: DWORD;
EndpointAddress: Word;
ResourceId: DWORD;
Mode: Integer;
_bitfield1: DWORD;
_bitfield2: DWORD;
TransferSegmentLA: Int64;
TransferSegmentVA: Pointer;
TransferRingSize: NativeUInt;
TransferRingInitialCycleBit: DWORD;
MessageNumber: DWORD;
EventRingSegmentLA: Int64;
EventRingSegmentVA: Pointer;
EventRingSize: NativeUInt;
EventRingInitialCycleBit: DWORD;
ClientTransferRingSegmentPAIn: Int64;
ClientTransferRingSizeIn: NativeUInt;
ClientDataBufferPAIn: Int64;
ClientDataBufferSizeIn: NativeUInt;
ClientDataBufferLAOut: Int64;
ClientDataBufferVAOut: Pointer;
end;const USBD_ENDPOINT_OFFLOAD_INFORMATION = extern struct {
Size: u32,
EndpointAddress: u16,
ResourceId: u32,
Mode: i32,
_bitfield1: u32,
_bitfield2: u32,
TransferSegmentLA: i64,
TransferSegmentVA: ?*anyopaque,
TransferRingSize: usize,
TransferRingInitialCycleBit: u32,
MessageNumber: u32,
EventRingSegmentLA: i64,
EventRingSegmentVA: ?*anyopaque,
EventRingSize: usize,
EventRingInitialCycleBit: u32,
ClientTransferRingSegmentPAIn: i64,
ClientTransferRingSizeIn: usize,
ClientDataBufferPAIn: i64,
ClientDataBufferSizeIn: usize,
ClientDataBufferLAOut: i64,
ClientDataBufferVAOut: ?*anyopaque,
};type
USBD_ENDPOINT_OFFLOAD_INFORMATION {.packed.} = object
Size: uint32
EndpointAddress: uint16
ResourceId: uint32
Mode: int32
_bitfield1: uint32
_bitfield2: uint32
TransferSegmentLA: int64
TransferSegmentVA: pointer
TransferRingSize: uint
TransferRingInitialCycleBit: uint32
MessageNumber: uint32
EventRingSegmentLA: int64
EventRingSegmentVA: pointer
EventRingSize: uint
EventRingInitialCycleBit: uint32
ClientTransferRingSegmentPAIn: int64
ClientTransferRingSizeIn: uint
ClientDataBufferPAIn: int64
ClientDataBufferSizeIn: uint
ClientDataBufferLAOut: int64
ClientDataBufferVAOut: pointeralign(1)
struct USBD_ENDPOINT_OFFLOAD_INFORMATION
{
uint Size;
ushort EndpointAddress;
uint ResourceId;
int Mode;
uint _bitfield1;
uint _bitfield2;
long TransferSegmentLA;
void* TransferSegmentVA;
size_t TransferRingSize;
uint TransferRingInitialCycleBit;
uint MessageNumber;
long EventRingSegmentLA;
void* EventRingSegmentVA;
size_t EventRingSize;
uint EventRingInitialCycleBit;
long ClientTransferRingSegmentPAIn;
size_t ClientTransferRingSizeIn;
long ClientDataBufferPAIn;
size_t ClientDataBufferSizeIn;
long ClientDataBufferLAOut;
void* ClientDataBufferVAOut;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; USBD_ENDPOINT_OFFLOAD_INFORMATION サイズ: 102 バイト(x86)
dim st, 26 ; 4byte整数×26(構造体サイズ 102 / 4 切り上げ)
; Size : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; EndpointAddress : WORD (+4, 2byte) wpoke st,4,値 / 値 = wpeek(st,4)
; ResourceId : DWORD (+6, 4byte) lpoke st,6,値 / 値 = lpeek(st,6)
; Mode : USBD_ENDPOINT_OFFLOAD_MODE (+10, 4byte) lpoke st,10,値 / 値 = lpeek(st,10)
; _bitfield1 : DWORD (+14, 4byte) lpoke st,14,値 / 値 = lpeek(st,14)
; _bitfield2 : DWORD (+18, 4byte) lpoke st,18,値 / 値 = lpeek(st,18)
; TransferSegmentLA : LONGLONG (+22, 8byte) qpoke st,22,値 / qpeek(st,22) ※IronHSPのみ。3.7/3.8は lpoke st,22,下位 : lpoke st,26,上位
; TransferSegmentVA : void* (+30, 4byte) lpoke st,30,値 / 値 = lpeek(st,30)
; TransferRingSize : UINT_PTR (+34, 4byte) lpoke st,34,値 / 値 = lpeek(st,34)
; TransferRingInitialCycleBit : DWORD (+38, 4byte) lpoke st,38,値 / 値 = lpeek(st,38)
; MessageNumber : DWORD (+42, 4byte) lpoke st,42,値 / 値 = lpeek(st,42)
; EventRingSegmentLA : LONGLONG (+46, 8byte) qpoke st,46,値 / qpeek(st,46) ※IronHSPのみ。3.7/3.8は lpoke st,46,下位 : lpoke st,50,上位
; EventRingSegmentVA : void* (+54, 4byte) lpoke st,54,値 / 値 = lpeek(st,54)
; EventRingSize : UINT_PTR (+58, 4byte) lpoke st,58,値 / 値 = lpeek(st,58)
; EventRingInitialCycleBit : DWORD (+62, 4byte) lpoke st,62,値 / 値 = lpeek(st,62)
; ClientTransferRingSegmentPAIn : LONGLONG (+66, 8byte) qpoke st,66,値 / qpeek(st,66) ※IronHSPのみ。3.7/3.8は lpoke st,66,下位 : lpoke st,70,上位
; ClientTransferRingSizeIn : UINT_PTR (+74, 4byte) lpoke st,74,値 / 値 = lpeek(st,74)
; ClientDataBufferPAIn : LONGLONG (+78, 8byte) qpoke st,78,値 / qpeek(st,78) ※IronHSPのみ。3.7/3.8は lpoke st,78,下位 : lpoke st,82,上位
; ClientDataBufferSizeIn : UINT_PTR (+86, 4byte) lpoke st,86,値 / 値 = lpeek(st,86)
; ClientDataBufferLAOut : LONGLONG (+90, 8byte) qpoke st,90,値 / qpeek(st,90) ※IronHSPのみ。3.7/3.8は lpoke st,90,下位 : lpoke st,94,上位
; ClientDataBufferVAOut : void* (+98, 4byte) lpoke st,98,値 / 値 = lpeek(st,98)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; USBD_ENDPOINT_OFFLOAD_INFORMATION サイズ: 130 バイト(x64)
dim st, 33 ; 4byte整数×33(構造体サイズ 130 / 4 切り上げ)
; Size : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; EndpointAddress : WORD (+4, 2byte) wpoke st,4,値 / 値 = wpeek(st,4)
; ResourceId : DWORD (+6, 4byte) lpoke st,6,値 / 値 = lpeek(st,6)
; Mode : USBD_ENDPOINT_OFFLOAD_MODE (+10, 4byte) lpoke st,10,値 / 値 = lpeek(st,10)
; _bitfield1 : DWORD (+14, 4byte) lpoke st,14,値 / 値 = lpeek(st,14)
; _bitfield2 : DWORD (+18, 4byte) lpoke st,18,値 / 値 = lpeek(st,18)
; TransferSegmentLA : LONGLONG (+22, 8byte) qpoke st,22,値 / qpeek(st,22) ※IronHSPのみ。3.7/3.8は lpoke st,22,下位 : lpoke st,26,上位
; TransferSegmentVA : void* (+30, 8byte) qpoke st,30,値 / qpeek(st,30) ※IronHSPのみ。3.7/3.8は lpoke st,30,下位 : lpoke st,34,上位
; TransferRingSize : UINT_PTR (+38, 8byte) qpoke st,38,値 / qpeek(st,38) ※IronHSPのみ。3.7/3.8は lpoke st,38,下位 : lpoke st,42,上位
; TransferRingInitialCycleBit : DWORD (+46, 4byte) lpoke st,46,値 / 値 = lpeek(st,46)
; MessageNumber : DWORD (+50, 4byte) lpoke st,50,値 / 値 = lpeek(st,50)
; EventRingSegmentLA : LONGLONG (+54, 8byte) qpoke st,54,値 / qpeek(st,54) ※IronHSPのみ。3.7/3.8は lpoke st,54,下位 : lpoke st,58,上位
; EventRingSegmentVA : void* (+62, 8byte) qpoke st,62,値 / qpeek(st,62) ※IronHSPのみ。3.7/3.8は lpoke st,62,下位 : lpoke st,66,上位
; EventRingSize : UINT_PTR (+70, 8byte) qpoke st,70,値 / qpeek(st,70) ※IronHSPのみ。3.7/3.8は lpoke st,70,下位 : lpoke st,74,上位
; EventRingInitialCycleBit : DWORD (+78, 4byte) lpoke st,78,値 / 値 = lpeek(st,78)
; ClientTransferRingSegmentPAIn : LONGLONG (+82, 8byte) qpoke st,82,値 / qpeek(st,82) ※IronHSPのみ。3.7/3.8は lpoke st,82,下位 : lpoke st,86,上位
; ClientTransferRingSizeIn : UINT_PTR (+90, 8byte) qpoke st,90,値 / qpeek(st,90) ※IronHSPのみ。3.7/3.8は lpoke st,90,下位 : lpoke st,94,上位
; ClientDataBufferPAIn : LONGLONG (+98, 8byte) qpoke st,98,値 / qpeek(st,98) ※IronHSPのみ。3.7/3.8は lpoke st,98,下位 : lpoke st,102,上位
; ClientDataBufferSizeIn : UINT_PTR (+106, 8byte) qpoke st,106,値 / qpeek(st,106) ※IronHSPのみ。3.7/3.8は lpoke st,106,下位 : lpoke st,110,上位
; ClientDataBufferLAOut : LONGLONG (+114, 8byte) qpoke st,114,値 / qpeek(st,114) ※IronHSPのみ。3.7/3.8は lpoke st,114,下位 : lpoke st,118,上位
; ClientDataBufferVAOut : void* (+122, 8byte) qpoke st,122,値 / qpeek(st,122) ※IronHSPのみ。3.7/3.8は lpoke st,122,下位 : lpoke st,126,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global USBD_ENDPOINT_OFFLOAD_INFORMATION, pack=1
#field int Size
#field short EndpointAddress
#field int ResourceId
#field int Mode
#field int _bitfield1
#field int _bitfield2
#field int64 TransferSegmentLA
#field intptr TransferSegmentVA
#field intptr TransferRingSize
#field int TransferRingInitialCycleBit
#field int MessageNumber
#field int64 EventRingSegmentLA
#field intptr EventRingSegmentVA
#field intptr EventRingSize
#field int EventRingInitialCycleBit
#field int64 ClientTransferRingSegmentPAIn
#field intptr ClientTransferRingSizeIn
#field int64 ClientDataBufferPAIn
#field intptr ClientDataBufferSizeIn
#field int64 ClientDataBufferLAOut
#field intptr ClientDataBufferVAOut
#endstruct
stdim st, USBD_ENDPOINT_OFFLOAD_INFORMATION ; NSTRUCT 変数を確保
st->Size = 100
mes "Size=" + st->Size