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

STATEMGRSTATUS

構造体
サイズx64: 12 バイト / x86: 12 バイトパッキング1

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

フィールド

フィールドサイズx64x86説明
nStatusWIN32_ERROR4+0+0操作の結果ステータス。WIN32_ERRORで表す。
llSequenceNumberLONGLONG8+4+4操作に関連する復元ポイントのシーケンス番号。LONGLONGで表す。

各言語での定義

#include <windows.h>

// STATEMGRSTATUS  (x64 12 / x86 12 バイト)
#pragma pack(push, 1)
typedef struct STATEMGRSTATUS {
    WIN32_ERROR nStatus;
    LONGLONG llSequenceNumber;
} STATEMGRSTATUS;
#pragma pack(pop)
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct STATEMGRSTATUS
{
    public uint nStatus;
    public long llSequenceNumber;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure STATEMGRSTATUS
    Public nStatus As UInteger
    Public llSequenceNumber As Long
End Structure
import ctypes
from ctypes import wintypes

class STATEMGRSTATUS(ctypes.Structure):
    _pack_ = 1
    _fields_ = [
        ("nStatus", wintypes.DWORD),
        ("llSequenceNumber", ctypes.c_longlong),
    ]
#[repr(C, packed(1))]
pub struct STATEMGRSTATUS {
    pub nStatus: u32,
    pub llSequenceNumber: i64,
}
import "golang.org/x/sys/windows"

type STATEMGRSTATUS struct {
	nStatus uint32
	llSequenceNumber int64
}
type
  STATEMGRSTATUS = packed record
    nStatus: DWORD;
    llSequenceNumber: Int64;
  end;
const STATEMGRSTATUS = extern struct {
    nStatus: u32,
    llSequenceNumber: i64,
};
type
  STATEMGRSTATUS {.packed.} = object
    nStatus: uint32
    llSequenceNumber: int64
align(1)
struct STATEMGRSTATUS
{
    uint nStatus;
    long llSequenceNumber;
}

HSP用 定義

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

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

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