Win32 API 日本語リファレンス
ホームNetworkManagement.Rras › RASCTRYINFO

RASCTRYINFO

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

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

フィールド

フィールドサイズx64x86説明
dwSizeDWORD4+0+0この構造体のバイト単位のサイズ。
dwCountryIDDWORD4+4+4TAPIの国/地域識別子(国ID)。
dwNextCountryIDDWORD4+8+8リスト内の次の国IDへのリンク。0ならリスト末尾。
dwCountryCodeDWORD4+12+12国際電話の国番号。
dwCountryNameOffsetDWORD4+16+16国名文字列への構造体先頭からのバイトオフセット。

各言語での定義

#include <windows.h>

// RASCTRYINFO  (x64 20 / x86 20 バイト)
typedef struct RASCTRYINFO {
    DWORD dwSize;
    DWORD dwCountryID;
    DWORD dwNextCountryID;
    DWORD dwCountryCode;
    DWORD dwCountryNameOffset;
} RASCTRYINFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RASCTRYINFO
{
    public uint dwSize;
    public uint dwCountryID;
    public uint dwNextCountryID;
    public uint dwCountryCode;
    public uint dwCountryNameOffset;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RASCTRYINFO
    Public dwSize As UInteger
    Public dwCountryID As UInteger
    Public dwNextCountryID As UInteger
    Public dwCountryCode As UInteger
    Public dwCountryNameOffset As UInteger
End Structure
import ctypes
from ctypes import wintypes

class RASCTRYINFO(ctypes.Structure):
    _fields_ = [
        ("dwSize", wintypes.DWORD),
        ("dwCountryID", wintypes.DWORD),
        ("dwNextCountryID", wintypes.DWORD),
        ("dwCountryCode", wintypes.DWORD),
        ("dwCountryNameOffset", wintypes.DWORD),
    ]
#[repr(C)]
pub struct RASCTRYINFO {
    pub dwSize: u32,
    pub dwCountryID: u32,
    pub dwNextCountryID: u32,
    pub dwCountryCode: u32,
    pub dwCountryNameOffset: u32,
}
import "golang.org/x/sys/windows"

type RASCTRYINFO struct {
	dwSize uint32
	dwCountryID uint32
	dwNextCountryID uint32
	dwCountryCode uint32
	dwCountryNameOffset uint32
}
type
  RASCTRYINFO = record
    dwSize: DWORD;
    dwCountryID: DWORD;
    dwNextCountryID: DWORD;
    dwCountryCode: DWORD;
    dwCountryNameOffset: DWORD;
  end;
const RASCTRYINFO = extern struct {
    dwSize: u32,
    dwCountryID: u32,
    dwNextCountryID: u32,
    dwCountryCode: u32,
    dwCountryNameOffset: u32,
};
type
  RASCTRYINFO {.bycopy.} = object
    dwSize: uint32
    dwCountryID: uint32
    dwNextCountryID: uint32
    dwCountryCode: uint32
    dwCountryNameOffset: uint32
struct RASCTRYINFO
{
    uint dwSize;
    uint dwCountryID;
    uint dwNextCountryID;
    uint dwCountryCode;
    uint dwCountryNameOffset;
}

HSP用 定義

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

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

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