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

MAPPING_DATA_RANGE

構造体
サイズx64: 72 バイト / x86: 40 バイト

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

フィールド

フィールドサイズx64x86説明
dwStartIndexDWORD4+0+0認識結果が適用される入力テキストの開始インデックス。
dwEndIndexDWORD4+4+4認識結果が適用される入力テキストの終了インデックス。
pszDescriptionLPWSTR8/4+8+8この範囲の説明文字列。
dwDescriptionLengthDWORD4+16+12説明文字列の文字数。
pDatavoid*8/4+24+16この範囲に関連するデータへのポインタ。
dwDataSizeDWORD4+32+20関連データのバイトサイズ。
pszContentTypeLPWSTR8/4+40+24データのコンテンツタイプ文字列。
prgActionIdsLPWSTR*8/4+48+28実行可能なアクションIDの配列。
dwActionsCountDWORD4+56+32アクションの数。
prgActionDisplayNamesLPWSTR*8/4+64+36アクションの表示名の配列。

各言語での定義

#include <windows.h>

// MAPPING_DATA_RANGE  (x64 72 / x86 40 バイト)
typedef struct MAPPING_DATA_RANGE {
    DWORD dwStartIndex;
    DWORD dwEndIndex;
    LPWSTR pszDescription;
    DWORD dwDescriptionLength;
    void* pData;
    DWORD dwDataSize;
    LPWSTR pszContentType;
    LPWSTR* prgActionIds;
    DWORD dwActionsCount;
    LPWSTR* prgActionDisplayNames;
} MAPPING_DATA_RANGE;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MAPPING_DATA_RANGE
{
    public uint dwStartIndex;
    public uint dwEndIndex;
    public IntPtr pszDescription;
    public uint dwDescriptionLength;
    public IntPtr pData;
    public uint dwDataSize;
    public IntPtr pszContentType;
    public IntPtr prgActionIds;
    public uint dwActionsCount;
    public IntPtr prgActionDisplayNames;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MAPPING_DATA_RANGE
    Public dwStartIndex As UInteger
    Public dwEndIndex As UInteger
    Public pszDescription As IntPtr
    Public dwDescriptionLength As UInteger
    Public pData As IntPtr
    Public dwDataSize As UInteger
    Public pszContentType As IntPtr
    Public prgActionIds As IntPtr
    Public dwActionsCount As UInteger
    Public prgActionDisplayNames As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class MAPPING_DATA_RANGE(ctypes.Structure):
    _fields_ = [
        ("dwStartIndex", wintypes.DWORD),
        ("dwEndIndex", wintypes.DWORD),
        ("pszDescription", ctypes.c_void_p),
        ("dwDescriptionLength", wintypes.DWORD),
        ("pData", ctypes.c_void_p),
        ("dwDataSize", wintypes.DWORD),
        ("pszContentType", ctypes.c_void_p),
        ("prgActionIds", ctypes.c_void_p),
        ("dwActionsCount", wintypes.DWORD),
        ("prgActionDisplayNames", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct MAPPING_DATA_RANGE {
    pub dwStartIndex: u32,
    pub dwEndIndex: u32,
    pub pszDescription: *mut core::ffi::c_void,
    pub dwDescriptionLength: u32,
    pub pData: *mut core::ffi::c_void,
    pub dwDataSize: u32,
    pub pszContentType: *mut core::ffi::c_void,
    pub prgActionIds: *mut core::ffi::c_void,
    pub dwActionsCount: u32,
    pub prgActionDisplayNames: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type MAPPING_DATA_RANGE struct {
	dwStartIndex uint32
	dwEndIndex uint32
	pszDescription uintptr
	dwDescriptionLength uint32
	pData uintptr
	dwDataSize uint32
	pszContentType uintptr
	prgActionIds uintptr
	dwActionsCount uint32
	prgActionDisplayNames uintptr
}
type
  MAPPING_DATA_RANGE = record
    dwStartIndex: DWORD;
    dwEndIndex: DWORD;
    pszDescription: Pointer;
    dwDescriptionLength: DWORD;
    pData: Pointer;
    dwDataSize: DWORD;
    pszContentType: Pointer;
    prgActionIds: Pointer;
    dwActionsCount: DWORD;
    prgActionDisplayNames: Pointer;
  end;
const MAPPING_DATA_RANGE = extern struct {
    dwStartIndex: u32,
    dwEndIndex: u32,
    pszDescription: ?*anyopaque,
    dwDescriptionLength: u32,
    pData: ?*anyopaque,
    dwDataSize: u32,
    pszContentType: ?*anyopaque,
    prgActionIds: ?*anyopaque,
    dwActionsCount: u32,
    prgActionDisplayNames: ?*anyopaque,
};
type
  MAPPING_DATA_RANGE {.bycopy.} = object
    dwStartIndex: uint32
    dwEndIndex: uint32
    pszDescription: pointer
    dwDescriptionLength: uint32
    pData: pointer
    dwDataSize: uint32
    pszContentType: pointer
    prgActionIds: pointer
    dwActionsCount: uint32
    prgActionDisplayNames: pointer
struct MAPPING_DATA_RANGE
{
    uint dwStartIndex;
    uint dwEndIndex;
    void* pszDescription;
    uint dwDescriptionLength;
    void* pData;
    uint dwDataSize;
    void* pszContentType;
    void* prgActionIds;
    uint dwActionsCount;
    void* prgActionDisplayNames;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; MAPPING_DATA_RANGE サイズ: 40 バイト(x86)
dim st, 10    ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; dwStartIndex : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwEndIndex : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; pszDescription : LPWSTR (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; dwDescriptionLength : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; pData : void* (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; dwDataSize : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; pszContentType : LPWSTR (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; prgActionIds : LPWSTR* (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; dwActionsCount : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; prgActionDisplayNames : LPWSTR* (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MAPPING_DATA_RANGE サイズ: 72 バイト(x64)
dim st, 18    ; 4byte整数×18(構造体サイズ 72 / 4 切り上げ)
; dwStartIndex : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwEndIndex : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; pszDescription : LPWSTR (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; dwDescriptionLength : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; pData : void* (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; dwDataSize : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; pszContentType : LPWSTR (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; prgActionIds : LPWSTR* (+48, 8byte)  qpoke st,48,値 / qpeek(st,48)  ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; dwActionsCount : DWORD (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; prgActionDisplayNames : LPWSTR* (+64, 8byte)  qpoke st,64,値 / qpeek(st,64)  ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global MAPPING_DATA_RANGE
    #field int dwStartIndex
    #field int dwEndIndex
    #field intptr pszDescription
    #field int dwDescriptionLength
    #field intptr pData
    #field int dwDataSize
    #field intptr pszContentType
    #field intptr prgActionIds
    #field int dwActionsCount
    #field intptr prgActionDisplayNames
#endstruct

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