ホーム › System.Rpc › NDR64_PIPE_FORMAT
NDR64_PIPE_FORMAT
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| FormatCode | BYTE | 1 | +0 | +0 | パイプ型(ストリーム転送)を示すフォーマットコード。 |
| Flags | BYTE | 1 | +1 | +1 | パイプの属性フラグ。 |
| Alignment | BYTE | 1 | +2 | +2 | パイプ要素のアライメント(バイト数)。 |
| Reserved | BYTE | 1 | +3 | +3 | 予約フィールド(BYTE)。将来の拡張用。 |
| Type | void* | 8/4 | +8 | +4 | パイプ要素の型記述へのポインタ。 |
| MemorySize | DWORD | 4 | +16 | +8 | パイプ要素のメモリサイズ(バイト数)。 |
| BufferSize | DWORD | 4 | +20 | +12 | パイプ要素のバッファサイズ(バイト数)。 |
各言語での定義
#include <windows.h>
// NDR64_PIPE_FORMAT (x64 24 / x86 16 バイト)
typedef struct NDR64_PIPE_FORMAT {
BYTE FormatCode;
BYTE Flags;
BYTE Alignment;
BYTE Reserved;
void* Type;
DWORD MemorySize;
DWORD BufferSize;
} NDR64_PIPE_FORMAT;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NDR64_PIPE_FORMAT
{
public byte FormatCode;
public byte Flags;
public byte Alignment;
public byte Reserved;
public IntPtr Type;
public uint MemorySize;
public uint BufferSize;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NDR64_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
End Structureimport ctypes
from ctypes import wintypes
class NDR64_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),
]#[repr(C)]
pub struct NDR64_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,
}import "golang.org/x/sys/windows"
type NDR64_PIPE_FORMAT struct {
FormatCode byte
Flags byte
Alignment byte
Reserved byte
Type uintptr
MemorySize uint32
BufferSize uint32
}type
NDR64_PIPE_FORMAT = record
FormatCode: Byte;
Flags: Byte;
Alignment: Byte;
Reserved: Byte;
Type: Pointer;
MemorySize: DWORD;
BufferSize: DWORD;
end;const NDR64_PIPE_FORMAT = extern struct {
FormatCode: u8,
Flags: u8,
Alignment: u8,
Reserved: u8,
Type: ?*anyopaque,
MemorySize: u32,
BufferSize: u32,
};type
NDR64_PIPE_FORMAT {.bycopy.} = object
FormatCode: uint8
Flags: uint8
Alignment: uint8
Reserved: uint8
Type: pointer
MemorySize: uint32
BufferSize: uint32struct NDR64_PIPE_FORMAT
{
ubyte FormatCode;
ubyte Flags;
ubyte Alignment;
ubyte Reserved;
void* Type;
uint MemorySize;
uint BufferSize;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; NDR64_PIPE_FORMAT サイズ: 16 バイト(x86)
dim st, 4 ; 4byte整数×4(構造体サイズ 16 / 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 も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; NDR64_PIPE_FORMAT サイズ: 24 バイト(x64)
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* (+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 も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global NDR64_PIPE_FORMAT
#field byte FormatCode
#field byte Flags
#field byte Alignment
#field byte Reserved
#field intptr Type
#field int MemorySize
#field int BufferSize
#endstruct
stdim st, NDR64_PIPE_FORMAT ; NSTRUCT 変数を確保
st->FormatCode = 100
mes "FormatCode=" + st->FormatCode