Win32 API 日本語リファレンス
ホームNetworking.RemoteDifferentialCompression › RdcNeed

RdcNeed

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

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

フィールド

フィールドサイズx64x86説明
m_BlockTypeRdcNeedType4+0+0必要データブロックの種別(ソース由来/シード由来)を示す列挙値。
m_FileOffsetULONGLONG8+8+8対象ファイル内でのブロック開始オフセット(バイト)。
m_BlockLengthULONGLONG8+16+16必要なブロックの長さ(バイト)。

各言語での定義

#include <windows.h>

// RdcNeed  (x64 24 / x86 24 バイト)
typedef struct RdcNeed {
    RdcNeedType m_BlockType;
    ULONGLONG m_FileOffset;
    ULONGLONG m_BlockLength;
} RdcNeed;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RdcNeed
{
    public int m_BlockType;
    public ulong m_FileOffset;
    public ulong m_BlockLength;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RdcNeed
    Public m_BlockType As Integer
    Public m_FileOffset As ULong
    Public m_BlockLength As ULong
End Structure
import ctypes
from ctypes import wintypes

class RdcNeed(ctypes.Structure):
    _fields_ = [
        ("m_BlockType", ctypes.c_int),
        ("m_FileOffset", ctypes.c_ulonglong),
        ("m_BlockLength", ctypes.c_ulonglong),
    ]
#[repr(C)]
pub struct RdcNeed {
    pub m_BlockType: i32,
    pub m_FileOffset: u64,
    pub m_BlockLength: u64,
}
import "golang.org/x/sys/windows"

type RdcNeed struct {
	m_BlockType int32
	m_FileOffset uint64
	m_BlockLength uint64
}
type
  RdcNeed = record
    m_BlockType: Integer;
    m_FileOffset: UInt64;
    m_BlockLength: UInt64;
  end;
const RdcNeed = extern struct {
    m_BlockType: i32,
    m_FileOffset: u64,
    m_BlockLength: u64,
};
type
  RdcNeed {.bycopy.} = object
    m_BlockType: int32
    m_FileOffset: uint64
    m_BlockLength: uint64
struct RdcNeed
{
    int m_BlockType;
    ulong m_FileOffset;
    ulong m_BlockLength;
}

HSP用 定義

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

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

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