Win32 API 日本語リファレンス
ホームSystem.WindowsProgramming › GetFeatureVariant

GetFeatureVariant

関数
指定フィーチャーのバリアント情報を取得する。
DLLapi-ms-win-core-featurestaging-l1-1-1.dll呼出規約winapi

シグネチャ

// api-ms-win-core-featurestaging-l1-1-1.dll
#include <windows.h>

DWORD GetFeatureVariant(
    DWORD featureId,
    FEATURE_CHANGE_TIME changeTime,
    DWORD* payloadId,
    BOOL* hasNotification
);

パラメーター

名前方向
featureIdDWORDin
changeTimeFEATURE_CHANGE_TIMEin
payloadIdDWORD*out
hasNotificationBOOL*out

戻り値の型: DWORD

各言語での呼び出し定義

// api-ms-win-core-featurestaging-l1-1-1.dll
#include <windows.h>

DWORD GetFeatureVariant(
    DWORD featureId,
    FEATURE_CHANGE_TIME changeTime,
    DWORD* payloadId,
    BOOL* hasNotification
);
[DllImport("api-ms-win-core-featurestaging-l1-1-1.dll", ExactSpelling = true)]
static extern uint GetFeatureVariant(
    uint featureId,   // DWORD
    int changeTime,   // FEATURE_CHANGE_TIME
    out uint payloadId,   // DWORD* out
    out int hasNotification   // BOOL* out
);
<DllImport("api-ms-win-core-featurestaging-l1-1-1.dll", ExactSpelling:=True)>
Public Shared Function GetFeatureVariant(
    featureId As UInteger,   ' DWORD
    changeTime As Integer,   ' FEATURE_CHANGE_TIME
    <Out> ByRef payloadId As UInteger,   ' DWORD* out
    <Out> ByRef hasNotification As Integer   ' BOOL* out
) As UInteger
End Function
' featureId : DWORD
' changeTime : FEATURE_CHANGE_TIME
' payloadId : DWORD* out
' hasNotification : BOOL* out
Declare PtrSafe Function GetFeatureVariant Lib "api-ms-win-core-featurestaging-l1-1-1" ( _
    ByVal featureId As Long, _
    ByVal changeTime As Long, _
    ByRef payloadId As Long, _
    ByRef hasNotification As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

GetFeatureVariant = ctypes.windll.LoadLibrary("api-ms-win-core-featurestaging-l1-1-1.dll").GetFeatureVariant
GetFeatureVariant.restype = wintypes.DWORD
GetFeatureVariant.argtypes = [
    wintypes.DWORD,  # featureId : DWORD
    ctypes.c_int,  # changeTime : FEATURE_CHANGE_TIME
    ctypes.POINTER(wintypes.DWORD),  # payloadId : DWORD* out
    ctypes.c_void_p,  # hasNotification : BOOL* out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	api_ms_win_core_featurestaging_l1_1_1 = windows.NewLazySystemDLL("api-ms-win-core-featurestaging-l1-1-1.dll")
	procGetFeatureVariant = api_ms_win_core_featurestaging_l1_1_1.NewProc("GetFeatureVariant")
)

// featureId (DWORD), changeTime (FEATURE_CHANGE_TIME), payloadId (DWORD* out), hasNotification (BOOL* out)
r1, _, err := procGetFeatureVariant.Call(
	uintptr(featureId),
	uintptr(changeTime),
	uintptr(payloadId),
	uintptr(hasNotification),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function GetFeatureVariant(
  featureId: DWORD;   // DWORD
  changeTime: Integer;   // FEATURE_CHANGE_TIME
  payloadId: Pointer;   // DWORD* out
  hasNotification: Pointer   // BOOL* out
): DWORD; stdcall;
  external 'api-ms-win-core-featurestaging-l1-1-1.dll' name 'GetFeatureVariant';
result := DllCall("api-ms-win-core-featurestaging-l1-1-1\GetFeatureVariant"
    , "UInt", featureId   ; DWORD
    , "Int", changeTime   ; FEATURE_CHANGE_TIME
    , "Ptr", payloadId   ; DWORD* out
    , "Ptr", hasNotification   ; BOOL* out
    , "UInt")   ; return: DWORD
●GetFeatureVariant(featureId, changeTime, payloadId, hasNotification) = DLL("api-ms-win-core-featurestaging-l1-1-1.dll", "dword GetFeatureVariant(dword, int, void*, void*)")
# 呼び出し: GetFeatureVariant(featureId, changeTime, payloadId, hasNotification)
# featureId : DWORD -> "dword"
# changeTime : FEATURE_CHANGE_TIME -> "int"
# payloadId : DWORD* out -> "void*"
# hasNotification : BOOL* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。