Win32 API 日本語リファレンス
ホームSystem.WinRT.Metadata › RoCreateNonAgilePropertySet

RoCreateNonAgilePropertySet

関数
アジャイルでないプロパティセットを作成する。
DLLapi-ms-win-ro-typeresolution-l1-1-1.dll呼出規約winapi

シグネチャ

// api-ms-win-ro-typeresolution-l1-1-1.dll
#include <windows.h>

HRESULT RoCreateNonAgilePropertySet(
    IPropertySet* ppPropertySet
);

パラメーター

名前方向説明
ppPropertySetIPropertySet*out出力として生成された非アジャイルIPropertySetを受け取るポインタ。

戻り値の型: HRESULT

各言語での呼び出し定義

// api-ms-win-ro-typeresolution-l1-1-1.dll
#include <windows.h>

HRESULT RoCreateNonAgilePropertySet(
    IPropertySet* ppPropertySet
);
[DllImport("api-ms-win-ro-typeresolution-l1-1-1.dll", ExactSpelling = true)]
static extern int RoCreateNonAgilePropertySet(
    IntPtr ppPropertySet   // IPropertySet* out
);
<DllImport("api-ms-win-ro-typeresolution-l1-1-1.dll", ExactSpelling:=True)>
Public Shared Function RoCreateNonAgilePropertySet(
    ppPropertySet As IntPtr   ' IPropertySet* out
) As Integer
End Function
' ppPropertySet : IPropertySet* out
Declare PtrSafe Function RoCreateNonAgilePropertySet Lib "api-ms-win-ro-typeresolution-l1-1-1" ( _
    ByVal ppPropertySet As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

RoCreateNonAgilePropertySet = ctypes.windll.LoadLibrary("api-ms-win-ro-typeresolution-l1-1-1.dll").RoCreateNonAgilePropertySet
RoCreateNonAgilePropertySet.restype = ctypes.c_int
RoCreateNonAgilePropertySet.argtypes = [
    ctypes.c_void_p,  # ppPropertySet : IPropertySet* out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	api_ms_win_ro_typeresolution_l1_1_1 = windows.NewLazySystemDLL("api-ms-win-ro-typeresolution-l1-1-1.dll")
	procRoCreateNonAgilePropertySet = api_ms_win_ro_typeresolution_l1_1_1.NewProc("RoCreateNonAgilePropertySet")
)

// ppPropertySet (IPropertySet* out)
r1, _, err := procRoCreateNonAgilePropertySet.Call(
	uintptr(ppPropertySet),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function RoCreateNonAgilePropertySet(
  ppPropertySet: Pointer   // IPropertySet* out
): Integer; stdcall;
  external 'api-ms-win-ro-typeresolution-l1-1-1.dll' name 'RoCreateNonAgilePropertySet';
result := DllCall("api-ms-win-ro-typeresolution-l1-1-1\RoCreateNonAgilePropertySet"
    , "Ptr", ppPropertySet   ; IPropertySet* out
    , "Int")   ; return: HRESULT
●RoCreateNonAgilePropertySet(ppPropertySet) = DLL("api-ms-win-ro-typeresolution-l1-1-1.dll", "int RoCreateNonAgilePropertySet(void*)")
# 呼び出し: RoCreateNonAgilePropertySet(ppPropertySet)
# ppPropertySet : IPropertySet* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
const std = @import("std");

extern "api-ms-win-ro-typeresolution-l1-1-1" fn RoCreateNonAgilePropertySet(
    ppPropertySet: [*c]IPropertySet // IPropertySet* out
) callconv(std.os.windows.WINAPI) i32;
proc RoCreateNonAgilePropertySet(
    ppPropertySet: ptr IPropertySet  # IPropertySet* out
): int32 {.importc: "RoCreateNonAgilePropertySet", stdcall, dynlib: "api-ms-win-ro-typeresolution-l1-1-1.dll".}
pragma(lib, "api-ms-win-ro-typeresolution-l1-1-1");
extern(Windows)
int RoCreateNonAgilePropertySet(
    IPropertySet* ppPropertySet   // IPropertySet* out
);
ccall((:RoCreateNonAgilePropertySet, "api-ms-win-ro-typeresolution-l1-1-1.dll"), stdcall, Int32,
      (Ptr{IPropertySet},),
      ppPropertySet)
# ppPropertySet : IPropertySet* out -> Ptr{IPropertySet}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
int32_t RoCreateNonAgilePropertySet(
    void* ppPropertySet);
]]
local api-ms-win-ro-typeresolution-l1-1-1 = ffi.load("api-ms-win-ro-typeresolution-l1-1-1")
-- api-ms-win-ro-typeresolution-l1-1-1.RoCreateNonAgilePropertySet(ppPropertySet)
-- ppPropertySet : IPropertySet* out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('api-ms-win-ro-typeresolution-l1-1-1.dll');
const RoCreateNonAgilePropertySet = lib.func('__stdcall', 'RoCreateNonAgilePropertySet', 'int32_t', ['void *']);
// RoCreateNonAgilePropertySet(ppPropertySet)
// ppPropertySet : IPropertySet* out -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("api-ms-win-ro-typeresolution-l1-1-1.dll", {
  RoCreateNonAgilePropertySet: { parameters: ["pointer"], result: "i32" },
});
// lib.symbols.RoCreateNonAgilePropertySet(ppPropertySet)
// ppPropertySet : IPropertySet* out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int32_t RoCreateNonAgilePropertySet(
    void* ppPropertySet);
C, "api-ms-win-ro-typeresolution-l1-1-1.dll");
// $ffi->RoCreateNonAgilePropertySet(ppPropertySet);
// ppPropertySet : IPropertySet* out
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。
import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;

public interface Api-ms-win-ro-typeresolution-l1-1-1 extends StdCallLibrary {
    Api-ms-win-ro-typeresolution-l1-1-1 INSTANCE = Native.load("api-ms-win-ro-typeresolution-l1-1-1", Api-ms-win-ro-typeresolution-l1-1-1.class);
    int RoCreateNonAgilePropertySet(
        Pointer ppPropertySet   // IPropertySet* out
    );
}
@[Link("api-ms-win-ro-typeresolution-l1-1-1")]
lib Libapi-ms-win-ro-typeresolution-l1-1-1
  fun RoCreateNonAgilePropertySet = RoCreateNonAgilePropertySet(
    ppPropertySet : IPropertySet*   # IPropertySet* out
  ) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef RoCreateNonAgilePropertySetNative = Int32 Function(Pointer<Void>);
typedef RoCreateNonAgilePropertySetDart = int Function(Pointer<Void>);
final RoCreateNonAgilePropertySet = DynamicLibrary.open('api-ms-win-ro-typeresolution-l1-1-1.dll')
    .lookupFunction<RoCreateNonAgilePropertySetNative, RoCreateNonAgilePropertySetDart>('RoCreateNonAgilePropertySet');
// ppPropertySet : IPropertySet* out -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function RoCreateNonAgilePropertySet(
  ppPropertySet: Pointer   // IPropertySet* out
): Integer; stdcall;
  external 'api-ms-win-ro-typeresolution-l1-1-1.dll' name 'RoCreateNonAgilePropertySet';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "RoCreateNonAgilePropertySet"
  c_RoCreateNonAgilePropertySet :: Ptr () -> IO Int32
-- ppPropertySet : IPropertySet* out -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let rocreatenonagilepropertyset =
  foreign "RoCreateNonAgilePropertySet"
    ((ptr void) @-> returning int32_t)
(* ppPropertySet : IPropertySet* out -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library api-ms-win-ro-typeresolution-l1-1-1 (t "api-ms-win-ro-typeresolution-l1-1-1.dll"))
(cffi:use-foreign-library api-ms-win-ro-typeresolution-l1-1-1)

(cffi:defcfun ("RoCreateNonAgilePropertySet" ro-create-non-agile-property-set :convention :stdcall) :int32
  (pp-property-set :pointer))   ; IPropertySet* out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $RoCreateNonAgilePropertySet = Win32::API::More->new('api-ms-win-ro-typeresolution-l1-1-1',
    'int RoCreateNonAgilePropertySet(LPVOID ppPropertySet)');
# my $ret = $RoCreateNonAgilePropertySet->Call($ppPropertySet);
# ppPropertySet : IPropertySet* out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。