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