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

MAPPING_ENUM_OPTIONS

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

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

フィールド

フィールドサイズx64x86説明
SizeUINT_PTR8/4+0+0この構造体のバイトサイズ。
pszCategoryLPWSTR8/4+8+4列挙対象を絞り込むカテゴリ文字列。NULL可。
pszInputLanguageLPWSTR8/4+16+8入力言語による絞り込み。NULL可。
pszOutputLanguageLPWSTR8/4+24+12出力言語による絞り込み。NULL可。
pszInputScriptLPWSTR8/4+32+16入力スクリプトによる絞り込み。NULL可。
pszOutputScriptLPWSTR8/4+40+20出力スクリプトによる絞り込み。NULL可。
pszInputContentTypeLPWSTR8/4+48+24入力コンテンツタイプによる絞り込み。NULL可。
pszOutputContentTypeLPWSTR8/4+56+28出力コンテンツタイプによる絞り込み。NULL可。
pGuidGUID*8/4+64+32特定サービスのGUIDによる絞り込み。NULL可。
_bitfieldDWORD4+72+36オンライン/オフラインなどの列挙フラグを格納するビットフィールド。

各言語での定義

#include <windows.h>

// MAPPING_ENUM_OPTIONS  (x64 80 / x86 40 バイト)
typedef struct MAPPING_ENUM_OPTIONS {
    UINT_PTR Size;
    LPWSTR pszCategory;
    LPWSTR pszInputLanguage;
    LPWSTR pszOutputLanguage;
    LPWSTR pszInputScript;
    LPWSTR pszOutputScript;
    LPWSTR pszInputContentType;
    LPWSTR pszOutputContentType;
    GUID* pGuid;
    DWORD _bitfield;
} MAPPING_ENUM_OPTIONS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MAPPING_ENUM_OPTIONS
{
    public UIntPtr Size;
    public IntPtr pszCategory;
    public IntPtr pszInputLanguage;
    public IntPtr pszOutputLanguage;
    public IntPtr pszInputScript;
    public IntPtr pszOutputScript;
    public IntPtr pszInputContentType;
    public IntPtr pszOutputContentType;
    public IntPtr pGuid;
    public uint _bitfield;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MAPPING_ENUM_OPTIONS
    Public Size As UIntPtr
    Public pszCategory As IntPtr
    Public pszInputLanguage As IntPtr
    Public pszOutputLanguage As IntPtr
    Public pszInputScript As IntPtr
    Public pszOutputScript As IntPtr
    Public pszInputContentType As IntPtr
    Public pszOutputContentType As IntPtr
    Public pGuid As IntPtr
    Public _bitfield As UInteger
End Structure
import ctypes
from ctypes import wintypes

class MAPPING_ENUM_OPTIONS(ctypes.Structure):
    _fields_ = [
        ("Size", ctypes.c_size_t),
        ("pszCategory", ctypes.c_void_p),
        ("pszInputLanguage", ctypes.c_void_p),
        ("pszOutputLanguage", ctypes.c_void_p),
        ("pszInputScript", ctypes.c_void_p),
        ("pszOutputScript", ctypes.c_void_p),
        ("pszInputContentType", ctypes.c_void_p),
        ("pszOutputContentType", ctypes.c_void_p),
        ("pGuid", ctypes.c_void_p),
        ("_bitfield", wintypes.DWORD),
    ]
#[repr(C)]
pub struct MAPPING_ENUM_OPTIONS {
    pub Size: usize,
    pub pszCategory: *mut core::ffi::c_void,
    pub pszInputLanguage: *mut core::ffi::c_void,
    pub pszOutputLanguage: *mut core::ffi::c_void,
    pub pszInputScript: *mut core::ffi::c_void,
    pub pszOutputScript: *mut core::ffi::c_void,
    pub pszInputContentType: *mut core::ffi::c_void,
    pub pszOutputContentType: *mut core::ffi::c_void,
    pub pGuid: *mut core::ffi::c_void,
    pub _bitfield: u32,
}
import "golang.org/x/sys/windows"

type MAPPING_ENUM_OPTIONS struct {
	Size uintptr
	pszCategory uintptr
	pszInputLanguage uintptr
	pszOutputLanguage uintptr
	pszInputScript uintptr
	pszOutputScript uintptr
	pszInputContentType uintptr
	pszOutputContentType uintptr
	pGuid uintptr
	_bitfield uint32
}
type
  MAPPING_ENUM_OPTIONS = record
    Size: NativeUInt;
    pszCategory: Pointer;
    pszInputLanguage: Pointer;
    pszOutputLanguage: Pointer;
    pszInputScript: Pointer;
    pszOutputScript: Pointer;
    pszInputContentType: Pointer;
    pszOutputContentType: Pointer;
    pGuid: Pointer;
    _bitfield: DWORD;
  end;
const MAPPING_ENUM_OPTIONS = extern struct {
    Size: usize,
    pszCategory: ?*anyopaque,
    pszInputLanguage: ?*anyopaque,
    pszOutputLanguage: ?*anyopaque,
    pszInputScript: ?*anyopaque,
    pszOutputScript: ?*anyopaque,
    pszInputContentType: ?*anyopaque,
    pszOutputContentType: ?*anyopaque,
    pGuid: ?*anyopaque,
    _bitfield: u32,
};
type
  MAPPING_ENUM_OPTIONS {.bycopy.} = object
    Size: uint
    pszCategory: pointer
    pszInputLanguage: pointer
    pszOutputLanguage: pointer
    pszInputScript: pointer
    pszOutputScript: pointer
    pszInputContentType: pointer
    pszOutputContentType: pointer
    pGuid: pointer
    _bitfield: uint32
struct MAPPING_ENUM_OPTIONS
{
    size_t Size;
    void* pszCategory;
    void* pszInputLanguage;
    void* pszOutputLanguage;
    void* pszInputScript;
    void* pszOutputScript;
    void* pszInputContentType;
    void* pszOutputContentType;
    void* pGuid;
    uint _bitfield;
}

HSP用 定義

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

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

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