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

KSPROPERTY_BDA_RF_TUNER_SCAN_STATUS_S

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

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

フィールド

フィールドサイズx64x86説明
PropertyKSP_NODE16+0+0ノードプロパティ識別子(KSP_NODE)。スキャン状態プロパティを示す。
CurrentFrequencyDWORD4+16+16現在スキャン中の周波数(kHz単位)。進行位置を示す。
FrequencyRangeMinDWORD4+20+20スキャン範囲の下限周波数(kHz単位)。
FrequencyRangeMaxDWORD4+24+24スキャン範囲の上限周波数(kHz単位)。
MilliSecondsLeftDWORD4+28+28スキャン完了までの残り時間(ミリ秒)。推定残時間を示す。

各言語での定義

#include <windows.h>

// KSIDENTIFIER  (x64 8 / x86 8 バイト)
typedef struct KSIDENTIFIER {
    _Anonymous_e__Union Anonymous;
} KSIDENTIFIER;

// KSP_NODE  (x64 16 / x86 16 バイト)
typedef struct KSP_NODE {
    KSIDENTIFIER Property;
    DWORD NodeId;
    DWORD Reserved;
} KSP_NODE;

// KSPROPERTY_BDA_RF_TUNER_SCAN_STATUS_S  (x64 32 / x86 32 バイト)
typedef struct KSPROPERTY_BDA_RF_TUNER_SCAN_STATUS_S {
    KSP_NODE Property;
    DWORD CurrentFrequency;
    DWORD FrequencyRangeMin;
    DWORD FrequencyRangeMax;
    DWORD MilliSecondsLeft;
} KSPROPERTY_BDA_RF_TUNER_SCAN_STATUS_S;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct KSIDENTIFIER
{
    public _Anonymous_e__Union Anonymous;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct KSP_NODE
{
    public KSIDENTIFIER Property;
    public uint NodeId;
    public uint Reserved;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct KSPROPERTY_BDA_RF_TUNER_SCAN_STATUS_S
{
    public KSP_NODE Property;
    public uint CurrentFrequency;
    public uint FrequencyRangeMin;
    public uint FrequencyRangeMax;
    public uint MilliSecondsLeft;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure KSIDENTIFIER
    Public Anonymous As _Anonymous_e__Union
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure KSP_NODE
    Public Property As KSIDENTIFIER
    Public NodeId As UInteger
    Public Reserved As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure KSPROPERTY_BDA_RF_TUNER_SCAN_STATUS_S
    Public Property As KSP_NODE
    Public CurrentFrequency As UInteger
    Public FrequencyRangeMin As UInteger
    Public FrequencyRangeMax As UInteger
    Public MilliSecondsLeft As UInteger
End Structure
import ctypes
from ctypes import wintypes

class KSIDENTIFIER(ctypes.Structure):
    _fields_ = [
        ("Anonymous", _Anonymous_e__Union),
    ]

class KSP_NODE(ctypes.Structure):
    _fields_ = [
        ("Property", KSIDENTIFIER),
        ("NodeId", wintypes.DWORD),
        ("Reserved", wintypes.DWORD),
    ]

class KSPROPERTY_BDA_RF_TUNER_SCAN_STATUS_S(ctypes.Structure):
    _fields_ = [
        ("Property", KSP_NODE),
        ("CurrentFrequency", wintypes.DWORD),
        ("FrequencyRangeMin", wintypes.DWORD),
        ("FrequencyRangeMax", wintypes.DWORD),
        ("MilliSecondsLeft", wintypes.DWORD),
    ]
#[repr(C)]
pub struct KSIDENTIFIER {
    pub Anonymous: _Anonymous_e__Union,
}

#[repr(C)]
pub struct KSP_NODE {
    pub Property: KSIDENTIFIER,
    pub NodeId: u32,
    pub Reserved: u32,
}

#[repr(C)]
pub struct KSPROPERTY_BDA_RF_TUNER_SCAN_STATUS_S {
    pub Property: KSP_NODE,
    pub CurrentFrequency: u32,
    pub FrequencyRangeMin: u32,
    pub FrequencyRangeMax: u32,
    pub MilliSecondsLeft: u32,
}
import "golang.org/x/sys/windows"

type KSIDENTIFIER struct {
	Anonymous _Anonymous_e__Union
}

type KSP_NODE struct {
	Property KSIDENTIFIER
	NodeId uint32
	Reserved uint32
}

type KSPROPERTY_BDA_RF_TUNER_SCAN_STATUS_S struct {
	Property KSP_NODE
	CurrentFrequency uint32
	FrequencyRangeMin uint32
	FrequencyRangeMax uint32
	MilliSecondsLeft uint32
}
type
  KSIDENTIFIER = record
    Anonymous: _Anonymous_e__Union;
  end;

  KSP_NODE = record
    Property: KSIDENTIFIER;
    NodeId: DWORD;
    Reserved: DWORD;
  end;

  KSPROPERTY_BDA_RF_TUNER_SCAN_STATUS_S = record
    Property: KSP_NODE;
    CurrentFrequency: DWORD;
    FrequencyRangeMin: DWORD;
    FrequencyRangeMax: DWORD;
    MilliSecondsLeft: DWORD;
  end;
const KSIDENTIFIER = extern struct {
    Anonymous: _Anonymous_e__Union,
};

const KSP_NODE = extern struct {
    Property: KSIDENTIFIER,
    NodeId: u32,
    Reserved: u32,
};

const KSPROPERTY_BDA_RF_TUNER_SCAN_STATUS_S = extern struct {
    Property: KSP_NODE,
    CurrentFrequency: u32,
    FrequencyRangeMin: u32,
    FrequencyRangeMax: u32,
    MilliSecondsLeft: u32,
};
type
  KSIDENTIFIER {.bycopy.} = object
    Anonymous: _Anonymous_e__Union

  KSP_NODE {.bycopy.} = object
    Property: KSIDENTIFIER
    NodeId: uint32
    Reserved: uint32

  KSPROPERTY_BDA_RF_TUNER_SCAN_STATUS_S {.bycopy.} = object
    Property: KSP_NODE
    CurrentFrequency: uint32
    FrequencyRangeMin: uint32
    FrequencyRangeMax: uint32
    MilliSecondsLeft: uint32
struct KSIDENTIFIER
{
    _Anonymous_e__Union Anonymous;
}

struct KSP_NODE
{
    KSIDENTIFIER Property;
    uint NodeId;
    uint Reserved;
}

struct KSPROPERTY_BDA_RF_TUNER_SCAN_STATUS_S
{
    KSP_NODE Property;
    uint CurrentFrequency;
    uint FrequencyRangeMin;
    uint FrequencyRangeMax;
    uint MilliSecondsLeft;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; KSPROPERTY_BDA_RF_TUNER_SCAN_STATUS_S サイズ: 32 バイト(x64)
dim st, 8    ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; Property : KSP_NODE (+0, 16byte)  varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; CurrentFrequency : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; FrequencyRangeMin : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; FrequencyRangeMax : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; MilliSecondsLeft : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global KSIDENTIFIER
    #field byte Anonymous 8
#endstruct

#defstruct global KSP_NODE
    #field KSIDENTIFIER Property
    #field int NodeId
    #field int Reserved
#endstruct

#defstruct global KSPROPERTY_BDA_RF_TUNER_SCAN_STATUS_S
    #field KSP_NODE Property
    #field int CurrentFrequency
    #field int FrequencyRangeMin
    #field int FrequencyRangeMax
    #field int MilliSecondsLeft
#endstruct

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