Win32 API 日本語リファレンス
ホームGlobalization › MAPPING_PROPERTY_BAG

MAPPING_PROPERTY_BAG

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

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

フィールド

フィールドサイズx64x86説明
SizeUINT_PTR8/4+0+0この構造体のバイトサイズ。
prgResultRangesMAPPING_DATA_RANGE*8/4+8+4認識結果の範囲を表すMAPPING_DATA_RANGE配列。
dwRangesCountDWORD4+16+8結果範囲の数。
pServiceDatavoid*8/4+24+12サービスが内部使用するデータへのポインタ。
dwServiceDataSizeDWORD4+32+16サービスデータのバイトサイズ。
pCallerDatavoid*8/4+40+20呼び出し側が指定したデータへのポインタ。
dwCallerDataSizeDWORD4+48+24呼び出し側データのバイトサイズ。
pContextvoid*8/4+56+28プロパティバッグのコンテキストへのポインタ。

各言語での定義

#include <windows.h>

// MAPPING_PROPERTY_BAG  (x64 64 / x86 32 バイト)
typedef struct MAPPING_PROPERTY_BAG {
    UINT_PTR Size;
    MAPPING_DATA_RANGE* prgResultRanges;
    DWORD dwRangesCount;
    void* pServiceData;
    DWORD dwServiceDataSize;
    void* pCallerData;
    DWORD dwCallerDataSize;
    void* pContext;
} MAPPING_PROPERTY_BAG;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MAPPING_PROPERTY_BAG
{
    public UIntPtr Size;
    public IntPtr prgResultRanges;
    public uint dwRangesCount;
    public IntPtr pServiceData;
    public uint dwServiceDataSize;
    public IntPtr pCallerData;
    public uint dwCallerDataSize;
    public IntPtr pContext;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MAPPING_PROPERTY_BAG
    Public Size As UIntPtr
    Public prgResultRanges As IntPtr
    Public dwRangesCount As UInteger
    Public pServiceData As IntPtr
    Public dwServiceDataSize As UInteger
    Public pCallerData As IntPtr
    Public dwCallerDataSize As UInteger
    Public pContext As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class MAPPING_PROPERTY_BAG(ctypes.Structure):
    _fields_ = [
        ("Size", ctypes.c_size_t),
        ("prgResultRanges", ctypes.c_void_p),
        ("dwRangesCount", wintypes.DWORD),
        ("pServiceData", ctypes.c_void_p),
        ("dwServiceDataSize", wintypes.DWORD),
        ("pCallerData", ctypes.c_void_p),
        ("dwCallerDataSize", wintypes.DWORD),
        ("pContext", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct MAPPING_PROPERTY_BAG {
    pub Size: usize,
    pub prgResultRanges: *mut core::ffi::c_void,
    pub dwRangesCount: u32,
    pub pServiceData: *mut core::ffi::c_void,
    pub dwServiceDataSize: u32,
    pub pCallerData: *mut core::ffi::c_void,
    pub dwCallerDataSize: u32,
    pub pContext: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type MAPPING_PROPERTY_BAG struct {
	Size uintptr
	prgResultRanges uintptr
	dwRangesCount uint32
	pServiceData uintptr
	dwServiceDataSize uint32
	pCallerData uintptr
	dwCallerDataSize uint32
	pContext uintptr
}
type
  MAPPING_PROPERTY_BAG = record
    Size: NativeUInt;
    prgResultRanges: Pointer;
    dwRangesCount: DWORD;
    pServiceData: Pointer;
    dwServiceDataSize: DWORD;
    pCallerData: Pointer;
    dwCallerDataSize: DWORD;
    pContext: Pointer;
  end;
const MAPPING_PROPERTY_BAG = extern struct {
    Size: usize,
    prgResultRanges: ?*anyopaque,
    dwRangesCount: u32,
    pServiceData: ?*anyopaque,
    dwServiceDataSize: u32,
    pCallerData: ?*anyopaque,
    dwCallerDataSize: u32,
    pContext: ?*anyopaque,
};
type
  MAPPING_PROPERTY_BAG {.bycopy.} = object
    Size: uint
    prgResultRanges: pointer
    dwRangesCount: uint32
    pServiceData: pointer
    dwServiceDataSize: uint32
    pCallerData: pointer
    dwCallerDataSize: uint32
    pContext: pointer
struct MAPPING_PROPERTY_BAG
{
    size_t Size;
    void* prgResultRanges;
    uint dwRangesCount;
    void* pServiceData;
    uint dwServiceDataSize;
    void* pCallerData;
    uint dwCallerDataSize;
    void* pContext;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; MAPPING_PROPERTY_BAG サイズ: 32 バイト(x86)
dim st, 8    ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; Size : UINT_PTR (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; prgResultRanges : MAPPING_DATA_RANGE* (+4, 4byte)  varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; dwRangesCount : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; pServiceData : void* (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; dwServiceDataSize : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; pCallerData : void* (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; dwCallerDataSize : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; pContext : void* (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MAPPING_PROPERTY_BAG サイズ: 64 バイト(x64)
dim st, 16    ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; Size : UINT_PTR (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; prgResultRanges : MAPPING_DATA_RANGE* (+8, 8byte)  varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; dwRangesCount : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; pServiceData : void* (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; dwServiceDataSize : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; pCallerData : void* (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; dwCallerDataSize : DWORD (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; pContext : void* (+56, 8byte)  qpoke st,56,値 / qpeek(st,56)  ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global MAPPING_PROPERTY_BAG
    #field intptr Size
    #field intptr prgResultRanges
    #field int dwRangesCount
    #field intptr pServiceData
    #field int dwServiceDataSize
    #field intptr pCallerData
    #field int dwCallerDataSize
    #field intptr pContext
#endstruct

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