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

RTR_TOC_ENTRY

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

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

フィールド

フィールドサイズx64x86説明
InfoTypeDWORD4+0+0この情報ブロックの種別を識別する型コードを示す。
InfoSizeDWORD4+4+41要素あたりの情報サイズをバイト単位で示す。
CountDWORD4+8+8情報ブロックに含まれる要素の数を示す。
OffsetDWORD4+12+12ブロックヘッダ先頭から情報本体までのオフセットをバイト単位で示す。

各言語での定義

#include <windows.h>

// RTR_TOC_ENTRY  (x64 16 / x86 16 バイト)
typedef struct RTR_TOC_ENTRY {
    DWORD InfoType;
    DWORD InfoSize;
    DWORD Count;
    DWORD Offset;
} RTR_TOC_ENTRY;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RTR_TOC_ENTRY
{
    public uint InfoType;
    public uint InfoSize;
    public uint Count;
    public uint Offset;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RTR_TOC_ENTRY
    Public InfoType As UInteger
    Public InfoSize As UInteger
    Public Count As UInteger
    Public Offset As UInteger
End Structure
import ctypes
from ctypes import wintypes

class RTR_TOC_ENTRY(ctypes.Structure):
    _fields_ = [
        ("InfoType", wintypes.DWORD),
        ("InfoSize", wintypes.DWORD),
        ("Count", wintypes.DWORD),
        ("Offset", wintypes.DWORD),
    ]
#[repr(C)]
pub struct RTR_TOC_ENTRY {
    pub InfoType: u32,
    pub InfoSize: u32,
    pub Count: u32,
    pub Offset: u32,
}
import "golang.org/x/sys/windows"

type RTR_TOC_ENTRY struct {
	InfoType uint32
	InfoSize uint32
	Count uint32
	Offset uint32
}
type
  RTR_TOC_ENTRY = record
    InfoType: DWORD;
    InfoSize: DWORD;
    Count: DWORD;
    Offset: DWORD;
  end;
const RTR_TOC_ENTRY = extern struct {
    InfoType: u32,
    InfoSize: u32,
    Count: u32,
    Offset: u32,
};
type
  RTR_TOC_ENTRY {.bycopy.} = object
    InfoType: uint32
    InfoSize: uint32
    Count: uint32
    Offset: uint32
struct RTR_TOC_ENTRY
{
    uint InfoType;
    uint InfoSize;
    uint Count;
    uint Offset;
}

HSP用 定義

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

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

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