ホーム › Devices.Geolocation › GNSS_CP_NI_INFO
GNSS_CP_NI_INFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Size | DWORD | 4 | +0 | +0 | この構造体のサイズをバイト単位で示すDWORD。 |
| Version | DWORD | 4 | +4 | +4 | 構造体のバージョンを示すDWORD。 |
| RequestorId | WCHAR | 520 | +8 | +8 | 制御プレーン(CP)位置要求の要求者IDを保持するワイド文字配列。 |
| NotificationText | WCHAR | 520 | +528 | +528 | ユーザに表示する通知テキストを保持するワイド文字配列。 |
各言語での定義
#include <windows.h>
// GNSS_CP_NI_INFO (x64 1048 / x86 1048 バイト)
typedef struct GNSS_CP_NI_INFO {
DWORD Size;
DWORD Version;
WCHAR RequestorId[260];
WCHAR NotificationText[260];
} GNSS_CP_NI_INFO;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GNSS_CP_NI_INFO
{
public uint Size;
public uint Version;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] public string RequestorId;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] public string NotificationText;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GNSS_CP_NI_INFO
Public Size As UInteger
Public Version As UInteger
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=260)> Public RequestorId As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=260)> Public NotificationText As String
End Structureimport ctypes
from ctypes import wintypes
class GNSS_CP_NI_INFO(ctypes.Structure):
_fields_ = [
("Size", wintypes.DWORD),
("Version", wintypes.DWORD),
("RequestorId", ctypes.c_wchar * 260),
("NotificationText", ctypes.c_wchar * 260),
]#[repr(C)]
pub struct GNSS_CP_NI_INFO {
pub Size: u32,
pub Version: u32,
pub RequestorId: [u16; 260],
pub NotificationText: [u16; 260],
}import "golang.org/x/sys/windows"
type GNSS_CP_NI_INFO struct {
Size uint32
Version uint32
RequestorId [260]uint16
NotificationText [260]uint16
}type
GNSS_CP_NI_INFO = record
Size: DWORD;
Version: DWORD;
RequestorId: array[0..259] of WideChar;
NotificationText: array[0..259] of WideChar;
end;const GNSS_CP_NI_INFO = extern struct {
Size: u32,
Version: u32,
RequestorId: [260]u16,
NotificationText: [260]u16,
};type
GNSS_CP_NI_INFO {.bycopy.} = object
Size: uint32
Version: uint32
RequestorId: array[260, uint16]
NotificationText: array[260, uint16]struct GNSS_CP_NI_INFO
{
uint Size;
uint Version;
wchar[260] RequestorId;
wchar[260] NotificationText;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; GNSS_CP_NI_INFO サイズ: 1048 バイト(x64)
dim st, 262 ; 4byte整数×262(構造体サイズ 1048 / 4 切り上げ)
; Size : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Version : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; RequestorId : WCHAR (+8, 520byte) varptr(st)+8 を基点に操作(520byte:入れ子/配列)
; NotificationText : WCHAR (+528, 520byte) varptr(st)+528 を基点に操作(520byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global GNSS_CP_NI_INFO
#field int Size
#field int Version
#field wchar RequestorId 260
#field wchar NotificationText 260
#endstruct
stdim st, GNSS_CP_NI_INFO ; NSTRUCT 変数を確保
st->Size = 100
mes "Size=" + st->Size