Win32 API 日本語リファレンス
ホームSystem.Rpc › NDR64_RANGE_PIPE_FORMAT

NDR64_RANGE_PIPE_FORMAT

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

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

フィールド

フィールドサイズx64x86説明
FormatCodeBYTE1+0+0範囲付きパイプ型を示すフォーマットコード。
FlagsBYTE1+1+1パイプの属性フラグ。
AlignmentBYTE1+2+2パイプ要素のアライメント(バイト数)。
ReservedBYTE1+3+3予約フィールド(BYTE)。将来の拡張用。
Typevoid*8/4+8+4パイプ要素の型記述へのポインタ。
MemorySizeDWORD4+16+8パイプ要素のメモリサイズ(バイト数)。
BufferSizeDWORD4+20+12パイプ要素のバッファサイズ(バイト数)。
MinValueDWORD4+24+16転送ブロック長の最小値(DWORD)。範囲下限を表す。
MaxValueDWORD4+28+20転送ブロック長の最大値(DWORD)。範囲上限を表す。

各言語での定義

#include <windows.h>

// NDR64_RANGE_PIPE_FORMAT  (x64 32 / x86 24 バイト)
typedef struct NDR64_RANGE_PIPE_FORMAT {
    BYTE FormatCode;
    BYTE Flags;
    BYTE Alignment;
    BYTE Reserved;
    void* Type;
    DWORD MemorySize;
    DWORD BufferSize;
    DWORD MinValue;
    DWORD MaxValue;
} NDR64_RANGE_PIPE_FORMAT;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NDR64_RANGE_PIPE_FORMAT
{
    public byte FormatCode;
    public byte Flags;
    public byte Alignment;
    public byte Reserved;
    public IntPtr Type;
    public uint MemorySize;
    public uint BufferSize;
    public uint MinValue;
    public uint MaxValue;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NDR64_RANGE_PIPE_FORMAT
    Public FormatCode As Byte
    Public Flags As Byte
    Public Alignment As Byte
    Public Reserved As Byte
    Public Type As IntPtr
    Public MemorySize As UInteger
    Public BufferSize As UInteger
    Public MinValue As UInteger
    Public MaxValue As UInteger
End Structure
import ctypes
from ctypes import wintypes

class NDR64_RANGE_PIPE_FORMAT(ctypes.Structure):
    _fields_ = [
        ("FormatCode", ctypes.c_ubyte),
        ("Flags", ctypes.c_ubyte),
        ("Alignment", ctypes.c_ubyte),
        ("Reserved", ctypes.c_ubyte),
        ("Type", ctypes.c_void_p),
        ("MemorySize", wintypes.DWORD),
        ("BufferSize", wintypes.DWORD),
        ("MinValue", wintypes.DWORD),
        ("MaxValue", wintypes.DWORD),
    ]
#[repr(C)]
pub struct NDR64_RANGE_PIPE_FORMAT {
    pub FormatCode: u8,
    pub Flags: u8,
    pub Alignment: u8,
    pub Reserved: u8,
    pub Type: *mut core::ffi::c_void,
    pub MemorySize: u32,
    pub BufferSize: u32,
    pub MinValue: u32,
    pub MaxValue: u32,
}
import "golang.org/x/sys/windows"

type NDR64_RANGE_PIPE_FORMAT struct {
	FormatCode byte
	Flags byte
	Alignment byte
	Reserved byte
	Type uintptr
	MemorySize uint32
	BufferSize uint32
	MinValue uint32
	MaxValue uint32
}
type
  NDR64_RANGE_PIPE_FORMAT = record
    FormatCode: Byte;
    Flags: Byte;
    Alignment: Byte;
    Reserved: Byte;
    Type: Pointer;
    MemorySize: DWORD;
    BufferSize: DWORD;
    MinValue: DWORD;
    MaxValue: DWORD;
  end;
const NDR64_RANGE_PIPE_FORMAT = extern struct {
    FormatCode: u8,
    Flags: u8,
    Alignment: u8,
    Reserved: u8,
    Type: ?*anyopaque,
    MemorySize: u32,
    BufferSize: u32,
    MinValue: u32,
    MaxValue: u32,
};
type
  NDR64_RANGE_PIPE_FORMAT {.bycopy.} = object
    FormatCode: uint8
    Flags: uint8
    Alignment: uint8
    Reserved: uint8
    Type: pointer
    MemorySize: uint32
    BufferSize: uint32
    MinValue: uint32
    MaxValue: uint32
struct NDR64_RANGE_PIPE_FORMAT
{
    ubyte FormatCode;
    ubyte Flags;
    ubyte Alignment;
    ubyte Reserved;
    void* Type;
    uint MemorySize;
    uint BufferSize;
    uint MinValue;
    uint MaxValue;
}

HSP用 定義

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

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

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