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

REGFILTERPINS2

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

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

フィールド

フィールドサイズx64x86説明
dwFlagsDWORD4+0+0ピンの特性を示すフラグ(REG_PINFLAG_*)を示す。
cInstancesDWORD4+4+4このピンのインスタンス数を示す。
nMediaTypesDWORD4+8+8lpMediaTypeが指すメディア種別の数を示す。
lpMediaTypeREGPINTYPES*8/4+16+12サポートするメディア種別の配列を指すREGPINTYPESへのポインター。
nMediumsDWORD4+24+16lpMediumが指すメディウムの数を示す。
lpMediumREGPINMEDIUM*8/4+32+20サポートするメディウムの配列を指すREGPINMEDIUMへのポインター。
clsPinCategoryGUID*8/4+40+24ピンのカテゴリを示すGUIDへのポインター。NULL可。

各言語での定義

#include <windows.h>

// REGFILTERPINS2  (x64 48 / x86 28 バイト)
typedef struct REGFILTERPINS2 {
    DWORD dwFlags;
    DWORD cInstances;
    DWORD nMediaTypes;
    REGPINTYPES* lpMediaType;
    DWORD nMediums;
    REGPINMEDIUM* lpMedium;
    GUID* clsPinCategory;
} REGFILTERPINS2;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct REGFILTERPINS2
{
    public uint dwFlags;
    public uint cInstances;
    public uint nMediaTypes;
    public IntPtr lpMediaType;
    public uint nMediums;
    public IntPtr lpMedium;
    public IntPtr clsPinCategory;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure REGFILTERPINS2
    Public dwFlags As UInteger
    Public cInstances As UInteger
    Public nMediaTypes As UInteger
    Public lpMediaType As IntPtr
    Public nMediums As UInteger
    Public lpMedium As IntPtr
    Public clsPinCategory As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class REGFILTERPINS2(ctypes.Structure):
    _fields_ = [
        ("dwFlags", wintypes.DWORD),
        ("cInstances", wintypes.DWORD),
        ("nMediaTypes", wintypes.DWORD),
        ("lpMediaType", ctypes.c_void_p),
        ("nMediums", wintypes.DWORD),
        ("lpMedium", ctypes.c_void_p),
        ("clsPinCategory", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct REGFILTERPINS2 {
    pub dwFlags: u32,
    pub cInstances: u32,
    pub nMediaTypes: u32,
    pub lpMediaType: *mut core::ffi::c_void,
    pub nMediums: u32,
    pub lpMedium: *mut core::ffi::c_void,
    pub clsPinCategory: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type REGFILTERPINS2 struct {
	dwFlags uint32
	cInstances uint32
	nMediaTypes uint32
	lpMediaType uintptr
	nMediums uint32
	lpMedium uintptr
	clsPinCategory uintptr
}
type
  REGFILTERPINS2 = record
    dwFlags: DWORD;
    cInstances: DWORD;
    nMediaTypes: DWORD;
    lpMediaType: Pointer;
    nMediums: DWORD;
    lpMedium: Pointer;
    clsPinCategory: Pointer;
  end;
const REGFILTERPINS2 = extern struct {
    dwFlags: u32,
    cInstances: u32,
    nMediaTypes: u32,
    lpMediaType: ?*anyopaque,
    nMediums: u32,
    lpMedium: ?*anyopaque,
    clsPinCategory: ?*anyopaque,
};
type
  REGFILTERPINS2 {.bycopy.} = object
    dwFlags: uint32
    cInstances: uint32
    nMediaTypes: uint32
    lpMediaType: pointer
    nMediums: uint32
    lpMedium: pointer
    clsPinCategory: pointer
struct REGFILTERPINS2
{
    uint dwFlags;
    uint cInstances;
    uint nMediaTypes;
    void* lpMediaType;
    uint nMediums;
    void* lpMedium;
    void* clsPinCategory;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; REGFILTERPINS2 サイズ: 28 バイト(x86)
dim st, 7    ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; dwFlags : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; cInstances : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; nMediaTypes : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; lpMediaType : REGPINTYPES* (+12, 4byte)  varptr(st)+12 を基点に操作(4byte:入れ子/配列)
; nMediums : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; lpMedium : REGPINMEDIUM* (+20, 4byte)  varptr(st)+20 を基点に操作(4byte:入れ子/配列)
; clsPinCategory : GUID* (+24, 4byte)  varptr(st)+24 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; REGFILTERPINS2 サイズ: 48 バイト(x64)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; dwFlags : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; cInstances : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; nMediaTypes : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; lpMediaType : REGPINTYPES* (+16, 8byte)  varptr(st)+16 を基点に操作(8byte:入れ子/配列)
; nMediums : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; lpMedium : REGPINMEDIUM* (+32, 8byte)  varptr(st)+32 を基点に操作(8byte:入れ子/配列)
; clsPinCategory : GUID* (+40, 8byte)  varptr(st)+40 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global REGFILTERPINS2
    #field int dwFlags
    #field int cInstances
    #field int nMediaTypes
    #field intptr lpMediaType
    #field int nMediums
    #field intptr lpMedium
    #field intptr clsPinCategory
#endstruct

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