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

WIA_DEV_CAP_DRV

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

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

フィールド

フィールドサイズx64x86説明
guidGUID*8/4+0+0デバイスコマンドまたはイベントを識別するGUIDへのポインター。
ulFlagsDWORD4+8+4ケーパビリティの属性を示すフラグ群。
wszNameLPWSTR8/4+16+8ケーパビリティの名前を示すワイド文字列。
wszDescriptionLPWSTR8/4+24+12ケーパビリティの説明を示すワイド文字列。
wszIconLPWSTR8/4+32+16アイコンリソースのパスを示すワイド文字列。

各言語での定義

#include <windows.h>

// WIA_DEV_CAP_DRV  (x64 40 / x86 20 バイト)
typedef struct WIA_DEV_CAP_DRV {
    GUID* guid;
    DWORD ulFlags;
    LPWSTR wszName;
    LPWSTR wszDescription;
    LPWSTR wszIcon;
} WIA_DEV_CAP_DRV;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WIA_DEV_CAP_DRV
{
    public IntPtr guid;
    public uint ulFlags;
    public IntPtr wszName;
    public IntPtr wszDescription;
    public IntPtr wszIcon;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WIA_DEV_CAP_DRV
    Public guid As IntPtr
    Public ulFlags As UInteger
    Public wszName As IntPtr
    Public wszDescription As IntPtr
    Public wszIcon As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class WIA_DEV_CAP_DRV(ctypes.Structure):
    _fields_ = [
        ("guid", ctypes.c_void_p),
        ("ulFlags", wintypes.DWORD),
        ("wszName", ctypes.c_void_p),
        ("wszDescription", ctypes.c_void_p),
        ("wszIcon", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct WIA_DEV_CAP_DRV {
    pub guid: *mut core::ffi::c_void,
    pub ulFlags: u32,
    pub wszName: *mut core::ffi::c_void,
    pub wszDescription: *mut core::ffi::c_void,
    pub wszIcon: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type WIA_DEV_CAP_DRV struct {
	guid uintptr
	ulFlags uint32
	wszName uintptr
	wszDescription uintptr
	wszIcon uintptr
}
type
  WIA_DEV_CAP_DRV = record
    guid: Pointer;
    ulFlags: DWORD;
    wszName: Pointer;
    wszDescription: Pointer;
    wszIcon: Pointer;
  end;
const WIA_DEV_CAP_DRV = extern struct {
    guid: ?*anyopaque,
    ulFlags: u32,
    wszName: ?*anyopaque,
    wszDescription: ?*anyopaque,
    wszIcon: ?*anyopaque,
};
type
  WIA_DEV_CAP_DRV {.bycopy.} = object
    guid: pointer
    ulFlags: uint32
    wszName: pointer
    wszDescription: pointer
    wszIcon: pointer
struct WIA_DEV_CAP_DRV
{
    void* guid;
    uint ulFlags;
    void* wszName;
    void* wszDescription;
    void* wszIcon;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; WIA_DEV_CAP_DRV サイズ: 20 バイト(x86)
dim st, 5    ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; guid : GUID* (+0, 4byte)  varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; ulFlags : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; wszName : LPWSTR (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; wszDescription : LPWSTR (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; wszIcon : LPWSTR (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WIA_DEV_CAP_DRV サイズ: 40 バイト(x64)
dim st, 10    ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; guid : GUID* (+0, 8byte)  varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; ulFlags : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; wszName : LPWSTR (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; wszDescription : LPWSTR (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; wszIcon : LPWSTR (+32, 8byte)  qpoke st,32,値 / qpeek(st,32)  ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WIA_DEV_CAP_DRV
    #field intptr guid
    #field int ulFlags
    #field intptr wszName
    #field intptr wszDescription
    #field intptr wszIcon
#endstruct

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