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

KsResolveRequiredAttributes

関数
データ範囲に対し必須の属性を解決し適合性を検証する。
DLLksproxy.ax呼出規約winapi

シグネチャ

// ksproxy.ax
#include <windows.h>

HRESULT KsResolveRequiredAttributes(
    KSDATAFORMAT* DataRange,
    KSMULTIPLE_ITEM* Attributes   // optional
);

パラメーター

名前方向
DataRangeKSDATAFORMAT*in
AttributesKSMULTIPLE_ITEM*inoptional

戻り値の型: HRESULT

各言語での呼び出し定義

// ksproxy.ax
#include <windows.h>

HRESULT KsResolveRequiredAttributes(
    KSDATAFORMAT* DataRange,
    KSMULTIPLE_ITEM* Attributes   // optional
);
[DllImport("ksproxy.ax", ExactSpelling = true)]
static extern int KsResolveRequiredAttributes(
    IntPtr DataRange,   // KSDATAFORMAT*
    IntPtr Attributes   // KSMULTIPLE_ITEM* optional
);
<DllImport("ksproxy.ax", ExactSpelling:=True)>
Public Shared Function KsResolveRequiredAttributes(
    DataRange As IntPtr,   ' KSDATAFORMAT*
    Attributes As IntPtr   ' KSMULTIPLE_ITEM* optional
) As Integer
End Function
' DataRange : KSDATAFORMAT*
' Attributes : KSMULTIPLE_ITEM* optional
Declare PtrSafe Function KsResolveRequiredAttributes Lib "ksproxy.ax" ( _
    ByVal DataRange As LongPtr, _
    ByVal Attributes As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

KsResolveRequiredAttributes = ctypes.windll.LoadLibrary("ksproxy.ax").KsResolveRequiredAttributes
KsResolveRequiredAttributes.restype = ctypes.c_int
KsResolveRequiredAttributes.argtypes = [
    ctypes.c_void_p,  # DataRange : KSDATAFORMAT*
    ctypes.c_void_p,  # Attributes : KSMULTIPLE_ITEM* optional
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('ksproxy.ax')
KsResolveRequiredAttributes = Fiddle::Function.new(
  lib['KsResolveRequiredAttributes'],
  [
    Fiddle::TYPE_VOIDP,  # DataRange : KSDATAFORMAT*
    Fiddle::TYPE_VOIDP,  # Attributes : KSMULTIPLE_ITEM* optional
  ],
  Fiddle::TYPE_INT)
#[link(name = "ksproxy.ax")]
extern "system" {
    fn KsResolveRequiredAttributes(
        DataRange: *mut KSDATAFORMAT,  // KSDATAFORMAT*
        Attributes: *mut KSMULTIPLE_ITEM  // KSMULTIPLE_ITEM* optional
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("ksproxy.ax")]
public static extern int KsResolveRequiredAttributes(IntPtr DataRange, IntPtr Attributes);
"@
$api = Add-Type -MemberDefinition $sig -Name 'ksproxy.ax_KsResolveRequiredAttributes' -Namespace Win32 -PassThru
# $api::KsResolveRequiredAttributes(DataRange, Attributes)
#uselib "ksproxy.ax"
#func global KsResolveRequiredAttributes "KsResolveRequiredAttributes" sptr, sptr
; KsResolveRequiredAttributes varptr(DataRange), varptr(Attributes)   ; 戻り値は stat
; DataRange : KSDATAFORMAT* -> "sptr"
; Attributes : KSMULTIPLE_ITEM* optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "ksproxy.ax"
#cfunc global KsResolveRequiredAttributes "KsResolveRequiredAttributes" var, var
; res = KsResolveRequiredAttributes(DataRange, Attributes)
; DataRange : KSDATAFORMAT* -> "var"
; Attributes : KSMULTIPLE_ITEM* optional -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; HRESULT KsResolveRequiredAttributes(KSDATAFORMAT* DataRange, KSMULTIPLE_ITEM* Attributes)
#uselib "ksproxy.ax"
#cfunc global KsResolveRequiredAttributes "KsResolveRequiredAttributes" var, var
; res = KsResolveRequiredAttributes(DataRange, Attributes)
; DataRange : KSDATAFORMAT* -> "var"
; Attributes : KSMULTIPLE_ITEM* optional -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	ksproxy_ax = windows.NewLazySystemDLL("ksproxy.ax")
	procKsResolveRequiredAttributes = ksproxy_ax.NewProc("KsResolveRequiredAttributes")
)

// DataRange (KSDATAFORMAT*), Attributes (KSMULTIPLE_ITEM* optional)
r1, _, err := procKsResolveRequiredAttributes.Call(
	uintptr(DataRange),
	uintptr(Attributes),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function KsResolveRequiredAttributes(
  DataRange: Pointer;   // KSDATAFORMAT*
  Attributes: Pointer   // KSMULTIPLE_ITEM* optional
): Integer; stdcall;
  external 'ksproxy.ax' name 'KsResolveRequiredAttributes';
result := DllCall("ksproxy.ax\KsResolveRequiredAttributes"
    , "Ptr", DataRange   ; KSDATAFORMAT*
    , "Ptr", Attributes   ; KSMULTIPLE_ITEM* optional
    , "Int")   ; return: HRESULT
●KsResolveRequiredAttributes(DataRange, Attributes) = DLL("ksproxy.ax", "int KsResolveRequiredAttributes(void*, void*)")
# 呼び出し: KsResolveRequiredAttributes(DataRange, Attributes)
# DataRange : KSDATAFORMAT* -> "void*"
# Attributes : KSMULTIPLE_ITEM* optional -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。