Win32 API 日本語リファレンス
ホームSystem.Diagnostics.Debug.Extensions › DEBUG_GET_TEXT_COMPLETIONS_OUT

DEBUG_GET_TEXT_COMPLETIONS_OUT

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

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

フィールド

フィールドサイズx64x86説明
FlagsDWORD4+0+0補完結果に関する状態フラグ(出力)。
ReplaceIndexDWORD4+4+4補完で置換すべき元テキストの開始インデックス。
MatchCountDWORD4+8+8実際に得られた補完候補の件数。
Reserved1DWORD4+12+12予約フィールド。0が設定される。
Reserved2ULONGLONG16+16+16予約フィールド(64ビット)。0が設定される。

各言語での定義

#include <windows.h>

// DEBUG_GET_TEXT_COMPLETIONS_OUT  (x64 32 / x86 32 バイト)
typedef struct DEBUG_GET_TEXT_COMPLETIONS_OUT {
    DWORD Flags;
    DWORD ReplaceIndex;
    DWORD MatchCount;
    DWORD Reserved1;
    ULONGLONG Reserved2[2];
} DEBUG_GET_TEXT_COMPLETIONS_OUT;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DEBUG_GET_TEXT_COMPLETIONS_OUT
{
    public uint Flags;
    public uint ReplaceIndex;
    public uint MatchCount;
    public uint Reserved1;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] public ulong[] Reserved2;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DEBUG_GET_TEXT_COMPLETIONS_OUT
    Public Flags As UInteger
    Public ReplaceIndex As UInteger
    Public MatchCount As UInteger
    Public Reserved1 As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=2)> Public Reserved2() As ULong
End Structure
import ctypes
from ctypes import wintypes

class DEBUG_GET_TEXT_COMPLETIONS_OUT(ctypes.Structure):
    _fields_ = [
        ("Flags", wintypes.DWORD),
        ("ReplaceIndex", wintypes.DWORD),
        ("MatchCount", wintypes.DWORD),
        ("Reserved1", wintypes.DWORD),
        ("Reserved2", ctypes.c_ulonglong * 2),
    ]
#[repr(C)]
pub struct DEBUG_GET_TEXT_COMPLETIONS_OUT {
    pub Flags: u32,
    pub ReplaceIndex: u32,
    pub MatchCount: u32,
    pub Reserved1: u32,
    pub Reserved2: [u64; 2],
}
import "golang.org/x/sys/windows"

type DEBUG_GET_TEXT_COMPLETIONS_OUT struct {
	Flags uint32
	ReplaceIndex uint32
	MatchCount uint32
	Reserved1 uint32
	Reserved2 [2]uint64
}
type
  DEBUG_GET_TEXT_COMPLETIONS_OUT = record
    Flags: DWORD;
    ReplaceIndex: DWORD;
    MatchCount: DWORD;
    Reserved1: DWORD;
    Reserved2: array[0..1] of UInt64;
  end;
const DEBUG_GET_TEXT_COMPLETIONS_OUT = extern struct {
    Flags: u32,
    ReplaceIndex: u32,
    MatchCount: u32,
    Reserved1: u32,
    Reserved2: [2]u64,
};
type
  DEBUG_GET_TEXT_COMPLETIONS_OUT {.bycopy.} = object
    Flags: uint32
    ReplaceIndex: uint32
    MatchCount: uint32
    Reserved1: uint32
    Reserved2: array[2, uint64]
struct DEBUG_GET_TEXT_COMPLETIONS_OUT
{
    uint Flags;
    uint ReplaceIndex;
    uint MatchCount;
    uint Reserved1;
    ulong[2] Reserved2;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DEBUG_GET_TEXT_COMPLETIONS_OUT サイズ: 32 バイト(x64)
dim st, 8    ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; Flags : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; ReplaceIndex : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; MatchCount : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; Reserved1 : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; Reserved2 : ULONGLONG (+16, 16byte)  varptr(st)+16 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DEBUG_GET_TEXT_COMPLETIONS_OUT
    #field int Flags
    #field int ReplaceIndex
    #field int MatchCount
    #field int Reserved1
    #field int64 Reserved2 2
#endstruct

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