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 構造体の配列へのポインターです。このメンバーは MappingRecognizeText によって設定されます。
dwRangesCountDWORD4+16+8prgResultRanges で示される配列内の項目数です。このメンバーは MappingRecognizeText によって設定されます。
pServiceDatavoid*8/4+24+12サービス専用のプライベートデータへのポインターです。サービスは、アプリケーションがこのデータを利用できるように、その形式を文書化することができます。また、このデータのメモリはサービスが管理します。このメンバーは MappingRecognizeText によって設定されます。
dwServiceDataSizeDWORD4+32+16pServiceData で指定されるサービス専用のプライベートデータのサイズ (バイト単位)。プライベートデータが無い場合、このサイズは 0 に設定されます。このメンバーは MappingRecognizeText によって設定されます。
pCallerDatavoid*8/4+40+20サービスに渡すアプリケーション専用のプライベートデータへのポインターです。このデータのメモリはアプリケーションが管理します。
dwCallerDataSizeDWORD4+48+24pCallerData で示されるアプリケーション専用のプライベートデータのサイズ (バイト単位)。プライベートデータが無い場合、このメンバーは 0 に設定されます。
pContextvoid*8/4+56+28内部使用のために予約済みです。

公式ドキュメント

MappingRecognizeText によって取得されるテキスト認識データのプロパティを格納します。

解説(Remarks)

プロパティバッグ構造体自体のメモリはアプリケーションが管理します。ELS プラットフォームおよびそのサービスは、プロパティバッグに格納するデータポインターのみを管理します。

出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での定義

#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