ホーム › Media.KernelStreaming › KSCAMERA_PROFILE_INFO
KSCAMERA_PROFILE_INFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| ProfileId | GUID | 16 | +0 | +0 | カメラプロファイルを識別するGUID。 |
| Index | DWORD | 4 | +16 | +16 | 同一プロファイルID内のインデックスを示す。 |
| PinCount | DWORD | 4 | +20 | +20 | Pins配列の要素数を示す。 |
| Pins | KSCAMERA_PROFILE_PININFO* | 8/4 | +24 | +24 | プロファイルに含まれるピン情報の配列KSCAMERA_PROFILE_PININFOへのポインタ。 |
各言語での定義
#include <windows.h>
// KSCAMERA_PROFILE_INFO (x64 32 / x86 28 バイト)
typedef struct KSCAMERA_PROFILE_INFO {
GUID ProfileId;
DWORD Index;
DWORD PinCount;
KSCAMERA_PROFILE_PININFO* Pins;
} KSCAMERA_PROFILE_INFO;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct KSCAMERA_PROFILE_INFO
{
public Guid ProfileId;
public uint Index;
public uint PinCount;
public IntPtr Pins;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure KSCAMERA_PROFILE_INFO
Public ProfileId As Guid
Public Index As UInteger
Public PinCount As UInteger
Public Pins As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class KSCAMERA_PROFILE_INFO(ctypes.Structure):
_fields_ = [
("ProfileId", GUID),
("Index", wintypes.DWORD),
("PinCount", wintypes.DWORD),
("Pins", ctypes.c_void_p),
]#[repr(C)]
pub struct KSCAMERA_PROFILE_INFO {
pub ProfileId: GUID,
pub Index: u32,
pub PinCount: u32,
pub Pins: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type KSCAMERA_PROFILE_INFO struct {
ProfileId windows.GUID
Index uint32
PinCount uint32
Pins uintptr
}type
KSCAMERA_PROFILE_INFO = record
ProfileId: TGUID;
Index: DWORD;
PinCount: DWORD;
Pins: Pointer;
end;const KSCAMERA_PROFILE_INFO = extern struct {
ProfileId: GUID,
Index: u32,
PinCount: u32,
Pins: ?*anyopaque,
};type
KSCAMERA_PROFILE_INFO {.bycopy.} = object
ProfileId: GUID
Index: uint32
PinCount: uint32
Pins: pointerstruct KSCAMERA_PROFILE_INFO
{
GUID ProfileId;
uint Index;
uint PinCount;
void* Pins;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; KSCAMERA_PROFILE_INFO サイズ: 28 バイト(x86)
dim st, 7 ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; ProfileId : GUID (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; Index : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; PinCount : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; Pins : KSCAMERA_PROFILE_PININFO* (+24, 4byte) varptr(st)+24 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; KSCAMERA_PROFILE_INFO サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; ProfileId : GUID (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; Index : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; PinCount : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; Pins : KSCAMERA_PROFILE_PININFO* (+24, 8byte) varptr(st)+24 を基点に操作(8byte:入れ子/配列)
; ※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 KSCAMERA_PROFILE_INFO
#field GUID ProfileId
#field int Index
#field int PinCount
#field intptr Pins
#endstruct
stdim st, KSCAMERA_PROFILE_INFO ; NSTRUCT 変数を確保
st->Index = 100
mes "Index=" + st->Index