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

RegisterInterfaceTimestampConfigChange

関数
タイムスタンプ構成変更の通知コールバックを登録する。
DLLIPHLPAPI.dll呼出規約winapi

シグネチャ

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

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

パラメーター

名前方向
CallbackPINTERFACE_TIMESTAMP_CONFIG_CHANGE_CALLBACKin
CallerContextvoid*inoptional
NotificationHandleHIFTIMESTAMPCHANGE*out

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD RegisterInterfaceTimestampConfigChange(
    PINTERFACE_TIMESTAMP_CONFIG_CHANGE_CALLBACK Callback,
    void* CallerContext,   // optional
    HIFTIMESTAMPCHANGE* NotificationHandle
);
[DllImport("IPHLPAPI.dll", ExactSpelling = true)]
static extern uint RegisterInterfaceTimestampConfigChange(
    IntPtr Callback,   // PINTERFACE_TIMESTAMP_CONFIG_CHANGE_CALLBACK
    IntPtr CallerContext,   // void* optional
    IntPtr NotificationHandle   // HIFTIMESTAMPCHANGE* out
);
<DllImport("IPHLPAPI.dll", ExactSpelling:=True)>
Public Shared Function RegisterInterfaceTimestampConfigChange(
    Callback As IntPtr,   ' PINTERFACE_TIMESTAMP_CONFIG_CHANGE_CALLBACK
    CallerContext As IntPtr,   ' void* optional
    NotificationHandle As IntPtr   ' HIFTIMESTAMPCHANGE* out
) As UInteger
End Function
' Callback : PINTERFACE_TIMESTAMP_CONFIG_CHANGE_CALLBACK
' CallerContext : void* optional
' NotificationHandle : HIFTIMESTAMPCHANGE* out
Declare PtrSafe Function RegisterInterfaceTimestampConfigChange Lib "iphlpapi" ( _
    ByVal Callback As LongPtr, _
    ByVal CallerContext 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

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

lib = Fiddle.dlopen('IPHLPAPI.dll')
RegisterInterfaceTimestampConfigChange = Fiddle::Function.new(
  lib['RegisterInterfaceTimestampConfigChange'],
  [
    Fiddle::TYPE_VOIDP,  # Callback : PINTERFACE_TIMESTAMP_CONFIG_CHANGE_CALLBACK
    Fiddle::TYPE_VOIDP,  # CallerContext : void* optional
    Fiddle::TYPE_VOIDP,  # NotificationHandle : HIFTIMESTAMPCHANGE* out
  ],
  -Fiddle::TYPE_INT)
#[link(name = "iphlpapi")]
extern "system" {
    fn RegisterInterfaceTimestampConfigChange(
        Callback: *const core::ffi::c_void,  // PINTERFACE_TIMESTAMP_CONFIG_CHANGE_CALLBACK
        CallerContext: *mut (),  // void* optional
        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 RegisterInterfaceTimestampConfigChange(IntPtr Callback, IntPtr CallerContext, IntPtr NotificationHandle);
"@
$api = Add-Type -MemberDefinition $sig -Name 'IPHLPAPI_RegisterInterfaceTimestampConfigChange' -Namespace Win32 -PassThru
# $api::RegisterInterfaceTimestampConfigChange(Callback, CallerContext, NotificationHandle)
#uselib "IPHLPAPI.dll"
#func global RegisterInterfaceTimestampConfigChange "RegisterInterfaceTimestampConfigChange" sptr, sptr, sptr
; RegisterInterfaceTimestampConfigChange Callback, CallerContext, NotificationHandle   ; 戻り値は stat
; Callback : PINTERFACE_TIMESTAMP_CONFIG_CHANGE_CALLBACK -> "sptr"
; CallerContext : void* optional -> "sptr"
; NotificationHandle : HIFTIMESTAMPCHANGE* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "IPHLPAPI.dll"
#cfunc global RegisterInterfaceTimestampConfigChange "RegisterInterfaceTimestampConfigChange" sptr, sptr, sptr
; res = RegisterInterfaceTimestampConfigChange(Callback, CallerContext, NotificationHandle)
; Callback : PINTERFACE_TIMESTAMP_CONFIG_CHANGE_CALLBACK -> "sptr"
; CallerContext : void* optional -> "sptr"
; NotificationHandle : HIFTIMESTAMPCHANGE* out -> "sptr"
; DWORD RegisterInterfaceTimestampConfigChange(PINTERFACE_TIMESTAMP_CONFIG_CHANGE_CALLBACK Callback, void* CallerContext, HIFTIMESTAMPCHANGE* NotificationHandle)
#uselib "IPHLPAPI.dll"
#cfunc global RegisterInterfaceTimestampConfigChange "RegisterInterfaceTimestampConfigChange" intptr, intptr, intptr
; res = RegisterInterfaceTimestampConfigChange(Callback, CallerContext, NotificationHandle)
; Callback : PINTERFACE_TIMESTAMP_CONFIG_CHANGE_CALLBACK -> "intptr"
; CallerContext : void* optional -> "intptr"
; NotificationHandle : HIFTIMESTAMPCHANGE* out -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	iphlpapi = windows.NewLazySystemDLL("IPHLPAPI.dll")
	procRegisterInterfaceTimestampConfigChange = iphlpapi.NewProc("RegisterInterfaceTimestampConfigChange")
)

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