ホーム › Devices.Geolocation › GNSS_GEOREGION
GNSS_GEOREGION
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Size | DWORD | 4 | +0 | +0 | この構造体のサイズをバイト単位で示すDWORD。 |
| Version | DWORD | 4 | +4 | +4 | 構造体のバージョンを示すDWORD。 |
| GeoRegionType | GNSS_GEOREGIONTYPE | 4 | +8 | +8 | ジオリージョンの形状種別を示すGNSS_GEOREGIONTYPE。 |
| Anonymous | _Anonymous_e__Union | 512 | +16 | +16 | 形状種別に応じた領域定義(円形等)を保持する無名共用体。 |
共用体: _Anonymous_e__Union x64 512B / x86 512B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| Circle | GNSS_GEOREGION_CIRCLE | 24 | +0 | +0 |
| Unused | BYTE | 512 | +0 | +0 |
各言語での定義
#include <windows.h>
// GNSS_GEOREGION (x64 528 / x86 528 バイト)
typedef struct GNSS_GEOREGION {
DWORD Size;
DWORD Version;
GNSS_GEOREGIONTYPE GeoRegionType;
_Anonymous_e__Union Anonymous;
} GNSS_GEOREGION;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GNSS_GEOREGION
{
public uint Size;
public uint Version;
public int GeoRegionType;
public _Anonymous_e__Union Anonymous;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GNSS_GEOREGION
Public Size As UInteger
Public Version As UInteger
Public GeoRegionType As Integer
Public Anonymous As _Anonymous_e__Union
End Structureimport ctypes
from ctypes import wintypes
class GNSS_GEOREGION(ctypes.Structure):
_fields_ = [
("Size", wintypes.DWORD),
("Version", wintypes.DWORD),
("GeoRegionType", ctypes.c_int),
("Anonymous", _Anonymous_e__Union),
]#[repr(C)]
pub struct GNSS_GEOREGION {
pub Size: u32,
pub Version: u32,
pub GeoRegionType: i32,
pub Anonymous: _Anonymous_e__Union,
}import "golang.org/x/sys/windows"
type GNSS_GEOREGION struct {
Size uint32
Version uint32
GeoRegionType int32
Anonymous _Anonymous_e__Union
}type
GNSS_GEOREGION = record
Size: DWORD;
Version: DWORD;
GeoRegionType: Integer;
Anonymous: _Anonymous_e__Union;
end;const GNSS_GEOREGION = extern struct {
Size: u32,
Version: u32,
GeoRegionType: i32,
Anonymous: _Anonymous_e__Union,
};type
GNSS_GEOREGION {.bycopy.} = object
Size: uint32
Version: uint32
GeoRegionType: int32
Anonymous: _Anonymous_e__Unionstruct GNSS_GEOREGION
{
uint Size;
uint Version;
int GeoRegionType;
_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_GEOREGION サイズ: 528 バイト(x64)
dim st, 132 ; 4byte整数×132(構造体サイズ 528 / 4 切り上げ)
; Size : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Version : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; GeoRegionType : GNSS_GEOREGIONTYPE (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; Anonymous : _Anonymous_e__Union (+16, 512byte) varptr(st)+16 を基点に操作(512byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global GNSS_GEOREGION
#field int Size
#field int Version
#field int GeoRegionType
#field byte Anonymous 512
#endstruct
stdim st, GNSS_GEOREGION ; NSTRUCT 変数を確保
st->Size = 100
mes "Size=" + st->Size
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。