Win32 API 日本語リファレンス
ホームSystem.Wmi › WBEM_COMPILE_STATUS_INFO

WBEM_COMPILE_STATUS_INFO

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

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

フィールド

フィールドサイズx64x86説明
lPhaseErrorINT4+0+0エラーが発生したコンパイルフェーズを示す値。
hResHRESULT4+4+4コンパイル結果のHRESULTエラーコード。
ObjectNumINT4+8+8エラーが発生したオブジェクトの番号。
FirstLineINT4+12+12エラー範囲の開始行番号。
LastLineINT4+16+16エラー範囲の終了行番号。
dwOutFlagsDWORD4+20+20出力フラグ群。

各言語での定義

#include <windows.h>

// WBEM_COMPILE_STATUS_INFO  (x64 24 / x86 24 バイト)
typedef struct WBEM_COMPILE_STATUS_INFO {
    INT lPhaseError;
    HRESULT hRes;
    INT ObjectNum;
    INT FirstLine;
    INT LastLine;
    DWORD dwOutFlags;
} WBEM_COMPILE_STATUS_INFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WBEM_COMPILE_STATUS_INFO
{
    public int lPhaseError;
    public int hRes;
    public int ObjectNum;
    public int FirstLine;
    public int LastLine;
    public uint dwOutFlags;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WBEM_COMPILE_STATUS_INFO
    Public lPhaseError As Integer
    Public hRes As Integer
    Public ObjectNum As Integer
    Public FirstLine As Integer
    Public LastLine As Integer
    Public dwOutFlags As UInteger
End Structure
import ctypes
from ctypes import wintypes

class WBEM_COMPILE_STATUS_INFO(ctypes.Structure):
    _fields_ = [
        ("lPhaseError", ctypes.c_int),
        ("hRes", ctypes.c_int),
        ("ObjectNum", ctypes.c_int),
        ("FirstLine", ctypes.c_int),
        ("LastLine", ctypes.c_int),
        ("dwOutFlags", wintypes.DWORD),
    ]
#[repr(C)]
pub struct WBEM_COMPILE_STATUS_INFO {
    pub lPhaseError: i32,
    pub hRes: i32,
    pub ObjectNum: i32,
    pub FirstLine: i32,
    pub LastLine: i32,
    pub dwOutFlags: u32,
}
import "golang.org/x/sys/windows"

type WBEM_COMPILE_STATUS_INFO struct {
	lPhaseError int32
	hRes int32
	ObjectNum int32
	FirstLine int32
	LastLine int32
	dwOutFlags uint32
}
type
  WBEM_COMPILE_STATUS_INFO = record
    lPhaseError: Integer;
    hRes: Integer;
    ObjectNum: Integer;
    FirstLine: Integer;
    LastLine: Integer;
    dwOutFlags: DWORD;
  end;
const WBEM_COMPILE_STATUS_INFO = extern struct {
    lPhaseError: i32,
    hRes: i32,
    ObjectNum: i32,
    FirstLine: i32,
    LastLine: i32,
    dwOutFlags: u32,
};
type
  WBEM_COMPILE_STATUS_INFO {.bycopy.} = object
    lPhaseError: int32
    hRes: int32
    ObjectNum: int32
    FirstLine: int32
    LastLine: int32
    dwOutFlags: uint32
struct WBEM_COMPILE_STATUS_INFO
{
    int lPhaseError;
    int hRes;
    int ObjectNum;
    int FirstLine;
    int LastLine;
    uint dwOutFlags;
}

HSP用 定義

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

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

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