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

LINECOUNTRYLIST

構造体
サイズx64: 24 バイト / x86: 24 バイトパッキング1

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

フィールド

フィールドサイズx64x86説明
dwTotalSizeDWORD4+0+0この構造体に割り当てられた総サイズをバイトで表す。
dwNeededSizeDWORD4+4+4全情報の格納に必要なサイズをバイトで表す。
dwUsedSizeDWORD4+8+8実際に使用されたサイズをバイトで表す。
dwNumCountriesDWORD4+12+12リストに含まれる国エントリの個数を表す。
dwCountryListSizeDWORD4+16+16国エントリリストのサイズをバイトで表す。
dwCountryListOffsetDWORD4+20+20国エントリリストまでのオフセットをバイトで表す。

各言語での定義

#include <windows.h>

// LINECOUNTRYLIST  (x64 24 / x86 24 バイト)
#pragma pack(push, 1)
typedef struct LINECOUNTRYLIST {
    DWORD dwTotalSize;
    DWORD dwNeededSize;
    DWORD dwUsedSize;
    DWORD dwNumCountries;
    DWORD dwCountryListSize;
    DWORD dwCountryListOffset;
} LINECOUNTRYLIST;
#pragma pack(pop)
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct LINECOUNTRYLIST
{
    public uint dwTotalSize;
    public uint dwNeededSize;
    public uint dwUsedSize;
    public uint dwNumCountries;
    public uint dwCountryListSize;
    public uint dwCountryListOffset;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure LINECOUNTRYLIST
    Public dwTotalSize As UInteger
    Public dwNeededSize As UInteger
    Public dwUsedSize As UInteger
    Public dwNumCountries As UInteger
    Public dwCountryListSize As UInteger
    Public dwCountryListOffset As UInteger
End Structure
import ctypes
from ctypes import wintypes

class LINECOUNTRYLIST(ctypes.Structure):
    _pack_ = 1
    _fields_ = [
        ("dwTotalSize", wintypes.DWORD),
        ("dwNeededSize", wintypes.DWORD),
        ("dwUsedSize", wintypes.DWORD),
        ("dwNumCountries", wintypes.DWORD),
        ("dwCountryListSize", wintypes.DWORD),
        ("dwCountryListOffset", wintypes.DWORD),
    ]
#[repr(C, packed(1))]
pub struct LINECOUNTRYLIST {
    pub dwTotalSize: u32,
    pub dwNeededSize: u32,
    pub dwUsedSize: u32,
    pub dwNumCountries: u32,
    pub dwCountryListSize: u32,
    pub dwCountryListOffset: u32,
}
import "golang.org/x/sys/windows"

type LINECOUNTRYLIST struct {
	dwTotalSize uint32
	dwNeededSize uint32
	dwUsedSize uint32
	dwNumCountries uint32
	dwCountryListSize uint32
	dwCountryListOffset uint32
}
type
  LINECOUNTRYLIST = packed record
    dwTotalSize: DWORD;
    dwNeededSize: DWORD;
    dwUsedSize: DWORD;
    dwNumCountries: DWORD;
    dwCountryListSize: DWORD;
    dwCountryListOffset: DWORD;
  end;
const LINECOUNTRYLIST = extern struct {
    dwTotalSize: u32,
    dwNeededSize: u32,
    dwUsedSize: u32,
    dwNumCountries: u32,
    dwCountryListSize: u32,
    dwCountryListOffset: u32,
};
type
  LINECOUNTRYLIST {.packed.} = object
    dwTotalSize: uint32
    dwNeededSize: uint32
    dwUsedSize: uint32
    dwNumCountries: uint32
    dwCountryListSize: uint32
    dwCountryListOffset: uint32
align(1)
struct LINECOUNTRYLIST
{
    uint dwTotalSize;
    uint dwNeededSize;
    uint dwUsedSize;
    uint dwNumCountries;
    uint dwCountryListSize;
    uint dwCountryListOffset;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; LINECOUNTRYLIST サイズ: 24 バイト(x64)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; dwTotalSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwNeededSize : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwUsedSize : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; dwNumCountries : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; dwCountryListSize : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; dwCountryListOffset : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global LINECOUNTRYLIST, pack=1
    #field int dwTotalSize
    #field int dwNeededSize
    #field int dwUsedSize
    #field int dwNumCountries
    #field int dwCountryListSize
    #field int dwCountryListOffset
#endstruct

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