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

NDR64_FIXED_REPEAT_FORMAT

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

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

フィールド

フィールドサイズx64x86説明
RepeatFormatNDR64_REPEAT_FORMAT16+0+0基となる繰り返しレイアウト情報(NDR64_REPEAT_FORMAT)。
IterationsDWORD4+16+16固定的な繰り返し回数。
ReservedDWORD4+20+20予約フィールド(DWORD)。将来の拡張用。

各言語での定義

#include <windows.h>

// NDR64_POINTER_REPEAT_FLAGS  (x64 1 / x86 1 バイト)
typedef struct NDR64_POINTER_REPEAT_FLAGS {
    BYTE _bitfield;
} NDR64_POINTER_REPEAT_FLAGS;

// NDR64_REPEAT_FORMAT  (x64 16 / x86 16 バイト)
typedef struct NDR64_REPEAT_FORMAT {
    BYTE FormatCode;
    NDR64_POINTER_REPEAT_FLAGS Flags;
    WORD Reserved;
    DWORD Increment;
    DWORD OffsetToArray;
    DWORD NumberOfPointers;
} NDR64_REPEAT_FORMAT;

// NDR64_FIXED_REPEAT_FORMAT  (x64 24 / x86 24 バイト)
typedef struct NDR64_FIXED_REPEAT_FORMAT {
    NDR64_REPEAT_FORMAT RepeatFormat;
    DWORD Iterations;
    DWORD Reserved;
} NDR64_FIXED_REPEAT_FORMAT;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NDR64_POINTER_REPEAT_FLAGS
{
    public byte _bitfield;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NDR64_REPEAT_FORMAT
{
    public byte FormatCode;
    public NDR64_POINTER_REPEAT_FLAGS Flags;
    public ushort Reserved;
    public uint Increment;
    public uint OffsetToArray;
    public uint NumberOfPointers;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NDR64_FIXED_REPEAT_FORMAT
{
    public NDR64_REPEAT_FORMAT RepeatFormat;
    public uint Iterations;
    public uint Reserved;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NDR64_POINTER_REPEAT_FLAGS
    Public _bitfield As Byte
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NDR64_REPEAT_FORMAT
    Public FormatCode As Byte
    Public Flags As NDR64_POINTER_REPEAT_FLAGS
    Public Reserved As UShort
    Public Increment As UInteger
    Public OffsetToArray As UInteger
    Public NumberOfPointers As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NDR64_FIXED_REPEAT_FORMAT
    Public RepeatFormat As NDR64_REPEAT_FORMAT
    Public Iterations As UInteger
    Public Reserved As UInteger
End Structure
import ctypes
from ctypes import wintypes

class NDR64_POINTER_REPEAT_FLAGS(ctypes.Structure):
    _fields_ = [
        ("_bitfield", ctypes.c_ubyte),
    ]

class NDR64_REPEAT_FORMAT(ctypes.Structure):
    _fields_ = [
        ("FormatCode", ctypes.c_ubyte),
        ("Flags", NDR64_POINTER_REPEAT_FLAGS),
        ("Reserved", ctypes.c_ushort),
        ("Increment", wintypes.DWORD),
        ("OffsetToArray", wintypes.DWORD),
        ("NumberOfPointers", wintypes.DWORD),
    ]

class NDR64_FIXED_REPEAT_FORMAT(ctypes.Structure):
    _fields_ = [
        ("RepeatFormat", NDR64_REPEAT_FORMAT),
        ("Iterations", wintypes.DWORD),
        ("Reserved", wintypes.DWORD),
    ]
#[repr(C)]
pub struct NDR64_POINTER_REPEAT_FLAGS {
    pub _bitfield: u8,
}

#[repr(C)]
pub struct NDR64_REPEAT_FORMAT {
    pub FormatCode: u8,
    pub Flags: NDR64_POINTER_REPEAT_FLAGS,
    pub Reserved: u16,
    pub Increment: u32,
    pub OffsetToArray: u32,
    pub NumberOfPointers: u32,
}

#[repr(C)]
pub struct NDR64_FIXED_REPEAT_FORMAT {
    pub RepeatFormat: NDR64_REPEAT_FORMAT,
    pub Iterations: u32,
    pub Reserved: u32,
}
import "golang.org/x/sys/windows"

type NDR64_POINTER_REPEAT_FLAGS struct {
	_bitfield byte
}

type NDR64_REPEAT_FORMAT struct {
	FormatCode byte
	Flags NDR64_POINTER_REPEAT_FLAGS
	Reserved uint16
	Increment uint32
	OffsetToArray uint32
	NumberOfPointers uint32
}

type NDR64_FIXED_REPEAT_FORMAT struct {
	RepeatFormat NDR64_REPEAT_FORMAT
	Iterations uint32
	Reserved uint32
}
type
  NDR64_POINTER_REPEAT_FLAGS = record
    _bitfield: Byte;
  end;

  NDR64_REPEAT_FORMAT = record
    FormatCode: Byte;
    Flags: NDR64_POINTER_REPEAT_FLAGS;
    Reserved: Word;
    Increment: DWORD;
    OffsetToArray: DWORD;
    NumberOfPointers: DWORD;
  end;

  NDR64_FIXED_REPEAT_FORMAT = record
    RepeatFormat: NDR64_REPEAT_FORMAT;
    Iterations: DWORD;
    Reserved: DWORD;
  end;
const NDR64_POINTER_REPEAT_FLAGS = extern struct {
    _bitfield: u8,
};

const NDR64_REPEAT_FORMAT = extern struct {
    FormatCode: u8,
    Flags: NDR64_POINTER_REPEAT_FLAGS,
    Reserved: u16,
    Increment: u32,
    OffsetToArray: u32,
    NumberOfPointers: u32,
};

const NDR64_FIXED_REPEAT_FORMAT = extern struct {
    RepeatFormat: NDR64_REPEAT_FORMAT,
    Iterations: u32,
    Reserved: u32,
};
type
  NDR64_POINTER_REPEAT_FLAGS {.bycopy.} = object
    _bitfield: uint8

  NDR64_REPEAT_FORMAT {.bycopy.} = object
    FormatCode: uint8
    Flags: NDR64_POINTER_REPEAT_FLAGS
    Reserved: uint16
    Increment: uint32
    OffsetToArray: uint32
    NumberOfPointers: uint32

  NDR64_FIXED_REPEAT_FORMAT {.bycopy.} = object
    RepeatFormat: NDR64_REPEAT_FORMAT
    Iterations: uint32
    Reserved: uint32
struct NDR64_POINTER_REPEAT_FLAGS
{
    ubyte _bitfield;
}

struct NDR64_REPEAT_FORMAT
{
    ubyte FormatCode;
    NDR64_POINTER_REPEAT_FLAGS Flags;
    ushort Reserved;
    uint Increment;
    uint OffsetToArray;
    uint NumberOfPointers;
}

struct NDR64_FIXED_REPEAT_FORMAT
{
    NDR64_REPEAT_FORMAT RepeatFormat;
    uint Iterations;
    uint Reserved;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; NDR64_FIXED_REPEAT_FORMAT サイズ: 24 バイト(x64)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; RepeatFormat : NDR64_REPEAT_FORMAT (+0, 16byte)  varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; Iterations : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; Reserved : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global NDR64_POINTER_REPEAT_FLAGS
    #field byte _bitfield
#endstruct

#defstruct global NDR64_REPEAT_FORMAT
    #field byte FormatCode
    #field NDR64_POINTER_REPEAT_FLAGS Flags
    #field short Reserved
    #field int Increment
    #field int OffsetToArray
    #field int NumberOfPointers
#endstruct

#defstruct global NDR64_FIXED_REPEAT_FORMAT
    #field NDR64_REPEAT_FORMAT RepeatFormat
    #field int Iterations
    #field int Reserved
#endstruct

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