Win32 API 日本語リファレンス
ホームMedia.KernelStreaming › KSTOPOLOGY_ENDPOINTID

KSTOPOLOGY_ENDPOINTID

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

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

フィールド

フィールドサイズx64x86説明
TopologyNameWCHAR520+0+0トポロジフィルタ名を表すワイド文字配列である。
PinIdDWORD4+520+520エンドポイントに対応するピンの識別子である。

各言語での定義

#include <windows.h>

// KSTOPOLOGY_ENDPOINTID  (x64 524 / x86 524 バイト)
typedef struct KSTOPOLOGY_ENDPOINTID {
    WCHAR TopologyName[260];
    DWORD PinId;
} KSTOPOLOGY_ENDPOINTID;
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;
}
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
import ctypes
from ctypes import wintypes

class KSTOPOLOGY_ENDPOINTID(ctypes.Structure):
    _fields_ = [
        ("TopologyName", ctypes.c_wchar * 260),
        ("PinId", wintypes.DWORD),
    ]
#[repr(C)]
pub struct KSTOPOLOGY_ENDPOINTID {
    pub TopologyName: [u16; 260],
    pub PinId: u32,
}
import "golang.org/x/sys/windows"

type KSTOPOLOGY_ENDPOINTID struct {
	TopologyName [260]uint16
	PinId uint32
}
type
  KSTOPOLOGY_ENDPOINTID = record
    TopologyName: array[0..259] of WideChar;
    PinId: DWORD;
  end;
const KSTOPOLOGY_ENDPOINTID = extern struct {
    TopologyName: [260]u16,
    PinId: u32,
};
type
  KSTOPOLOGY_ENDPOINTID {.bycopy.} = object
    TopologyName: array[260, uint16]
    PinId: uint32
struct KSTOPOLOGY_ENDPOINTID
{
    wchar[260] TopologyName;
    uint PinId;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; KSTOPOLOGY_ENDPOINTID サイズ: 524 バイト(x64)
dim st, 131    ; 4byte整数×131(構造体サイズ 524 / 4 切り上げ)
; TopologyName : WCHAR (+0, 520byte)  varptr(st)+0 を基点に操作(520byte:入れ子/配列)
; PinId : DWORD (+520, 4byte)  st.130 = 値  /  値 = st.130   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global KSTOPOLOGY_ENDPOINTID
    #field wchar TopologyName 260
    #field int PinId
#endstruct

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