ホーム › System.Wmi › MI_Interval
MI_Interval
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| days | DWORD | 4 | +0 | +0 | 経過日数。 |
| hours | DWORD | 4 | +4 | +4 | 時間(0〜23)。 |
| minutes | DWORD | 4 | +8 | +8 | 分(0〜59)。 |
| seconds | DWORD | 4 | +12 | +12 | 秒(0〜59)。 |
| microseconds | DWORD | 4 | +16 | +16 | マイクロ秒(0〜999999)。 |
| __padding1 | DWORD | 4 | +20 | +20 | MI_Timestampとサイズを揃えるためのパディング。 |
| __padding2 | DWORD | 4 | +24 | +24 | サイズ整合用のパディング。 |
| __padding3 | DWORD | 4 | +28 | +28 | サイズ整合用のパディング。 |
各言語での定義
#include <windows.h>
// MI_Interval (x64 32 / x86 32 バイト)
typedef struct MI_Interval {
DWORD days;
DWORD hours;
DWORD minutes;
DWORD seconds;
DWORD microseconds;
DWORD __padding1;
DWORD __padding2;
DWORD __padding3;
} MI_Interval;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MI_Interval
{
public uint days;
public uint hours;
public uint minutes;
public uint seconds;
public uint microseconds;
public uint __padding1;
public uint __padding2;
public uint __padding3;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MI_Interval
Public days As UInteger
Public hours As UInteger
Public minutes As UInteger
Public seconds As UInteger
Public microseconds As UInteger
Public __padding1 As UInteger
Public __padding2 As UInteger
Public __padding3 As UInteger
End Structureimport ctypes
from ctypes import wintypes
class MI_Interval(ctypes.Structure):
_fields_ = [
("days", wintypes.DWORD),
("hours", wintypes.DWORD),
("minutes", wintypes.DWORD),
("seconds", wintypes.DWORD),
("microseconds", wintypes.DWORD),
("__padding1", wintypes.DWORD),
("__padding2", wintypes.DWORD),
("__padding3", wintypes.DWORD),
]#[repr(C)]
pub struct MI_Interval {
pub days: u32,
pub hours: u32,
pub minutes: u32,
pub seconds: u32,
pub microseconds: u32,
pub __padding1: u32,
pub __padding2: u32,
pub __padding3: u32,
}import "golang.org/x/sys/windows"
type MI_Interval struct {
days uint32
hours uint32
minutes uint32
seconds uint32
microseconds uint32
__padding1 uint32
__padding2 uint32
__padding3 uint32
}type
MI_Interval = record
days: DWORD;
hours: DWORD;
minutes: DWORD;
seconds: DWORD;
microseconds: DWORD;
__padding1: DWORD;
__padding2: DWORD;
__padding3: DWORD;
end;const MI_Interval = extern struct {
days: u32,
hours: u32,
minutes: u32,
seconds: u32,
microseconds: u32,
__padding1: u32,
__padding2: u32,
__padding3: u32,
};type
MI_Interval {.bycopy.} = object
days: uint32
hours: uint32
minutes: uint32
seconds: uint32
microseconds: uint32
__padding1: uint32
__padding2: uint32
__padding3: uint32struct MI_Interval
{
uint days;
uint hours;
uint minutes;
uint seconds;
uint microseconds;
uint __padding1;
uint __padding2;
uint __padding3;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MI_Interval サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; days : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; hours : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; minutes : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; seconds : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; microseconds : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; __padding1 : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; __padding2 : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; __padding3 : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global MI_Interval
#field int days
#field int hours
#field int minutes
#field int seconds
#field int microseconds
#field int __padding1
#field int __padding2
#field int __padding3
#endstruct
stdim st, MI_Interval ; NSTRUCT 変数を確保
st->days = 100
mes "days=" + st->days