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

MIDL_TYPE_PICKLING_INFO

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

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

フィールド

フィールドサイズx64x86説明
VersionDWORD4+0+0型ピックリング(シリアライズ)情報のバージョン番号。
FlagsDWORD4+4+4ピックリング動作を制御するフラグ群。
ReservedUINT_PTR24/12+8+8予約フィールド(ポインタサイズ整数)。将来の拡張用。

各言語での定義

#include <windows.h>

// MIDL_TYPE_PICKLING_INFO  (x64 32 / x86 20 バイト)
typedef struct MIDL_TYPE_PICKLING_INFO {
    DWORD Version;
    DWORD Flags;
    UINT_PTR Reserved[3];
} MIDL_TYPE_PICKLING_INFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MIDL_TYPE_PICKLING_INFO
{
    public uint Version;
    public uint Flags;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public UIntPtr[] Reserved;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MIDL_TYPE_PICKLING_INFO
    Public Version As UInteger
    Public Flags As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=3)> Public Reserved() As UIntPtr
End Structure
import ctypes
from ctypes import wintypes

class MIDL_TYPE_PICKLING_INFO(ctypes.Structure):
    _fields_ = [
        ("Version", wintypes.DWORD),
        ("Flags", wintypes.DWORD),
        ("Reserved", ctypes.c_size_t * 3),
    ]
#[repr(C)]
pub struct MIDL_TYPE_PICKLING_INFO {
    pub Version: u32,
    pub Flags: u32,
    pub Reserved: [usize; 3],
}
import "golang.org/x/sys/windows"

type MIDL_TYPE_PICKLING_INFO struct {
	Version uint32
	Flags uint32
	Reserved [3]uintptr
}
type
  MIDL_TYPE_PICKLING_INFO = record
    Version: DWORD;
    Flags: DWORD;
    Reserved: array[0..2] of NativeUInt;
  end;
const MIDL_TYPE_PICKLING_INFO = extern struct {
    Version: u32,
    Flags: u32,
    Reserved: [3]usize,
};
type
  MIDL_TYPE_PICKLING_INFO {.bycopy.} = object
    Version: uint32
    Flags: uint32
    Reserved: array[3, uint]
struct MIDL_TYPE_PICKLING_INFO
{
    uint Version;
    uint Flags;
    size_t[3] Reserved;
}

HSP用 定義

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

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

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