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

UnsubscribeServiceChangeNotifications

関数
購読したサービス変更通知を解除する。
DLLSecHost.dll呼出規約winapi

シグネチャ

// SecHost.dll
#include <windows.h>

void UnsubscribeServiceChangeNotifications(
    PSC_NOTIFICATION_REGISTRATION pSubscription
);

パラメーター

名前方向
pSubscriptionPSC_NOTIFICATION_REGISTRATIONin

戻り値の型: void

各言語での呼び出し定義

// SecHost.dll
#include <windows.h>

void UnsubscribeServiceChangeNotifications(
    PSC_NOTIFICATION_REGISTRATION pSubscription
);
[DllImport("SecHost.dll", ExactSpelling = true)]
static extern void UnsubscribeServiceChangeNotifications(
    IntPtr pSubscription   // PSC_NOTIFICATION_REGISTRATION
);
<DllImport("SecHost.dll", ExactSpelling:=True)>
Public Shared Sub UnsubscribeServiceChangeNotifications(
    pSubscription As IntPtr   ' PSC_NOTIFICATION_REGISTRATION
)
End Sub
' pSubscription : PSC_NOTIFICATION_REGISTRATION
Declare PtrSafe Sub UnsubscribeServiceChangeNotifications Lib "sechost" ( _
    ByVal pSubscription As LongPtr)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

UnsubscribeServiceChangeNotifications = ctypes.windll.sechost.UnsubscribeServiceChangeNotifications
UnsubscribeServiceChangeNotifications.restype = None
UnsubscribeServiceChangeNotifications.argtypes = [
    ctypes.c_ssize_t,  # pSubscription : PSC_NOTIFICATION_REGISTRATION
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('SecHost.dll')
UnsubscribeServiceChangeNotifications = Fiddle::Function.new(
  lib['UnsubscribeServiceChangeNotifications'],
  [
    Fiddle::TYPE_INTPTR_T,  # pSubscription : PSC_NOTIFICATION_REGISTRATION
  ],
  Fiddle::TYPE_VOID)
#[link(name = "sechost")]
extern "system" {
    fn UnsubscribeServiceChangeNotifications(
        pSubscription: isize  // PSC_NOTIFICATION_REGISTRATION
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("SecHost.dll")]
public static extern void UnsubscribeServiceChangeNotifications(IntPtr pSubscription);
"@
$api = Add-Type -MemberDefinition $sig -Name 'SecHost_UnsubscribeServiceChangeNotifications' -Namespace Win32 -PassThru
# $api::UnsubscribeServiceChangeNotifications(pSubscription)
#uselib "SecHost.dll"
#func global UnsubscribeServiceChangeNotifications "UnsubscribeServiceChangeNotifications" sptr
; UnsubscribeServiceChangeNotifications pSubscription
; pSubscription : PSC_NOTIFICATION_REGISTRATION -> "sptr"
#uselib "SecHost.dll"
#func global UnsubscribeServiceChangeNotifications "UnsubscribeServiceChangeNotifications" sptr
; UnsubscribeServiceChangeNotifications pSubscription
; pSubscription : PSC_NOTIFICATION_REGISTRATION -> "sptr"
; void UnsubscribeServiceChangeNotifications(PSC_NOTIFICATION_REGISTRATION pSubscription)
#uselib "SecHost.dll"
#func global UnsubscribeServiceChangeNotifications "UnsubscribeServiceChangeNotifications" intptr
; UnsubscribeServiceChangeNotifications pSubscription
; pSubscription : PSC_NOTIFICATION_REGISTRATION -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	sechost = windows.NewLazySystemDLL("SecHost.dll")
	procUnsubscribeServiceChangeNotifications = sechost.NewProc("UnsubscribeServiceChangeNotifications")
)

// pSubscription (PSC_NOTIFICATION_REGISTRATION)
r1, _, err := procUnsubscribeServiceChangeNotifications.Call(
	uintptr(pSubscription),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // void
procedure UnsubscribeServiceChangeNotifications(
  pSubscription: NativeInt   // PSC_NOTIFICATION_REGISTRATION
); stdcall;
  external 'SecHost.dll' name 'UnsubscribeServiceChangeNotifications';
result := DllCall("SecHost\UnsubscribeServiceChangeNotifications"
    , "Ptr", pSubscription   ; PSC_NOTIFICATION_REGISTRATION
    , "Int")   ; return: void
●UnsubscribeServiceChangeNotifications(pSubscription) = DLL("SecHost.dll", "int UnsubscribeServiceChangeNotifications(int)")
# 呼び出し: UnsubscribeServiceChangeNotifications(pSubscription)
# pSubscription : PSC_NOTIFICATION_REGISTRATION -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。