ホーム › System.Power › ACPI_TIME_AND_ALARM_CAPABILITIES
ACPI_TIME_AND_ALARM_CAPABILITIES
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| AcWakeSupported | BOOLEAN | 1 | +0 | +0 | AC電源時のウェイクアラームをサポートするかを示すブール値。 |
| DcWakeSupported | BOOLEAN | 1 | +1 | +1 | DC(バッテリ)電源時のウェイクアラームをサポートするかを示す。 |
| S4AcWakeSupported | BOOLEAN | 1 | +2 | +2 | S4状態かつAC電源からのウェイクをサポートするかを示す。 |
| S4DcWakeSupported | BOOLEAN | 1 | +3 | +3 | S4状態かつDC電源からのウェイクをサポートするかを示す。 |
| S5AcWakeSupported | BOOLEAN | 1 | +4 | +4 | S5状態かつAC電源からのウェイクをサポートするかを示す。 |
| S5DcWakeSupported | BOOLEAN | 1 | +5 | +5 | S5状態かつDC電源からのウェイクをサポートするかを示す。 |
| S4S5WakeStatusSupported | BOOLEAN | 1 | +6 | +6 | S4/S5からのウェイク状態取得をサポートするかを示す。 |
| DeepestWakeSystemState | DWORD | 4 | +8 | +8 | ウェイク可能な最も深いシステム電源状態を示す。 |
| RealTimeFeaturesSupported | BOOLEAN | 1 | +12 | +12 | リアルタイムクロック機能をサポートするかを示すブール値。 |
| RealTimeResolution | ACPI_TIME_RESOLUTION | 4 | +16 | +16 | リアルタイムクロックの分解能を示す列挙値。 |
各言語での定義
#include <windows.h>
// ACPI_TIME_AND_ALARM_CAPABILITIES (x64 20 / x86 20 バイト)
typedef struct ACPI_TIME_AND_ALARM_CAPABILITIES {
BOOLEAN AcWakeSupported;
BOOLEAN DcWakeSupported;
BOOLEAN S4AcWakeSupported;
BOOLEAN S4DcWakeSupported;
BOOLEAN S5AcWakeSupported;
BOOLEAN S5DcWakeSupported;
BOOLEAN S4S5WakeStatusSupported;
DWORD DeepestWakeSystemState;
BOOLEAN RealTimeFeaturesSupported;
ACPI_TIME_RESOLUTION RealTimeResolution;
} ACPI_TIME_AND_ALARM_CAPABILITIES;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct ACPI_TIME_AND_ALARM_CAPABILITIES
{
[MarshalAs(UnmanagedType.U1)] public bool AcWakeSupported;
[MarshalAs(UnmanagedType.U1)] public bool DcWakeSupported;
[MarshalAs(UnmanagedType.U1)] public bool S4AcWakeSupported;
[MarshalAs(UnmanagedType.U1)] public bool S4DcWakeSupported;
[MarshalAs(UnmanagedType.U1)] public bool S5AcWakeSupported;
[MarshalAs(UnmanagedType.U1)] public bool S5DcWakeSupported;
[MarshalAs(UnmanagedType.U1)] public bool S4S5WakeStatusSupported;
public uint DeepestWakeSystemState;
[MarshalAs(UnmanagedType.U1)] public bool RealTimeFeaturesSupported;
public int RealTimeResolution;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure ACPI_TIME_AND_ALARM_CAPABILITIES
<MarshalAs(UnmanagedType.U1)> Public AcWakeSupported As Boolean
<MarshalAs(UnmanagedType.U1)> Public DcWakeSupported As Boolean
<MarshalAs(UnmanagedType.U1)> Public S4AcWakeSupported As Boolean
<MarshalAs(UnmanagedType.U1)> Public S4DcWakeSupported As Boolean
<MarshalAs(UnmanagedType.U1)> Public S5AcWakeSupported As Boolean
<MarshalAs(UnmanagedType.U1)> Public S5DcWakeSupported As Boolean
<MarshalAs(UnmanagedType.U1)> Public S4S5WakeStatusSupported As Boolean
Public DeepestWakeSystemState As UInteger
<MarshalAs(UnmanagedType.U1)> Public RealTimeFeaturesSupported As Boolean
Public RealTimeResolution As Integer
End Structureimport ctypes
from ctypes import wintypes
class ACPI_TIME_AND_ALARM_CAPABILITIES(ctypes.Structure):
_fields_ = [
("AcWakeSupported", ctypes.c_byte),
("DcWakeSupported", ctypes.c_byte),
("S4AcWakeSupported", ctypes.c_byte),
("S4DcWakeSupported", ctypes.c_byte),
("S5AcWakeSupported", ctypes.c_byte),
("S5DcWakeSupported", ctypes.c_byte),
("S4S5WakeStatusSupported", ctypes.c_byte),
("DeepestWakeSystemState", wintypes.DWORD),
("RealTimeFeaturesSupported", ctypes.c_byte),
("RealTimeResolution", ctypes.c_int),
]#[repr(C)]
pub struct ACPI_TIME_AND_ALARM_CAPABILITIES {
pub AcWakeSupported: u8,
pub DcWakeSupported: u8,
pub S4AcWakeSupported: u8,
pub S4DcWakeSupported: u8,
pub S5AcWakeSupported: u8,
pub S5DcWakeSupported: u8,
pub S4S5WakeStatusSupported: u8,
pub DeepestWakeSystemState: u32,
pub RealTimeFeaturesSupported: u8,
pub RealTimeResolution: i32,
}import "golang.org/x/sys/windows"
type ACPI_TIME_AND_ALARM_CAPABILITIES struct {
AcWakeSupported byte
DcWakeSupported byte
S4AcWakeSupported byte
S4DcWakeSupported byte
S5AcWakeSupported byte
S5DcWakeSupported byte
S4S5WakeStatusSupported byte
DeepestWakeSystemState uint32
RealTimeFeaturesSupported byte
RealTimeResolution int32
}type
ACPI_TIME_AND_ALARM_CAPABILITIES = record
AcWakeSupported: ByteBool;
DcWakeSupported: ByteBool;
S4AcWakeSupported: ByteBool;
S4DcWakeSupported: ByteBool;
S5AcWakeSupported: ByteBool;
S5DcWakeSupported: ByteBool;
S4S5WakeStatusSupported: ByteBool;
DeepestWakeSystemState: DWORD;
RealTimeFeaturesSupported: ByteBool;
RealTimeResolution: Integer;
end;const ACPI_TIME_AND_ALARM_CAPABILITIES = extern struct {
AcWakeSupported: u8,
DcWakeSupported: u8,
S4AcWakeSupported: u8,
S4DcWakeSupported: u8,
S5AcWakeSupported: u8,
S5DcWakeSupported: u8,
S4S5WakeStatusSupported: u8,
DeepestWakeSystemState: u32,
RealTimeFeaturesSupported: u8,
RealTimeResolution: i32,
};type
ACPI_TIME_AND_ALARM_CAPABILITIES {.bycopy.} = object
AcWakeSupported: uint8
DcWakeSupported: uint8
S4AcWakeSupported: uint8
S4DcWakeSupported: uint8
S5AcWakeSupported: uint8
S5DcWakeSupported: uint8
S4S5WakeStatusSupported: uint8
DeepestWakeSystemState: uint32
RealTimeFeaturesSupported: uint8
RealTimeResolution: int32struct ACPI_TIME_AND_ALARM_CAPABILITIES
{
ubyte AcWakeSupported;
ubyte DcWakeSupported;
ubyte S4AcWakeSupported;
ubyte S4DcWakeSupported;
ubyte S5AcWakeSupported;
ubyte S5DcWakeSupported;
ubyte S4S5WakeStatusSupported;
uint DeepestWakeSystemState;
ubyte RealTimeFeaturesSupported;
int RealTimeResolution;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; ACPI_TIME_AND_ALARM_CAPABILITIES サイズ: 20 バイト(x64)
dim st, 5 ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; AcWakeSupported : BOOLEAN (+0, 1byte) poke st,0,値 / 値 = peek(st,0)
; DcWakeSupported : BOOLEAN (+1, 1byte) poke st,1,値 / 値 = peek(st,1)
; S4AcWakeSupported : BOOLEAN (+2, 1byte) poke st,2,値 / 値 = peek(st,2)
; S4DcWakeSupported : BOOLEAN (+3, 1byte) poke st,3,値 / 値 = peek(st,3)
; S5AcWakeSupported : BOOLEAN (+4, 1byte) poke st,4,値 / 値 = peek(st,4)
; S5DcWakeSupported : BOOLEAN (+5, 1byte) poke st,5,値 / 値 = peek(st,5)
; S4S5WakeStatusSupported : BOOLEAN (+6, 1byte) poke st,6,値 / 値 = peek(st,6)
; DeepestWakeSystemState : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; RealTimeFeaturesSupported : BOOLEAN (+12, 1byte) poke st,12,値 / 値 = peek(st,12)
; RealTimeResolution : ACPI_TIME_RESOLUTION (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global ACPI_TIME_AND_ALARM_CAPABILITIES
#field bool1 AcWakeSupported
#field bool1 DcWakeSupported
#field bool1 S4AcWakeSupported
#field bool1 S4DcWakeSupported
#field bool1 S5AcWakeSupported
#field bool1 S5DcWakeSupported
#field bool1 S4S5WakeStatusSupported
#field int DeepestWakeSystemState
#field bool1 RealTimeFeaturesSupported
#field int RealTimeResolution
#endstruct
stdim st, ACPI_TIME_AND_ALARM_CAPABILITIES ; NSTRUCT 変数を確保
st->AcWakeSupported = 100
mes "AcWakeSupported=" + st->AcWakeSupported