ホーム › Media.KernelStreaming › KSTOPOLOGY_ENDPOINTIDPAIR
KSTOPOLOGY_ENDPOINTIDPAIR
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| RenderEndpoint | KSTOPOLOGY_ENDPOINTID | 524 | +0 | +0 | レンダリング(再生)側エンドポイントの識別子である。 |
| CaptureEndpoint | KSTOPOLOGY_ENDPOINTID | 524 | +524 | +524 | キャプチャ(録音)側エンドポイントの識別子である。 |
各言語での定義
#include <windows.h>
// KSTOPOLOGY_ENDPOINTID (x64 524 / x86 524 バイト)
typedef struct KSTOPOLOGY_ENDPOINTID {
WCHAR TopologyName[260];
DWORD PinId;
} KSTOPOLOGY_ENDPOINTID;
// KSTOPOLOGY_ENDPOINTIDPAIR (x64 1048 / x86 1048 バイト)
typedef struct KSTOPOLOGY_ENDPOINTIDPAIR {
KSTOPOLOGY_ENDPOINTID RenderEndpoint;
KSTOPOLOGY_ENDPOINTID CaptureEndpoint;
} KSTOPOLOGY_ENDPOINTIDPAIR;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct KSTOPOLOGY_ENDPOINTID
{
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] public string TopologyName;
public uint PinId;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct KSTOPOLOGY_ENDPOINTIDPAIR
{
public KSTOPOLOGY_ENDPOINTID RenderEndpoint;
public KSTOPOLOGY_ENDPOINTID CaptureEndpoint;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure KSTOPOLOGY_ENDPOINTID
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=260)> Public TopologyName As String
Public PinId As UInteger
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure KSTOPOLOGY_ENDPOINTIDPAIR
Public RenderEndpoint As KSTOPOLOGY_ENDPOINTID
Public CaptureEndpoint As KSTOPOLOGY_ENDPOINTID
End Structureimport ctypes
from ctypes import wintypes
class KSTOPOLOGY_ENDPOINTID(ctypes.Structure):
_fields_ = [
("TopologyName", ctypes.c_wchar * 260),
("PinId", wintypes.DWORD),
]
class KSTOPOLOGY_ENDPOINTIDPAIR(ctypes.Structure):
_fields_ = [
("RenderEndpoint", KSTOPOLOGY_ENDPOINTID),
("CaptureEndpoint", KSTOPOLOGY_ENDPOINTID),
]#[repr(C)]
pub struct KSTOPOLOGY_ENDPOINTID {
pub TopologyName: [u16; 260],
pub PinId: u32,
}
#[repr(C)]
pub struct KSTOPOLOGY_ENDPOINTIDPAIR {
pub RenderEndpoint: KSTOPOLOGY_ENDPOINTID,
pub CaptureEndpoint: KSTOPOLOGY_ENDPOINTID,
}import "golang.org/x/sys/windows"
type KSTOPOLOGY_ENDPOINTID struct {
TopologyName [260]uint16
PinId uint32
}
type KSTOPOLOGY_ENDPOINTIDPAIR struct {
RenderEndpoint KSTOPOLOGY_ENDPOINTID
CaptureEndpoint KSTOPOLOGY_ENDPOINTID
}type
KSTOPOLOGY_ENDPOINTID = record
TopologyName: array[0..259] of WideChar;
PinId: DWORD;
end;
KSTOPOLOGY_ENDPOINTIDPAIR = record
RenderEndpoint: KSTOPOLOGY_ENDPOINTID;
CaptureEndpoint: KSTOPOLOGY_ENDPOINTID;
end;const KSTOPOLOGY_ENDPOINTID = extern struct {
TopologyName: [260]u16,
PinId: u32,
};
const KSTOPOLOGY_ENDPOINTIDPAIR = extern struct {
RenderEndpoint: KSTOPOLOGY_ENDPOINTID,
CaptureEndpoint: KSTOPOLOGY_ENDPOINTID,
};type
KSTOPOLOGY_ENDPOINTID {.bycopy.} = object
TopologyName: array[260, uint16]
PinId: uint32
KSTOPOLOGY_ENDPOINTIDPAIR {.bycopy.} = object
RenderEndpoint: KSTOPOLOGY_ENDPOINTID
CaptureEndpoint: KSTOPOLOGY_ENDPOINTIDstruct KSTOPOLOGY_ENDPOINTID
{
wchar[260] TopologyName;
uint PinId;
}
struct KSTOPOLOGY_ENDPOINTIDPAIR
{
KSTOPOLOGY_ENDPOINTID RenderEndpoint;
KSTOPOLOGY_ENDPOINTID CaptureEndpoint;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; KSTOPOLOGY_ENDPOINTIDPAIR サイズ: 1048 バイト(x64)
dim st, 262 ; 4byte整数×262(構造体サイズ 1048 / 4 切り上げ)
; RenderEndpoint : KSTOPOLOGY_ENDPOINTID (+0, 524byte) varptr(st)+0 を基点に操作(524byte:入れ子/配列)
; CaptureEndpoint : KSTOPOLOGY_ENDPOINTID (+524, 524byte) varptr(st)+524 を基点に操作(524byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global KSTOPOLOGY_ENDPOINTID
#field wchar TopologyName 260
#field int PinId
#endstruct
#defstruct global KSTOPOLOGY_ENDPOINTIDPAIR
#field KSTOPOLOGY_ENDPOINTID RenderEndpoint
#field KSTOPOLOGY_ENDPOINTID CaptureEndpoint
#endstruct
stdim st, KSTOPOLOGY_ENDPOINTIDPAIR ; NSTRUCT 変数を確保