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

NDR64_CONF_VAR_BOGUS_ARRAY_HEADER_FORMAT

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

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

フィールド

フィールドサイズx64x86説明
FixedArrayFormatNDR64_BOGUS_ARRAY_HEADER_FORMAT16/12+0+0基となる複雑配列ヘッダ情報(NDR64_BOGUS_ARRAY_HEADER_FORMAT)。
ConfDescriptionvoid*8/4+16+12確保要素数を決定する記述(式)へのポインタ。
VarDescriptionvoid*8/4+24+16転送する有効要素範囲を決定する記述(式)へのポインタ。
OffsetDescriptionvoid*8/4+32+20転送開始オフセットを決定する記述(式)へのポインタ。

各言語での定義

#include <windows.h>

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

// NDR64_BOGUS_ARRAY_HEADER_FORMAT  (x64 16 / x86 12 バイト)
typedef struct NDR64_BOGUS_ARRAY_HEADER_FORMAT {
    BYTE FormatCode;
    BYTE Alignment;
    NDR64_ARRAY_FLAGS Flags;
    BYTE NumberDims;
    DWORD NumberElements;
    void* Element;
} NDR64_BOGUS_ARRAY_HEADER_FORMAT;

// NDR64_CONF_VAR_BOGUS_ARRAY_HEADER_FORMAT  (x64 40 / x86 24 バイト)
typedef struct NDR64_CONF_VAR_BOGUS_ARRAY_HEADER_FORMAT {
    NDR64_BOGUS_ARRAY_HEADER_FORMAT FixedArrayFormat;
    void* ConfDescription;
    void* VarDescription;
    void* OffsetDescription;
} NDR64_CONF_VAR_BOGUS_ARRAY_HEADER_FORMAT;
using System;
using System.Runtime.InteropServices;

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

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NDR64_BOGUS_ARRAY_HEADER_FORMAT
{
    public byte FormatCode;
    public byte Alignment;
    public NDR64_ARRAY_FLAGS Flags;
    public byte NumberDims;
    public uint NumberElements;
    public IntPtr Element;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NDR64_CONF_VAR_BOGUS_ARRAY_HEADER_FORMAT
{
    public NDR64_BOGUS_ARRAY_HEADER_FORMAT FixedArrayFormat;
    public IntPtr ConfDescription;
    public IntPtr VarDescription;
    public IntPtr OffsetDescription;
}
Imports System.Runtime.InteropServices

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

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NDR64_BOGUS_ARRAY_HEADER_FORMAT
    Public FormatCode As Byte
    Public Alignment As Byte
    Public Flags As NDR64_ARRAY_FLAGS
    Public NumberDims As Byte
    Public NumberElements As UInteger
    Public Element As IntPtr
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NDR64_CONF_VAR_BOGUS_ARRAY_HEADER_FORMAT
    Public FixedArrayFormat As NDR64_BOGUS_ARRAY_HEADER_FORMAT
    Public ConfDescription As IntPtr
    Public VarDescription As IntPtr
    Public OffsetDescription As IntPtr
End Structure
import ctypes
from ctypes import wintypes

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

class NDR64_BOGUS_ARRAY_HEADER_FORMAT(ctypes.Structure):
    _fields_ = [
        ("FormatCode", ctypes.c_ubyte),
        ("Alignment", ctypes.c_ubyte),
        ("Flags", NDR64_ARRAY_FLAGS),
        ("NumberDims", ctypes.c_ubyte),
        ("NumberElements", wintypes.DWORD),
        ("Element", ctypes.c_void_p),
    ]

class NDR64_CONF_VAR_BOGUS_ARRAY_HEADER_FORMAT(ctypes.Structure):
    _fields_ = [
        ("FixedArrayFormat", NDR64_BOGUS_ARRAY_HEADER_FORMAT),
        ("ConfDescription", ctypes.c_void_p),
        ("VarDescription", ctypes.c_void_p),
        ("OffsetDescription", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct NDR64_ARRAY_FLAGS {
    pub _bitfield: u8,
}

#[repr(C)]
pub struct NDR64_BOGUS_ARRAY_HEADER_FORMAT {
    pub FormatCode: u8,
    pub Alignment: u8,
    pub Flags: NDR64_ARRAY_FLAGS,
    pub NumberDims: u8,
    pub NumberElements: u32,
    pub Element: *mut core::ffi::c_void,
}

#[repr(C)]
pub struct NDR64_CONF_VAR_BOGUS_ARRAY_HEADER_FORMAT {
    pub FixedArrayFormat: NDR64_BOGUS_ARRAY_HEADER_FORMAT,
    pub ConfDescription: *mut core::ffi::c_void,
    pub VarDescription: *mut core::ffi::c_void,
    pub OffsetDescription: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type NDR64_ARRAY_FLAGS struct {
	_bitfield byte
}

type NDR64_BOGUS_ARRAY_HEADER_FORMAT struct {
	FormatCode byte
	Alignment byte
	Flags NDR64_ARRAY_FLAGS
	NumberDims byte
	NumberElements uint32
	Element uintptr
}

type NDR64_CONF_VAR_BOGUS_ARRAY_HEADER_FORMAT struct {
	FixedArrayFormat NDR64_BOGUS_ARRAY_HEADER_FORMAT
	ConfDescription uintptr
	VarDescription uintptr
	OffsetDescription uintptr
}
type
  NDR64_ARRAY_FLAGS = record
    _bitfield: Byte;
  end;

  NDR64_BOGUS_ARRAY_HEADER_FORMAT = record
    FormatCode: Byte;
    Alignment: Byte;
    Flags: NDR64_ARRAY_FLAGS;
    NumberDims: Byte;
    NumberElements: DWORD;
    Element: Pointer;
  end;

  NDR64_CONF_VAR_BOGUS_ARRAY_HEADER_FORMAT = record
    FixedArrayFormat: NDR64_BOGUS_ARRAY_HEADER_FORMAT;
    ConfDescription: Pointer;
    VarDescription: Pointer;
    OffsetDescription: Pointer;
  end;
const NDR64_ARRAY_FLAGS = extern struct {
    _bitfield: u8,
};

const NDR64_BOGUS_ARRAY_HEADER_FORMAT = extern struct {
    FormatCode: u8,
    Alignment: u8,
    Flags: NDR64_ARRAY_FLAGS,
    NumberDims: u8,
    NumberElements: u32,
    Element: ?*anyopaque,
};

const NDR64_CONF_VAR_BOGUS_ARRAY_HEADER_FORMAT = extern struct {
    FixedArrayFormat: NDR64_BOGUS_ARRAY_HEADER_FORMAT,
    ConfDescription: ?*anyopaque,
    VarDescription: ?*anyopaque,
    OffsetDescription: ?*anyopaque,
};
type
  NDR64_ARRAY_FLAGS {.bycopy.} = object
    _bitfield: uint8

  NDR64_BOGUS_ARRAY_HEADER_FORMAT {.bycopy.} = object
    FormatCode: uint8
    Alignment: uint8
    Flags: NDR64_ARRAY_FLAGS
    NumberDims: uint8
    NumberElements: uint32
    Element: pointer

  NDR64_CONF_VAR_BOGUS_ARRAY_HEADER_FORMAT {.bycopy.} = object
    FixedArrayFormat: NDR64_BOGUS_ARRAY_HEADER_FORMAT
    ConfDescription: pointer
    VarDescription: pointer
    OffsetDescription: pointer
struct NDR64_ARRAY_FLAGS
{
    ubyte _bitfield;
}

struct NDR64_BOGUS_ARRAY_HEADER_FORMAT
{
    ubyte FormatCode;
    ubyte Alignment;
    NDR64_ARRAY_FLAGS Flags;
    ubyte NumberDims;
    uint NumberElements;
    void* Element;
}

struct NDR64_CONF_VAR_BOGUS_ARRAY_HEADER_FORMAT
{
    NDR64_BOGUS_ARRAY_HEADER_FORMAT FixedArrayFormat;
    void* ConfDescription;
    void* VarDescription;
    void* OffsetDescription;
}

HSP用 定義

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

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

#defstruct global NDR64_BOGUS_ARRAY_HEADER_FORMAT
    #field byte FormatCode
    #field byte Alignment
    #field NDR64_ARRAY_FLAGS Flags
    #field byte NumberDims
    #field int NumberElements
    #field intptr Element
#endstruct

#defstruct global NDR64_CONF_VAR_BOGUS_ARRAY_HEADER_FORMAT
    #field NDR64_BOGUS_ARRAY_HEADER_FORMAT FixedArrayFormat
    #field intptr ConfDescription
    #field intptr VarDescription
    #field intptr OffsetDescription
#endstruct

stdim st, NDR64_CONF_VAR_BOGUS_ARRAY_HEADER_FORMAT        ; NSTRUCT 変数を確保