Win32 API 日本語リファレンス
ホームDevices.Geolocation › GNSS_AGNSS_INJECTTIME

GNSS_AGNSS_INJECTTIME

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

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

フィールド

フィールドサイズx64x86説明
SizeDWORD4+0+0この構造体のバイトサイズ。
VersionDWORD4+4+4構造体のバージョン番号。
UtcTimeFILETIME8+8+8注入する基準UTC時刻。FILETIME形式(100ナノ秒単位)。
TimeUncertaintyDWORD4+16+16時刻の不確かさ(誤差範囲)をミリ秒単位で示す。

各言語での定義

#include <windows.h>

// FILETIME  (x64 8 / x86 8 バイト)
typedef struct FILETIME {
    DWORD dwLowDateTime;
    DWORD dwHighDateTime;
} FILETIME;

// GNSS_AGNSS_INJECTTIME  (x64 20 / x86 20 バイト)
typedef struct GNSS_AGNSS_INJECTTIME {
    DWORD Size;
    DWORD Version;
    FILETIME UtcTime;
    DWORD TimeUncertainty;
} GNSS_AGNSS_INJECTTIME;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct FILETIME
{
    public uint dwLowDateTime;
    public uint dwHighDateTime;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GNSS_AGNSS_INJECTTIME
{
    public uint Size;
    public uint Version;
    public FILETIME UtcTime;
    public uint TimeUncertainty;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure FILETIME
    Public dwLowDateTime As UInteger
    Public dwHighDateTime As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GNSS_AGNSS_INJECTTIME
    Public Size As UInteger
    Public Version As UInteger
    Public UtcTime As FILETIME
    Public TimeUncertainty As UInteger
End Structure
import ctypes
from ctypes import wintypes

class FILETIME(ctypes.Structure):
    _fields_ = [
        ("dwLowDateTime", wintypes.DWORD),
        ("dwHighDateTime", wintypes.DWORD),
    ]

class GNSS_AGNSS_INJECTTIME(ctypes.Structure):
    _fields_ = [
        ("Size", wintypes.DWORD),
        ("Version", wintypes.DWORD),
        ("UtcTime", FILETIME),
        ("TimeUncertainty", wintypes.DWORD),
    ]
#[repr(C)]
pub struct FILETIME {
    pub dwLowDateTime: u32,
    pub dwHighDateTime: u32,
}

#[repr(C)]
pub struct GNSS_AGNSS_INJECTTIME {
    pub Size: u32,
    pub Version: u32,
    pub UtcTime: FILETIME,
    pub TimeUncertainty: u32,
}
import "golang.org/x/sys/windows"

type FILETIME struct {
	dwLowDateTime uint32
	dwHighDateTime uint32
}

type GNSS_AGNSS_INJECTTIME struct {
	Size uint32
	Version uint32
	UtcTime FILETIME
	TimeUncertainty uint32
}
type
  FILETIME = record
    dwLowDateTime: DWORD;
    dwHighDateTime: DWORD;
  end;

  GNSS_AGNSS_INJECTTIME = record
    Size: DWORD;
    Version: DWORD;
    UtcTime: FILETIME;
    TimeUncertainty: DWORD;
  end;
const FILETIME = extern struct {
    dwLowDateTime: u32,
    dwHighDateTime: u32,
};

const GNSS_AGNSS_INJECTTIME = extern struct {
    Size: u32,
    Version: u32,
    UtcTime: FILETIME,
    TimeUncertainty: u32,
};
type
  FILETIME {.bycopy.} = object
    dwLowDateTime: uint32
    dwHighDateTime: uint32

  GNSS_AGNSS_INJECTTIME {.bycopy.} = object
    Size: uint32
    Version: uint32
    UtcTime: FILETIME
    TimeUncertainty: uint32
struct FILETIME
{
    uint dwLowDateTime;
    uint dwHighDateTime;
}

struct GNSS_AGNSS_INJECTTIME
{
    uint Size;
    uint Version;
    FILETIME UtcTime;
    uint TimeUncertainty;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; GNSS_AGNSS_INJECTTIME サイズ: 20 バイト(x64)
dim st, 5    ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; Size : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Version : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; UtcTime : FILETIME (+8, 8byte)  varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; TimeUncertainty : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global FILETIME
    #field int dwLowDateTime
    #field int dwHighDateTime
#endstruct

#defstruct global GNSS_AGNSS_INJECTTIME
    #field int Size
    #field int Version
    #field FILETIME UtcTime
    #field int TimeUncertainty
#endstruct

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