Win32 API 日本語リファレンス
ホームDevices › IEEE1394_VDEV_PNP_REQUEST

IEEE1394_VDEV_PNP_REQUEST

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

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

フィールド

フィールドサイズx64x86説明
fulFlagsDWORD4+0+0仮想デバイスのPnP要求動作を制御するフラグ。
ReservedDWORD4+4+4予約フィールド。0を設定する。
InstanceIdULONGLONG8+8+81394仮想デバイスのインスタンスIDを表す64ビット値。
DeviceIdBYTE1+16+16デバイス識別子バイト列の先頭。

各言語での定義

#include <windows.h>

// IEEE1394_VDEV_PNP_REQUEST  (x64 24 / x86 24 バイト)
typedef struct IEEE1394_VDEV_PNP_REQUEST {
    DWORD fulFlags;
    DWORD Reserved;
    ULONGLONG InstanceId;
    BYTE DeviceId;
} IEEE1394_VDEV_PNP_REQUEST;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct IEEE1394_VDEV_PNP_REQUEST
{
    public uint fulFlags;
    public uint Reserved;
    public ulong InstanceId;
    public byte DeviceId;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure IEEE1394_VDEV_PNP_REQUEST
    Public fulFlags As UInteger
    Public Reserved As UInteger
    Public InstanceId As ULong
    Public DeviceId As Byte
End Structure
import ctypes
from ctypes import wintypes

class IEEE1394_VDEV_PNP_REQUEST(ctypes.Structure):
    _fields_ = [
        ("fulFlags", wintypes.DWORD),
        ("Reserved", wintypes.DWORD),
        ("InstanceId", ctypes.c_ulonglong),
        ("DeviceId", ctypes.c_ubyte),
    ]
#[repr(C)]
pub struct IEEE1394_VDEV_PNP_REQUEST {
    pub fulFlags: u32,
    pub Reserved: u32,
    pub InstanceId: u64,
    pub DeviceId: u8,
}
import "golang.org/x/sys/windows"

type IEEE1394_VDEV_PNP_REQUEST struct {
	fulFlags uint32
	Reserved uint32
	InstanceId uint64
	DeviceId byte
}
type
  IEEE1394_VDEV_PNP_REQUEST = record
    fulFlags: DWORD;
    Reserved: DWORD;
    InstanceId: UInt64;
    DeviceId: Byte;
  end;
const IEEE1394_VDEV_PNP_REQUEST = extern struct {
    fulFlags: u32,
    Reserved: u32,
    InstanceId: u64,
    DeviceId: u8,
};
type
  IEEE1394_VDEV_PNP_REQUEST {.bycopy.} = object
    fulFlags: uint32
    Reserved: uint32
    InstanceId: uint64
    DeviceId: uint8
struct IEEE1394_VDEV_PNP_REQUEST
{
    uint fulFlags;
    uint Reserved;
    ulong InstanceId;
    ubyte DeviceId;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; IEEE1394_VDEV_PNP_REQUEST サイズ: 24 バイト(x64)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; fulFlags : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Reserved : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; InstanceId : ULONGLONG (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; DeviceId : BYTE (+16, 1byte)  poke st,16,値  /  値 = peek(st,16)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global IEEE1394_VDEV_PNP_REQUEST
    #field int fulFlags
    #field int Reserved
    #field int64 InstanceId
    #field byte DeviceId
#endstruct

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