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

NDIS_TIMESTAMP_CAPABILITY_FLAGS

構造体
サイズx64: 14 バイト / x86: 14 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
PtpV2OverUdpIPv4EventMsgReceiveHwBOOLEAN1+0+0IPv4/UDP上PTPv2イベントメッセージ受信のハードウェアタイムスタンプ対応。
PtpV2OverUdpIPv4AllMsgReceiveHwBOOLEAN1+1+1IPv4/UDP上PTPv2全メッセージ受信のハードウェアタイムスタンプ対応。
PtpV2OverUdpIPv4EventMsgTransmitHwBOOLEAN1+2+2IPv4/UDP上PTPv2イベントメッセージ送信のハードウェアタイムスタンプ対応。
PtpV2OverUdpIPv4AllMsgTransmitHwBOOLEAN1+3+3IPv4/UDP上PTPv2全メッセージ送信のハードウェアタイムスタンプ対応。
PtpV2OverUdpIPv6EventMsgReceiveHwBOOLEAN1+4+4IPv6/UDP上PTPv2イベントメッセージ受信のハードウェアタイムスタンプ対応。
PtpV2OverUdpIPv6AllMsgReceiveHwBOOLEAN1+5+5IPv6/UDP上PTPv2全メッセージ受信のハードウェアタイムスタンプ対応。
PtpV2OverUdpIPv6EventMsgTransmitHwBOOLEAN1+6+6IPv6/UDP上PTPv2イベントメッセージ送信のハードウェアタイムスタンプ対応。
PtpV2OverUdpIPv6AllMsgTransmitHwBOOLEAN1+7+7IPv6/UDP上PTPv2全メッセージ送信のハードウェアタイムスタンプ対応。
AllReceiveHwBOOLEAN1+8+8全受信パケットのハードウェアタイムスタンプ対応。
AllTransmitHwBOOLEAN1+9+9全送信パケットのハードウェアタイムスタンプ対応。
TaggedTransmitHwBOOLEAN1+10+10タグ付き送信パケットのハードウェアタイムスタンプ対応。
AllReceiveSwBOOLEAN1+11+11全受信パケットのソフトウェアタイムスタンプ対応。
AllTransmitSwBOOLEAN1+12+12全送信パケットのソフトウェアタイムスタンプ対応。
TaggedTransmitSwBOOLEAN1+13+13タグ付き送信パケットのソフトウェアタイムスタンプ対応。

各言語での定義

#include <windows.h>

// NDIS_TIMESTAMP_CAPABILITY_FLAGS  (x64 14 / x86 14 バイト)
typedef struct NDIS_TIMESTAMP_CAPABILITY_FLAGS {
    BOOLEAN PtpV2OverUdpIPv4EventMsgReceiveHw;
    BOOLEAN PtpV2OverUdpIPv4AllMsgReceiveHw;
    BOOLEAN PtpV2OverUdpIPv4EventMsgTransmitHw;
    BOOLEAN PtpV2OverUdpIPv4AllMsgTransmitHw;
    BOOLEAN PtpV2OverUdpIPv6EventMsgReceiveHw;
    BOOLEAN PtpV2OverUdpIPv6AllMsgReceiveHw;
    BOOLEAN PtpV2OverUdpIPv6EventMsgTransmitHw;
    BOOLEAN PtpV2OverUdpIPv6AllMsgTransmitHw;
    BOOLEAN AllReceiveHw;
    BOOLEAN AllTransmitHw;
    BOOLEAN TaggedTransmitHw;
    BOOLEAN AllReceiveSw;
    BOOLEAN AllTransmitSw;
    BOOLEAN TaggedTransmitSw;
} NDIS_TIMESTAMP_CAPABILITY_FLAGS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NDIS_TIMESTAMP_CAPABILITY_FLAGS
{
    [MarshalAs(UnmanagedType.U1)] public bool PtpV2OverUdpIPv4EventMsgReceiveHw;
    [MarshalAs(UnmanagedType.U1)] public bool PtpV2OverUdpIPv4AllMsgReceiveHw;
    [MarshalAs(UnmanagedType.U1)] public bool PtpV2OverUdpIPv4EventMsgTransmitHw;
    [MarshalAs(UnmanagedType.U1)] public bool PtpV2OverUdpIPv4AllMsgTransmitHw;
    [MarshalAs(UnmanagedType.U1)] public bool PtpV2OverUdpIPv6EventMsgReceiveHw;
    [MarshalAs(UnmanagedType.U1)] public bool PtpV2OverUdpIPv6AllMsgReceiveHw;
    [MarshalAs(UnmanagedType.U1)] public bool PtpV2OverUdpIPv6EventMsgTransmitHw;
    [MarshalAs(UnmanagedType.U1)] public bool PtpV2OverUdpIPv6AllMsgTransmitHw;
    [MarshalAs(UnmanagedType.U1)] public bool AllReceiveHw;
    [MarshalAs(UnmanagedType.U1)] public bool AllTransmitHw;
    [MarshalAs(UnmanagedType.U1)] public bool TaggedTransmitHw;
    [MarshalAs(UnmanagedType.U1)] public bool AllReceiveSw;
    [MarshalAs(UnmanagedType.U1)] public bool AllTransmitSw;
    [MarshalAs(UnmanagedType.U1)] public bool TaggedTransmitSw;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NDIS_TIMESTAMP_CAPABILITY_FLAGS
    <MarshalAs(UnmanagedType.U1)> Public PtpV2OverUdpIPv4EventMsgReceiveHw As Boolean
    <MarshalAs(UnmanagedType.U1)> Public PtpV2OverUdpIPv4AllMsgReceiveHw As Boolean
    <MarshalAs(UnmanagedType.U1)> Public PtpV2OverUdpIPv4EventMsgTransmitHw As Boolean
    <MarshalAs(UnmanagedType.U1)> Public PtpV2OverUdpIPv4AllMsgTransmitHw As Boolean
    <MarshalAs(UnmanagedType.U1)> Public PtpV2OverUdpIPv6EventMsgReceiveHw As Boolean
    <MarshalAs(UnmanagedType.U1)> Public PtpV2OverUdpIPv6AllMsgReceiveHw As Boolean
    <MarshalAs(UnmanagedType.U1)> Public PtpV2OverUdpIPv6EventMsgTransmitHw As Boolean
    <MarshalAs(UnmanagedType.U1)> Public PtpV2OverUdpIPv6AllMsgTransmitHw As Boolean
    <MarshalAs(UnmanagedType.U1)> Public AllReceiveHw As Boolean
    <MarshalAs(UnmanagedType.U1)> Public AllTransmitHw As Boolean
    <MarshalAs(UnmanagedType.U1)> Public TaggedTransmitHw As Boolean
    <MarshalAs(UnmanagedType.U1)> Public AllReceiveSw As Boolean
    <MarshalAs(UnmanagedType.U1)> Public AllTransmitSw As Boolean
    <MarshalAs(UnmanagedType.U1)> Public TaggedTransmitSw As Boolean
End Structure
import ctypes
from ctypes import wintypes

class NDIS_TIMESTAMP_CAPABILITY_FLAGS(ctypes.Structure):
    _fields_ = [
        ("PtpV2OverUdpIPv4EventMsgReceiveHw", ctypes.c_byte),
        ("PtpV2OverUdpIPv4AllMsgReceiveHw", ctypes.c_byte),
        ("PtpV2OverUdpIPv4EventMsgTransmitHw", ctypes.c_byte),
        ("PtpV2OverUdpIPv4AllMsgTransmitHw", ctypes.c_byte),
        ("PtpV2OverUdpIPv6EventMsgReceiveHw", ctypes.c_byte),
        ("PtpV2OverUdpIPv6AllMsgReceiveHw", ctypes.c_byte),
        ("PtpV2OverUdpIPv6EventMsgTransmitHw", ctypes.c_byte),
        ("PtpV2OverUdpIPv6AllMsgTransmitHw", ctypes.c_byte),
        ("AllReceiveHw", ctypes.c_byte),
        ("AllTransmitHw", ctypes.c_byte),
        ("TaggedTransmitHw", ctypes.c_byte),
        ("AllReceiveSw", ctypes.c_byte),
        ("AllTransmitSw", ctypes.c_byte),
        ("TaggedTransmitSw", ctypes.c_byte),
    ]
#[repr(C)]
pub struct NDIS_TIMESTAMP_CAPABILITY_FLAGS {
    pub PtpV2OverUdpIPv4EventMsgReceiveHw: u8,
    pub PtpV2OverUdpIPv4AllMsgReceiveHw: u8,
    pub PtpV2OverUdpIPv4EventMsgTransmitHw: u8,
    pub PtpV2OverUdpIPv4AllMsgTransmitHw: u8,
    pub PtpV2OverUdpIPv6EventMsgReceiveHw: u8,
    pub PtpV2OverUdpIPv6AllMsgReceiveHw: u8,
    pub PtpV2OverUdpIPv6EventMsgTransmitHw: u8,
    pub PtpV2OverUdpIPv6AllMsgTransmitHw: u8,
    pub AllReceiveHw: u8,
    pub AllTransmitHw: u8,
    pub TaggedTransmitHw: u8,
    pub AllReceiveSw: u8,
    pub AllTransmitSw: u8,
    pub TaggedTransmitSw: u8,
}
import "golang.org/x/sys/windows"

type NDIS_TIMESTAMP_CAPABILITY_FLAGS struct {
	PtpV2OverUdpIPv4EventMsgReceiveHw byte
	PtpV2OverUdpIPv4AllMsgReceiveHw byte
	PtpV2OverUdpIPv4EventMsgTransmitHw byte
	PtpV2OverUdpIPv4AllMsgTransmitHw byte
	PtpV2OverUdpIPv6EventMsgReceiveHw byte
	PtpV2OverUdpIPv6AllMsgReceiveHw byte
	PtpV2OverUdpIPv6EventMsgTransmitHw byte
	PtpV2OverUdpIPv6AllMsgTransmitHw byte
	AllReceiveHw byte
	AllTransmitHw byte
	TaggedTransmitHw byte
	AllReceiveSw byte
	AllTransmitSw byte
	TaggedTransmitSw byte
}
type
  NDIS_TIMESTAMP_CAPABILITY_FLAGS = record
    PtpV2OverUdpIPv4EventMsgReceiveHw: ByteBool;
    PtpV2OverUdpIPv4AllMsgReceiveHw: ByteBool;
    PtpV2OverUdpIPv4EventMsgTransmitHw: ByteBool;
    PtpV2OverUdpIPv4AllMsgTransmitHw: ByteBool;
    PtpV2OverUdpIPv6EventMsgReceiveHw: ByteBool;
    PtpV2OverUdpIPv6AllMsgReceiveHw: ByteBool;
    PtpV2OverUdpIPv6EventMsgTransmitHw: ByteBool;
    PtpV2OverUdpIPv6AllMsgTransmitHw: ByteBool;
    AllReceiveHw: ByteBool;
    AllTransmitHw: ByteBool;
    TaggedTransmitHw: ByteBool;
    AllReceiveSw: ByteBool;
    AllTransmitSw: ByteBool;
    TaggedTransmitSw: ByteBool;
  end;
const NDIS_TIMESTAMP_CAPABILITY_FLAGS = extern struct {
    PtpV2OverUdpIPv4EventMsgReceiveHw: u8,
    PtpV2OverUdpIPv4AllMsgReceiveHw: u8,
    PtpV2OverUdpIPv4EventMsgTransmitHw: u8,
    PtpV2OverUdpIPv4AllMsgTransmitHw: u8,
    PtpV2OverUdpIPv6EventMsgReceiveHw: u8,
    PtpV2OverUdpIPv6AllMsgReceiveHw: u8,
    PtpV2OverUdpIPv6EventMsgTransmitHw: u8,
    PtpV2OverUdpIPv6AllMsgTransmitHw: u8,
    AllReceiveHw: u8,
    AllTransmitHw: u8,
    TaggedTransmitHw: u8,
    AllReceiveSw: u8,
    AllTransmitSw: u8,
    TaggedTransmitSw: u8,
};
type
  NDIS_TIMESTAMP_CAPABILITY_FLAGS {.bycopy.} = object
    PtpV2OverUdpIPv4EventMsgReceiveHw: uint8
    PtpV2OverUdpIPv4AllMsgReceiveHw: uint8
    PtpV2OverUdpIPv4EventMsgTransmitHw: uint8
    PtpV2OverUdpIPv4AllMsgTransmitHw: uint8
    PtpV2OverUdpIPv6EventMsgReceiveHw: uint8
    PtpV2OverUdpIPv6AllMsgReceiveHw: uint8
    PtpV2OverUdpIPv6EventMsgTransmitHw: uint8
    PtpV2OverUdpIPv6AllMsgTransmitHw: uint8
    AllReceiveHw: uint8
    AllTransmitHw: uint8
    TaggedTransmitHw: uint8
    AllReceiveSw: uint8
    AllTransmitSw: uint8
    TaggedTransmitSw: uint8
struct NDIS_TIMESTAMP_CAPABILITY_FLAGS
{
    ubyte PtpV2OverUdpIPv4EventMsgReceiveHw;
    ubyte PtpV2OverUdpIPv4AllMsgReceiveHw;
    ubyte PtpV2OverUdpIPv4EventMsgTransmitHw;
    ubyte PtpV2OverUdpIPv4AllMsgTransmitHw;
    ubyte PtpV2OverUdpIPv6EventMsgReceiveHw;
    ubyte PtpV2OverUdpIPv6AllMsgReceiveHw;
    ubyte PtpV2OverUdpIPv6EventMsgTransmitHw;
    ubyte PtpV2OverUdpIPv6AllMsgTransmitHw;
    ubyte AllReceiveHw;
    ubyte AllTransmitHw;
    ubyte TaggedTransmitHw;
    ubyte AllReceiveSw;
    ubyte AllTransmitSw;
    ubyte TaggedTransmitSw;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; NDIS_TIMESTAMP_CAPABILITY_FLAGS サイズ: 14 バイト(x64)
dim st, 4    ; 4byte整数×4(構造体サイズ 14 / 4 切り上げ)
; PtpV2OverUdpIPv4EventMsgReceiveHw : BOOLEAN (+0, 1byte)  poke st,0,値  /  値 = peek(st,0)
; PtpV2OverUdpIPv4AllMsgReceiveHw : BOOLEAN (+1, 1byte)  poke st,1,値  /  値 = peek(st,1)
; PtpV2OverUdpIPv4EventMsgTransmitHw : BOOLEAN (+2, 1byte)  poke st,2,値  /  値 = peek(st,2)
; PtpV2OverUdpIPv4AllMsgTransmitHw : BOOLEAN (+3, 1byte)  poke st,3,値  /  値 = peek(st,3)
; PtpV2OverUdpIPv6EventMsgReceiveHw : BOOLEAN (+4, 1byte)  poke st,4,値  /  値 = peek(st,4)
; PtpV2OverUdpIPv6AllMsgReceiveHw : BOOLEAN (+5, 1byte)  poke st,5,値  /  値 = peek(st,5)
; PtpV2OverUdpIPv6EventMsgTransmitHw : BOOLEAN (+6, 1byte)  poke st,6,値  /  値 = peek(st,6)
; PtpV2OverUdpIPv6AllMsgTransmitHw : BOOLEAN (+7, 1byte)  poke st,7,値  /  値 = peek(st,7)
; AllReceiveHw : BOOLEAN (+8, 1byte)  poke st,8,値  /  値 = peek(st,8)
; AllTransmitHw : BOOLEAN (+9, 1byte)  poke st,9,値  /  値 = peek(st,9)
; TaggedTransmitHw : BOOLEAN (+10, 1byte)  poke st,10,値  /  値 = peek(st,10)
; AllReceiveSw : BOOLEAN (+11, 1byte)  poke st,11,値  /  値 = peek(st,11)
; AllTransmitSw : BOOLEAN (+12, 1byte)  poke st,12,値  /  値 = peek(st,12)
; TaggedTransmitSw : BOOLEAN (+13, 1byte)  poke st,13,値  /  値 = peek(st,13)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global NDIS_TIMESTAMP_CAPABILITY_FLAGS
    #field bool1 PtpV2OverUdpIPv4EventMsgReceiveHw
    #field bool1 PtpV2OverUdpIPv4AllMsgReceiveHw
    #field bool1 PtpV2OverUdpIPv4EventMsgTransmitHw
    #field bool1 PtpV2OverUdpIPv4AllMsgTransmitHw
    #field bool1 PtpV2OverUdpIPv6EventMsgReceiveHw
    #field bool1 PtpV2OverUdpIPv6AllMsgReceiveHw
    #field bool1 PtpV2OverUdpIPv6EventMsgTransmitHw
    #field bool1 PtpV2OverUdpIPv6AllMsgTransmitHw
    #field bool1 AllReceiveHw
    #field bool1 AllTransmitHw
    #field bool1 TaggedTransmitHw
    #field bool1 AllReceiveSw
    #field bool1 AllTransmitSw
    #field bool1 TaggedTransmitSw
#endstruct

stdim st, NDIS_TIMESTAMP_CAPABILITY_FLAGS        ; NSTRUCT 変数を確保
st->PtpV2OverUdpIPv4EventMsgReceiveHw = 100
mes "PtpV2OverUdpIPv4EventMsgReceiveHw=" + st->PtpV2OverUdpIPv4EventMsgReceiveHw