Win32 API 日本語リファレンス
ホームNetworkManagement.IpHelper › NotifyIfTimestampConfigChange

NotifyIfTimestampConfigChange

関数
インターフェイスのタイムスタンプ構成変更を通知登録する。
DLLIPHLPAPI.DLL呼出規約winapi

シグネチャ

// IPHLPAPI.DLL
#include <windows.h>

DWORD NotifyIfTimestampConfigChange(
    void* CallerContext,   // optional
    PINTERFACE_TIMESTAMP_CONFIG_CHANGE_CALLBACK Callback,
    HIFTIMESTAMPCHANGE* NotificationHandle
);

パラメーター

名前方向
CallerContextvoid*inoptional
CallbackPINTERFACE_TIMESTAMP_CONFIG_CHANGE_CALLBACKin
NotificationHandleHIFTIMESTAMPCHANGE*out

戻り値の型: DWORD

各言語での呼び出し定義

// IPHLPAPI.DLL
#include <windows.h>

DWORD NotifyIfTimestampConfigChange(
    void* CallerContext,   // optional
    PINTERFACE_TIMESTAMP_CONFIG_CHANGE_CALLBACK Callback,
    HIFTIMESTAMPCHANGE* NotificationHandle
);
[DllImport("IPHLPAPI.DLL", ExactSpelling = true)]
static extern uint NotifyIfTimestampConfigChange(
    IntPtr CallerContext,   // void* optional
    IntPtr Callback,   // PINTERFACE_TIMESTAMP_CONFIG_CHANGE_CALLBACK
    IntPtr NotificationHandle   // HIFTIMESTAMPCHANGE* out
);
<DllImport("IPHLPAPI.DLL", ExactSpelling:=True)>
Public Shared Function NotifyIfTimestampConfigChange(
    CallerContext As IntPtr,   ' void* optional
    Callback As IntPtr,   ' PINTERFACE_TIMESTAMP_CONFIG_CHANGE_CALLBACK
    NotificationHandle As IntPtr   ' HIFTIMESTAMPCHANGE* out
) As UInteger
End Function
' CallerContext : void* optional
' Callback : PINTERFACE_TIMESTAMP_CONFIG_CHANGE_CALLBACK
' NotificationHandle : HIFTIMESTAMPCHANGE* out
Declare PtrSafe Function NotifyIfTimestampConfigChange Lib "iphlpapi" ( _
    ByVal CallerContext As LongPtr, _
    ByVal Callback As LongPtr, _
    ByVal NotificationHandle As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

NotifyIfTimestampConfigChange = ctypes.windll.iphlpapi.NotifyIfTimestampConfigChange
NotifyIfTimestampConfigChange.restype = wintypes.DWORD
NotifyIfTimestampConfigChange.argtypes = [
    ctypes.POINTER(None),  # CallerContext : void* optional
    ctypes.c_void_p,  # Callback : PINTERFACE_TIMESTAMP_CONFIG_CHANGE_CALLBACK
    ctypes.c_void_p,  # NotificationHandle : HIFTIMESTAMPCHANGE* out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('IPHLPAPI.DLL')
NotifyIfTimestampConfigChange = Fiddle::Function.new(
  lib['NotifyIfTimestampConfigChange'],
  [
    Fiddle::TYPE_VOIDP,  # CallerContext : void* optional
    Fiddle::TYPE_VOIDP,  # Callback : PINTERFACE_TIMESTAMP_CONFIG_CHANGE_CALLBACK
    Fiddle::TYPE_VOIDP,  # NotificationHandle : HIFTIMESTAMPCHANGE* out
  ],
  -Fiddle::TYPE_INT)
#[link(name = "iphlpapi")]
extern "system" {
    fn NotifyIfTimestampConfigChange(
        CallerContext: *mut (),  // void* optional
        Callback: *const core::ffi::c_void,  // PINTERFACE_TIMESTAMP_CONFIG_CHANGE_CALLBACK
        NotificationHandle: *mut *mut core::ffi::c_void  // HIFTIMESTAMPCHANGE* out
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("IPHLPAPI.DLL")]
public static extern uint NotifyIfTimestampConfigChange(IntPtr CallerContext, IntPtr Callback, IntPtr NotificationHandle);
"@
$api = Add-Type -MemberDefinition $sig -Name 'IPHLPAPI_NotifyIfTimestampConfigChange' -Namespace Win32 -PassThru
# $api::NotifyIfTimestampConfigChange(CallerContext, Callback, NotificationHandle)
#uselib "IPHLPAPI.DLL"
#func global NotifyIfTimestampConfigChange "NotifyIfTimestampConfigChange" sptr, sptr, sptr
; NotifyIfTimestampConfigChange CallerContext, Callback, NotificationHandle   ; 戻り値は stat
; CallerContext : void* optional -> "sptr"
; Callback : PINTERFACE_TIMESTAMP_CONFIG_CHANGE_CALLBACK -> "sptr"
; NotificationHandle : HIFTIMESTAMPCHANGE* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "IPHLPAPI.DLL"
#cfunc global NotifyIfTimestampConfigChange "NotifyIfTimestampConfigChange" sptr, sptr, sptr
; res = NotifyIfTimestampConfigChange(CallerContext, Callback, NotificationHandle)
; CallerContext : void* optional -> "sptr"
; Callback : PINTERFACE_TIMESTAMP_CONFIG_CHANGE_CALLBACK -> "sptr"
; NotificationHandle : HIFTIMESTAMPCHANGE* out -> "sptr"
; DWORD NotifyIfTimestampConfigChange(void* CallerContext, PINTERFACE_TIMESTAMP_CONFIG_CHANGE_CALLBACK Callback, HIFTIMESTAMPCHANGE* NotificationHandle)
#uselib "IPHLPAPI.DLL"
#cfunc global NotifyIfTimestampConfigChange "NotifyIfTimestampConfigChange" intptr, intptr, intptr
; res = NotifyIfTimestampConfigChange(CallerContext, Callback, NotificationHandle)
; CallerContext : void* optional -> "intptr"
; Callback : PINTERFACE_TIMESTAMP_CONFIG_CHANGE_CALLBACK -> "intptr"
; NotificationHandle : HIFTIMESTAMPCHANGE* out -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	iphlpapi = windows.NewLazySystemDLL("IPHLPAPI.DLL")
	procNotifyIfTimestampConfigChange = iphlpapi.NewProc("NotifyIfTimestampConfigChange")
)

// CallerContext (void* optional), Callback (PINTERFACE_TIMESTAMP_CONFIG_CHANGE_CALLBACK), NotificationHandle (HIFTIMESTAMPCHANGE* out)
r1, _, err := procNotifyIfTimestampConfigChange.Call(
	uintptr(CallerContext),
	uintptr(Callback),
	uintptr(NotificationHandle),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function NotifyIfTimestampConfigChange(
  CallerContext: Pointer;   // void* optional
  Callback: Pointer;   // PINTERFACE_TIMESTAMP_CONFIG_CHANGE_CALLBACK
  NotificationHandle: Pointer   // HIFTIMESTAMPCHANGE* out
): DWORD; stdcall;
  external 'IPHLPAPI.DLL' name 'NotifyIfTimestampConfigChange';
result := DllCall("IPHLPAPI\NotifyIfTimestampConfigChange"
    , "Ptr", CallerContext   ; void* optional
    , "Ptr", Callback   ; PINTERFACE_TIMESTAMP_CONFIG_CHANGE_CALLBACK
    , "Ptr", NotificationHandle   ; HIFTIMESTAMPCHANGE* out
    , "UInt")   ; return: DWORD
●NotifyIfTimestampConfigChange(CallerContext, Callback, NotificationHandle) = DLL("IPHLPAPI.DLL", "dword NotifyIfTimestampConfigChange(void*, void*, void*)")
# 呼び出し: NotifyIfTimestampConfigChange(CallerContext, Callback, NotificationHandle)
# CallerContext : void* optional -> "void*"
# Callback : PINTERFACE_TIMESTAMP_CONFIG_CHANGE_CALLBACK -> "void*"
# NotificationHandle : HIFTIMESTAMPCHANGE* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。