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

SubscribeFeatureStateChangeNotification

関数
フィーチャー状態変化の通知を購読する。
DLLapi-ms-win-core-featurestaging-l1-1-0.dll呼出規約winapi

シグネチャ

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

void SubscribeFeatureStateChangeNotification(
    FEATURE_STATE_CHANGE_SUBSCRIPTION* subscription,
    PFEATURE_STATE_CHANGE_CALLBACK callback,
    void* context   // optional
);

パラメーター

名前方向
subscriptionFEATURE_STATE_CHANGE_SUBSCRIPTION*out
callbackPFEATURE_STATE_CHANGE_CALLBACKin
contextvoid*inoptional

戻り値の型: void

各言語での呼び出し定義

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

void SubscribeFeatureStateChangeNotification(
    FEATURE_STATE_CHANGE_SUBSCRIPTION* subscription,
    PFEATURE_STATE_CHANGE_CALLBACK callback,
    void* context   // optional
);
[DllImport("api-ms-win-core-featurestaging-l1-1-0.dll", ExactSpelling = true)]
static extern void SubscribeFeatureStateChangeNotification(
    IntPtr subscription,   // FEATURE_STATE_CHANGE_SUBSCRIPTION* out
    IntPtr callback,   // PFEATURE_STATE_CHANGE_CALLBACK
    IntPtr context   // void* optional
);
<DllImport("api-ms-win-core-featurestaging-l1-1-0.dll", ExactSpelling:=True)>
Public Shared Sub SubscribeFeatureStateChangeNotification(
    subscription As IntPtr,   ' FEATURE_STATE_CHANGE_SUBSCRIPTION* out
    callback As IntPtr,   ' PFEATURE_STATE_CHANGE_CALLBACK
    context As IntPtr   ' void* optional
)
End Sub
' subscription : FEATURE_STATE_CHANGE_SUBSCRIPTION* out
' callback : PFEATURE_STATE_CHANGE_CALLBACK
' context : void* optional
Declare PtrSafe Sub SubscribeFeatureStateChangeNotification Lib "api-ms-win-core-featurestaging-l1-1-0" ( _
    ByVal subscription As LongPtr, _
    ByVal callback As LongPtr, _
    ByVal context As LongPtr)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

SubscribeFeatureStateChangeNotification = ctypes.windll.LoadLibrary("api-ms-win-core-featurestaging-l1-1-0.dll").SubscribeFeatureStateChangeNotification
SubscribeFeatureStateChangeNotification.restype = None
SubscribeFeatureStateChangeNotification.argtypes = [
    ctypes.c_void_p,  # subscription : FEATURE_STATE_CHANGE_SUBSCRIPTION* out
    ctypes.c_void_p,  # callback : PFEATURE_STATE_CHANGE_CALLBACK
    ctypes.POINTER(None),  # context : void* optional
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('api-ms-win-core-featurestaging-l1-1-0.dll')
SubscribeFeatureStateChangeNotification = Fiddle::Function.new(
  lib['SubscribeFeatureStateChangeNotification'],
  [
    Fiddle::TYPE_VOIDP,  # subscription : FEATURE_STATE_CHANGE_SUBSCRIPTION* out
    Fiddle::TYPE_VOIDP,  # callback : PFEATURE_STATE_CHANGE_CALLBACK
    Fiddle::TYPE_VOIDP,  # context : void* optional
  ],
  Fiddle::TYPE_VOID)
#[link(name = "api-ms-win-core-featurestaging-l1-1-0")]
extern "system" {
    fn SubscribeFeatureStateChangeNotification(
        subscription: *mut *mut core::ffi::c_void,  // FEATURE_STATE_CHANGE_SUBSCRIPTION* out
        callback: *const core::ffi::c_void,  // PFEATURE_STATE_CHANGE_CALLBACK
        context: *mut ()  // void* optional
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("api-ms-win-core-featurestaging-l1-1-0.dll")]
public static extern void SubscribeFeatureStateChangeNotification(IntPtr subscription, IntPtr callback, IntPtr context);
"@
$api = Add-Type -MemberDefinition $sig -Name 'api-ms-win-core-featurestaging-l1-1-0_SubscribeFeatureStateChangeNotification' -Namespace Win32 -PassThru
# $api::SubscribeFeatureStateChangeNotification(subscription, callback, context)
#uselib "api-ms-win-core-featurestaging-l1-1-0.dll"
#func global SubscribeFeatureStateChangeNotification "SubscribeFeatureStateChangeNotification" sptr, sptr, sptr
; SubscribeFeatureStateChangeNotification subscription, callback, context
; subscription : FEATURE_STATE_CHANGE_SUBSCRIPTION* out -> "sptr"
; callback : PFEATURE_STATE_CHANGE_CALLBACK -> "sptr"
; context : void* optional -> "sptr"
#uselib "api-ms-win-core-featurestaging-l1-1-0.dll"
#func global SubscribeFeatureStateChangeNotification "SubscribeFeatureStateChangeNotification" sptr, sptr, sptr
; SubscribeFeatureStateChangeNotification subscription, callback, context
; subscription : FEATURE_STATE_CHANGE_SUBSCRIPTION* out -> "sptr"
; callback : PFEATURE_STATE_CHANGE_CALLBACK -> "sptr"
; context : void* optional -> "sptr"
; void SubscribeFeatureStateChangeNotification(FEATURE_STATE_CHANGE_SUBSCRIPTION* subscription, PFEATURE_STATE_CHANGE_CALLBACK callback, void* context)
#uselib "api-ms-win-core-featurestaging-l1-1-0.dll"
#func global SubscribeFeatureStateChangeNotification "SubscribeFeatureStateChangeNotification" intptr, intptr, intptr
; SubscribeFeatureStateChangeNotification subscription, callback, context
; subscription : FEATURE_STATE_CHANGE_SUBSCRIPTION* out -> "intptr"
; callback : PFEATURE_STATE_CHANGE_CALLBACK -> "intptr"
; context : void* optional -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	api_ms_win_core_featurestaging_l1_1_0 = windows.NewLazySystemDLL("api-ms-win-core-featurestaging-l1-1-0.dll")
	procSubscribeFeatureStateChangeNotification = api_ms_win_core_featurestaging_l1_1_0.NewProc("SubscribeFeatureStateChangeNotification")
)

// subscription (FEATURE_STATE_CHANGE_SUBSCRIPTION* out), callback (PFEATURE_STATE_CHANGE_CALLBACK), context (void* optional)
r1, _, err := procSubscribeFeatureStateChangeNotification.Call(
	uintptr(subscription),
	uintptr(callback),
	uintptr(context),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // void
procedure SubscribeFeatureStateChangeNotification(
  subscription: Pointer;   // FEATURE_STATE_CHANGE_SUBSCRIPTION* out
  callback: Pointer;   // PFEATURE_STATE_CHANGE_CALLBACK
  context: Pointer   // void* optional
); stdcall;
  external 'api-ms-win-core-featurestaging-l1-1-0.dll' name 'SubscribeFeatureStateChangeNotification';
result := DllCall("api-ms-win-core-featurestaging-l1-1-0\SubscribeFeatureStateChangeNotification"
    , "Ptr", subscription   ; FEATURE_STATE_CHANGE_SUBSCRIPTION* out
    , "Ptr", callback   ; PFEATURE_STATE_CHANGE_CALLBACK
    , "Ptr", context   ; void* optional
    , "Int")   ; return: void
●SubscribeFeatureStateChangeNotification(subscription, callback, context) = DLL("api-ms-win-core-featurestaging-l1-1-0.dll", "int SubscribeFeatureStateChangeNotification(void*, void*, void*)")
# 呼び出し: SubscribeFeatureStateChangeNotification(subscription, callback, context)
# subscription : FEATURE_STATE_CHANGE_SUBSCRIPTION* out -> "void*"
# callback : PFEATURE_STATE_CHANGE_CALLBACK -> "void*"
# context : void* optional -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。