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

GEN_GET_TIME_CAPS

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

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

フィールド

フィールドサイズx64x86説明
FlagsDWORD4+0+0時刻取得機能の能力を示すフラグ。
ClockPrecisionDWORD4+4+4ハードウェアクロックの精度(ナノ秒)。

各言語での定義

#include <windows.h>

// GEN_GET_TIME_CAPS  (x64 8 / x86 8 バイト)
typedef struct GEN_GET_TIME_CAPS {
    DWORD Flags;
    DWORD ClockPrecision;
} GEN_GET_TIME_CAPS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GEN_GET_TIME_CAPS
{
    public uint Flags;
    public uint ClockPrecision;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GEN_GET_TIME_CAPS
    Public Flags As UInteger
    Public ClockPrecision As UInteger
End Structure
import ctypes
from ctypes import wintypes

class GEN_GET_TIME_CAPS(ctypes.Structure):
    _fields_ = [
        ("Flags", wintypes.DWORD),
        ("ClockPrecision", wintypes.DWORD),
    ]
#[repr(C)]
pub struct GEN_GET_TIME_CAPS {
    pub Flags: u32,
    pub ClockPrecision: u32,
}
import "golang.org/x/sys/windows"

type GEN_GET_TIME_CAPS struct {
	Flags uint32
	ClockPrecision uint32
}
type
  GEN_GET_TIME_CAPS = record
    Flags: DWORD;
    ClockPrecision: DWORD;
  end;
const GEN_GET_TIME_CAPS = extern struct {
    Flags: u32,
    ClockPrecision: u32,
};
type
  GEN_GET_TIME_CAPS {.bycopy.} = object
    Flags: uint32
    ClockPrecision: uint32
struct GEN_GET_TIME_CAPS
{
    uint Flags;
    uint ClockPrecision;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; GEN_GET_TIME_CAPS サイズ: 8 バイト(x64)
dim st, 2    ; 4byte整数×2(構造体サイズ 8 / 4 切り上げ)
; Flags : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; ClockPrecision : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global GEN_GET_TIME_CAPS
    #field int Flags
    #field int ClockPrecision
#endstruct

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