ホーム › Devices.Usb › DRV_VERSION
DRV_VERSION
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| major | DWORD | 4 | +0 | +0 | ドライバのメジャーバージョン番号。 |
| minor | DWORD | 4 | +4 | +4 | ドライバのマイナーバージョン番号。 |
| internal | DWORD | 4 | +8 | +8 | ドライバの内部(ビルド)バージョン番号。 |
各言語での定義
#include <windows.h>
// DRV_VERSION (x64 12 / x86 12 バイト)
typedef struct DRV_VERSION {
DWORD major;
DWORD minor;
DWORD internal;
} DRV_VERSION;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DRV_VERSION
{
public uint major;
public uint minor;
public uint internal;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DRV_VERSION
Public major As UInteger
Public minor As UInteger
Public internal As UInteger
End Structureimport ctypes
from ctypes import wintypes
class DRV_VERSION(ctypes.Structure):
_fields_ = [
("major", wintypes.DWORD),
("minor", wintypes.DWORD),
("internal", wintypes.DWORD),
]#[repr(C)]
pub struct DRV_VERSION {
pub major: u32,
pub minor: u32,
pub internal: u32,
}import "golang.org/x/sys/windows"
type DRV_VERSION struct {
major uint32
minor uint32
internal uint32
}type
DRV_VERSION = record
major: DWORD;
minor: DWORD;
internal: DWORD;
end;const DRV_VERSION = extern struct {
major: u32,
minor: u32,
internal: u32,
};type
DRV_VERSION {.bycopy.} = object
major: uint32
minor: uint32
internal: uint32struct DRV_VERSION
{
uint major;
uint minor;
uint internal;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DRV_VERSION サイズ: 12 バイト(x64)
dim st, 3 ; 4byte整数×3(構造体サイズ 12 / 4 切り上げ)
; major : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; minor : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; internal : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DRV_VERSION
#field int major
#field int minor
#field int internal
#endstruct
stdim st, DRV_VERSION ; NSTRUCT 変数を確保
st->major = 100
mes "major=" + st->major