ホーム › Devices.Geolocation › GNSS_AGNSS_INJECT
GNSS_AGNSS_INJECT
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Size | DWORD | 4 | +0 | +0 | この構造体のバイトサイズ。 |
| Version | DWORD | 4 | +4 | +4 | 構造体のバージョン番号。 |
| InjectionType | GNSS_AGNSS_REQUEST_TYPE | 4 | +8 | +8 | AGNSS支援データの要求/注入種別を示す列挙値。 |
| InjectionStatus | NTSTATUS | 4 | +12 | +12 | 注入処理の結果を示すNTSTATUS値。0で成功。 |
| InjectionDataSize | DWORD | 4 | +16 | +16 | 後続注入データ部のバイトサイズ。 |
| Unused | BYTE | 512 | +20 | +20 | アライメント用の予約バイト。 |
| Anonymous | _Anonymous_e__Union | 128 | +536 | +536 | 注入種別に応じた可変データを保持する無名共用体。 |
共用体: _Anonymous_e__Union x64 128B / x86 128B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| Time | GNSS_AGNSS_INJECTTIME | 20 | +0 | +0 |
| Position | GNSS_AGNSS_INJECTPOSITION | 128 | +0 | +0 |
| BlobData | GNSS_AGNSS_INJECTBLOB | 28 | +0 | +0 |
各言語での定義
#include <windows.h>
// GNSS_AGNSS_INJECT (x64 664 / x86 664 バイト)
typedef struct GNSS_AGNSS_INJECT {
DWORD Size;
DWORD Version;
GNSS_AGNSS_REQUEST_TYPE InjectionType;
NTSTATUS InjectionStatus;
DWORD InjectionDataSize;
BYTE Unused[512];
_Anonymous_e__Union Anonymous;
} GNSS_AGNSS_INJECT;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GNSS_AGNSS_INJECT
{
public uint Size;
public uint Version;
public int InjectionType;
public int InjectionStatus;
public uint InjectionDataSize;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 512)] public byte[] Unused;
public _Anonymous_e__Union Anonymous;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GNSS_AGNSS_INJECT
Public Size As UInteger
Public Version As UInteger
Public InjectionType As Integer
Public InjectionStatus As Integer
Public InjectionDataSize As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=512)> Public Unused() As Byte
Public Anonymous As _Anonymous_e__Union
End Structureimport ctypes
from ctypes import wintypes
class GNSS_AGNSS_INJECT(ctypes.Structure):
_fields_ = [
("Size", wintypes.DWORD),
("Version", wintypes.DWORD),
("InjectionType", ctypes.c_int),
("InjectionStatus", ctypes.c_int),
("InjectionDataSize", wintypes.DWORD),
("Unused", ctypes.c_ubyte * 512),
("Anonymous", _Anonymous_e__Union),
]#[repr(C)]
pub struct GNSS_AGNSS_INJECT {
pub Size: u32,
pub Version: u32,
pub InjectionType: i32,
pub InjectionStatus: i32,
pub InjectionDataSize: u32,
pub Unused: [u8; 512],
pub Anonymous: _Anonymous_e__Union,
}import "golang.org/x/sys/windows"
type GNSS_AGNSS_INJECT struct {
Size uint32
Version uint32
InjectionType int32
InjectionStatus int32
InjectionDataSize uint32
Unused [512]byte
Anonymous _Anonymous_e__Union
}type
GNSS_AGNSS_INJECT = record
Size: DWORD;
Version: DWORD;
InjectionType: Integer;
InjectionStatus: Integer;
InjectionDataSize: DWORD;
Unused: array[0..511] of Byte;
Anonymous: _Anonymous_e__Union;
end;const GNSS_AGNSS_INJECT = extern struct {
Size: u32,
Version: u32,
InjectionType: i32,
InjectionStatus: i32,
InjectionDataSize: u32,
Unused: [512]u8,
Anonymous: _Anonymous_e__Union,
};type
GNSS_AGNSS_INJECT {.bycopy.} = object
Size: uint32
Version: uint32
InjectionType: int32
InjectionStatus: int32
InjectionDataSize: uint32
Unused: array[512, uint8]
Anonymous: _Anonymous_e__Unionstruct GNSS_AGNSS_INJECT
{
uint Size;
uint Version;
int InjectionType;
int InjectionStatus;
uint InjectionDataSize;
ubyte[512] Unused;
_Anonymous_e__Union Anonymous;
}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_INJECT サイズ: 664 バイト(x64)
dim st, 166 ; 4byte整数×166(構造体サイズ 664 / 4 切り上げ)
; Size : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Version : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; InjectionType : GNSS_AGNSS_REQUEST_TYPE (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; InjectionStatus : NTSTATUS (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; InjectionDataSize : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; Unused : BYTE (+20, 512byte) varptr(st)+20 を基点に操作(512byte:入れ子/配列)
; Anonymous : _Anonymous_e__Union (+536, 128byte) varptr(st)+536 を基点に操作(128byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global GNSS_AGNSS_INJECT
#field int Size
#field int Version
#field int InjectionType
#field int InjectionStatus
#field int InjectionDataSize
#field byte Unused 512
#field byte Anonymous 128
#endstruct
stdim st, GNSS_AGNSS_INJECT ; NSTRUCT 変数を確保
st->Size = 100
mes "Size=" + st->Size
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。