ホーム › Devices.ImageAcquisition › WIA_DEV_CAP
WIA_DEV_CAP
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| guid | GUID | 16 | +0 | +0 | デバイスコマンドまたはイベントを識別するGUID。 |
| ulFlags | DWORD | 4 | +16 | +16 | ケーパビリティの属性を示すフラグ群。 |
| bstrName | LPWSTR | 8/4 | +24 | +20 | ケーパビリティの名前を示すBSTR文字列。 |
| bstrDescription | LPWSTR | 8/4 | +32 | +24 | ケーパビリティの説明を示すBSTR文字列。 |
| bstrIcon | LPWSTR | 8/4 | +40 | +28 | アイコンリソースのパスを示すBSTR文字列。 |
| bstrCommandline | LPWSTR | 8/4 | +48 | +32 | 関連付けられたコマンドラインを示すBSTR文字列。 |
各言語での定義
#include <windows.h>
// WIA_DEV_CAP (x64 56 / x86 36 バイト)
typedef struct WIA_DEV_CAP {
GUID guid;
DWORD ulFlags;
LPWSTR bstrName;
LPWSTR bstrDescription;
LPWSTR bstrIcon;
LPWSTR bstrCommandline;
} WIA_DEV_CAP;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WIA_DEV_CAP
{
public Guid guid;
public uint ulFlags;
public IntPtr bstrName;
public IntPtr bstrDescription;
public IntPtr bstrIcon;
public IntPtr bstrCommandline;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WIA_DEV_CAP
Public guid As Guid
Public ulFlags As UInteger
Public bstrName As IntPtr
Public bstrDescription As IntPtr
Public bstrIcon As IntPtr
Public bstrCommandline As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class WIA_DEV_CAP(ctypes.Structure):
_fields_ = [
("guid", GUID),
("ulFlags", wintypes.DWORD),
("bstrName", ctypes.c_void_p),
("bstrDescription", ctypes.c_void_p),
("bstrIcon", ctypes.c_void_p),
("bstrCommandline", ctypes.c_void_p),
]#[repr(C)]
pub struct WIA_DEV_CAP {
pub guid: GUID,
pub ulFlags: u32,
pub bstrName: *mut core::ffi::c_void,
pub bstrDescription: *mut core::ffi::c_void,
pub bstrIcon: *mut core::ffi::c_void,
pub bstrCommandline: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type WIA_DEV_CAP struct {
guid windows.GUID
ulFlags uint32
bstrName uintptr
bstrDescription uintptr
bstrIcon uintptr
bstrCommandline uintptr
}type
WIA_DEV_CAP = record
guid: TGUID;
ulFlags: DWORD;
bstrName: Pointer;
bstrDescription: Pointer;
bstrIcon: Pointer;
bstrCommandline: Pointer;
end;const WIA_DEV_CAP = extern struct {
guid: GUID,
ulFlags: u32,
bstrName: ?*anyopaque,
bstrDescription: ?*anyopaque,
bstrIcon: ?*anyopaque,
bstrCommandline: ?*anyopaque,
};type
WIA_DEV_CAP {.bycopy.} = object
guid: GUID
ulFlags: uint32
bstrName: pointer
bstrDescription: pointer
bstrIcon: pointer
bstrCommandline: pointerstruct WIA_DEV_CAP
{
GUID guid;
uint ulFlags;
void* bstrName;
void* bstrDescription;
void* bstrIcon;
void* bstrCommandline;
}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 サイズ: 36 バイト(x86)
dim st, 9 ; 4byte整数×9(構造体サイズ 36 / 4 切り上げ)
; guid : GUID (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; ulFlags : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; bstrName : LPWSTR (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; bstrDescription : LPWSTR (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; bstrIcon : LPWSTR (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; bstrCommandline : LPWSTR (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WIA_DEV_CAP サイズ: 56 バイト(x64)
dim st, 14 ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; guid : GUID (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; ulFlags : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; bstrName : LPWSTR (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; bstrDescription : LPWSTR (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; bstrIcon : LPWSTR (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; bstrCommandline : LPWSTR (+48, 8byte) qpoke st,48,値 / qpeek(st,48) ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global GUID, pack=1
#field int Data1
#field short Data2
#field short Data3
#field byte Data4 8
#endstruct
#defstruct global WIA_DEV_CAP
#field GUID guid
#field int ulFlags
#field intptr bstrName
#field intptr bstrDescription
#field intptr bstrIcon
#field intptr bstrCommandline
#endstruct
stdim st, WIA_DEV_CAP ; NSTRUCT 変数を確保
st->ulFlags = 100
mes "ulFlags=" + st->ulFlags