ホーム › System.Com › RemSTGMEDIUM
RemSTGMEDIUM
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| tymed | DWORD | 4 | +0 | +0 | データの格納媒体種別(TYMED_系)。 |
| dwHandleType | DWORD | 4 | +4 | +4 | ハンドルの種別を示す値。 |
| pData | DWORD | 4 | +8 | +8 | リモート転送されるデータ参照値。 |
| pUnkForRelease | DWORD | 4 | +12 | +12 | 解放処理を委譲するオブジェクト参照。0でなし。 |
| cbData | DWORD | 4 | +16 | +16 | dataのバイトサイズ。 |
| data | BYTE | 1 | +20 | +20 | 実際に転送される可変長データの先頭。 |
各言語での定義
#include <windows.h>
// RemSTGMEDIUM (x64 24 / x86 24 バイト)
typedef struct RemSTGMEDIUM {
DWORD tymed;
DWORD dwHandleType;
DWORD pData;
DWORD pUnkForRelease;
DWORD cbData;
BYTE data[1];
} RemSTGMEDIUM;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RemSTGMEDIUM
{
public uint tymed;
public uint dwHandleType;
public uint pData;
public uint pUnkForRelease;
public uint cbData;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public byte[] data;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RemSTGMEDIUM
Public tymed As UInteger
Public dwHandleType As UInteger
Public pData As UInteger
Public pUnkForRelease As UInteger
Public cbData As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public data() As Byte
End Structureimport ctypes
from ctypes import wintypes
class RemSTGMEDIUM(ctypes.Structure):
_fields_ = [
("tymed", wintypes.DWORD),
("dwHandleType", wintypes.DWORD),
("pData", wintypes.DWORD),
("pUnkForRelease", wintypes.DWORD),
("cbData", wintypes.DWORD),
("data", ctypes.c_ubyte * 1),
]#[repr(C)]
pub struct RemSTGMEDIUM {
pub tymed: u32,
pub dwHandleType: u32,
pub pData: u32,
pub pUnkForRelease: u32,
pub cbData: u32,
pub data: [u8; 1],
}import "golang.org/x/sys/windows"
type RemSTGMEDIUM struct {
tymed uint32
dwHandleType uint32
pData uint32
pUnkForRelease uint32
cbData uint32
data [1]byte
}type
RemSTGMEDIUM = record
tymed: DWORD;
dwHandleType: DWORD;
pData: DWORD;
pUnkForRelease: DWORD;
cbData: DWORD;
data: array[0..0] of Byte;
end;const RemSTGMEDIUM = extern struct {
tymed: u32,
dwHandleType: u32,
pData: u32,
pUnkForRelease: u32,
cbData: u32,
data: [1]u8,
};type
RemSTGMEDIUM {.bycopy.} = object
tymed: uint32
dwHandleType: uint32
pData: uint32
pUnkForRelease: uint32
cbData: uint32
data: array[1, uint8]struct RemSTGMEDIUM
{
uint tymed;
uint dwHandleType;
uint pData;
uint pUnkForRelease;
uint cbData;
ubyte[1] data;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; RemSTGMEDIUM サイズ: 24 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; tymed : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwHandleType : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; pData : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; pUnkForRelease : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; cbData : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; data : BYTE (+20, 1byte) varptr(st)+20 を基点に操作(1byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global RemSTGMEDIUM
#field int tymed
#field int dwHandleType
#field int pData
#field int pUnkForRelease
#field int cbData
#field byte data 1
#endstruct
stdim st, RemSTGMEDIUM ; NSTRUCT 変数を確保
st->tymed = 100
mes "tymed=" + st->tymed