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

RESUME_PERFORMANCE

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

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

フィールド

フィールドサイズx64x86説明
PostTimeMsDWORD4+0+0POST(電源投入後の自己診断)に要した時間。ミリ秒単位。
TotalResumeTimeMsULONGLONG8+8+8スリープ復帰に要した総時間。ミリ秒単位で表す。
ResumeCompleteTimestampULONGLONG8+16+16復帰完了時のタイムスタンプ値。

各言語での定義

#include <windows.h>

// RESUME_PERFORMANCE  (x64 24 / x86 24 バイト)
typedef struct RESUME_PERFORMANCE {
    DWORD PostTimeMs;
    ULONGLONG TotalResumeTimeMs;
    ULONGLONG ResumeCompleteTimestamp;
} RESUME_PERFORMANCE;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RESUME_PERFORMANCE
{
    public uint PostTimeMs;
    public ulong TotalResumeTimeMs;
    public ulong ResumeCompleteTimestamp;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RESUME_PERFORMANCE
    Public PostTimeMs As UInteger
    Public TotalResumeTimeMs As ULong
    Public ResumeCompleteTimestamp As ULong
End Structure
import ctypes
from ctypes import wintypes

class RESUME_PERFORMANCE(ctypes.Structure):
    _fields_ = [
        ("PostTimeMs", wintypes.DWORD),
        ("TotalResumeTimeMs", ctypes.c_ulonglong),
        ("ResumeCompleteTimestamp", ctypes.c_ulonglong),
    ]
#[repr(C)]
pub struct RESUME_PERFORMANCE {
    pub PostTimeMs: u32,
    pub TotalResumeTimeMs: u64,
    pub ResumeCompleteTimestamp: u64,
}
import "golang.org/x/sys/windows"

type RESUME_PERFORMANCE struct {
	PostTimeMs uint32
	TotalResumeTimeMs uint64
	ResumeCompleteTimestamp uint64
}
type
  RESUME_PERFORMANCE = record
    PostTimeMs: DWORD;
    TotalResumeTimeMs: UInt64;
    ResumeCompleteTimestamp: UInt64;
  end;
const RESUME_PERFORMANCE = extern struct {
    PostTimeMs: u32,
    TotalResumeTimeMs: u64,
    ResumeCompleteTimestamp: u64,
};
type
  RESUME_PERFORMANCE {.bycopy.} = object
    PostTimeMs: uint32
    TotalResumeTimeMs: uint64
    ResumeCompleteTimestamp: uint64
struct RESUME_PERFORMANCE
{
    uint PostTimeMs;
    ulong TotalResumeTimeMs;
    ulong ResumeCompleteTimestamp;
}

HSP用 定義

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

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

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