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

GNSS_ERRORINFO

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

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

フィールド

フィールドサイズx64x86説明
SizeDWORD4+0+0この構造体のサイズをバイト単位で示すDWORD。
VersionDWORD4+4+4構造体のバージョンを示すDWORD。
ErrorCodeDWORD4+8+8発生したエラーのコードを示すDWORD。
IsRecoverableBOOL4+12+12エラーが回復可能かを示すBOOL。
ErrorDescriptionWCHAR512+16+16エラーの説明文を保持するワイド文字配列。
UnusedBYTE512+528+528未使用の予約バイト配列。

各言語での定義

#include <windows.h>

// GNSS_ERRORINFO  (x64 1040 / x86 1040 バイト)
typedef struct GNSS_ERRORINFO {
    DWORD Size;
    DWORD Version;
    DWORD ErrorCode;
    BOOL IsRecoverable;
    WCHAR ErrorDescription[256];
    BYTE Unused[512];
} GNSS_ERRORINFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GNSS_ERRORINFO
{
    public uint Size;
    public uint Version;
    public uint ErrorCode;
    [MarshalAs(UnmanagedType.Bool)] public bool IsRecoverable;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string ErrorDescription;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 512)] public byte[] Unused;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GNSS_ERRORINFO
    Public Size As UInteger
    Public Version As UInteger
    Public ErrorCode As UInteger
    <MarshalAs(UnmanagedType.Bool)> Public IsRecoverable As Boolean
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=256)> Public ErrorDescription As String
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=512)> Public Unused() As Byte
End Structure
import ctypes
from ctypes import wintypes

class GNSS_ERRORINFO(ctypes.Structure):
    _fields_ = [
        ("Size", wintypes.DWORD),
        ("Version", wintypes.DWORD),
        ("ErrorCode", wintypes.DWORD),
        ("IsRecoverable", wintypes.BOOL),
        ("ErrorDescription", ctypes.c_wchar * 256),
        ("Unused", ctypes.c_ubyte * 512),
    ]
#[repr(C)]
pub struct GNSS_ERRORINFO {
    pub Size: u32,
    pub Version: u32,
    pub ErrorCode: u32,
    pub IsRecoverable: i32,
    pub ErrorDescription: [u16; 256],
    pub Unused: [u8; 512],
}
import "golang.org/x/sys/windows"

type GNSS_ERRORINFO struct {
	Size uint32
	Version uint32
	ErrorCode uint32
	IsRecoverable int32
	ErrorDescription [256]uint16
	Unused [512]byte
}
type
  GNSS_ERRORINFO = record
    Size: DWORD;
    Version: DWORD;
    ErrorCode: DWORD;
    IsRecoverable: BOOL;
    ErrorDescription: array[0..255] of WideChar;
    Unused: array[0..511] of Byte;
  end;
const GNSS_ERRORINFO = extern struct {
    Size: u32,
    Version: u32,
    ErrorCode: u32,
    IsRecoverable: i32,
    ErrorDescription: [256]u16,
    Unused: [512]u8,
};
type
  GNSS_ERRORINFO {.bycopy.} = object
    Size: uint32
    Version: uint32
    ErrorCode: uint32
    IsRecoverable: int32
    ErrorDescription: array[256, uint16]
    Unused: array[512, uint8]
struct GNSS_ERRORINFO
{
    uint Size;
    uint Version;
    uint ErrorCode;
    int IsRecoverable;
    wchar[256] ErrorDescription;
    ubyte[512] Unused;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; GNSS_ERRORINFO サイズ: 1040 バイト(x64)
dim st, 260    ; 4byte整数×260(構造体サイズ 1040 / 4 切り上げ)
; Size : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Version : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; ErrorCode : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; IsRecoverable : BOOL (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; ErrorDescription : WCHAR (+16, 512byte)  varptr(st)+16 を基点に操作(512byte:入れ子/配列)
; Unused : BYTE (+528, 512byte)  varptr(st)+528 を基点に操作(512byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global GNSS_ERRORINFO
    #field int Size
    #field int Version
    #field int ErrorCode
    #field bool IsRecoverable
    #field wchar ErrorDescription 256
    #field byte Unused 512
#endstruct

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