ホーム › Storage.Vhd › VIRTUAL_DISK_PROGRESS
VIRTUAL_DISK_PROGRESS
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| OperationStatus | DWORD | 4 | +0 | +0 | 非同期操作の現在のステータスコード(Operation Status)を表す32ビット値である。 |
| CurrentValue | ULONGLONG | 8 | +8 | +8 | 操作の現在の進捗値(Current Value)を表す64ビット値である。 |
| CompletionValue | ULONGLONG | 8 | +16 | +16 | 操作完了時に到達する進捗の最終値(Completion Value)を表す64ビット値である。 |
各言語での定義
#include <windows.h>
// VIRTUAL_DISK_PROGRESS (x64 24 / x86 24 バイト)
typedef struct VIRTUAL_DISK_PROGRESS {
DWORD OperationStatus;
ULONGLONG CurrentValue;
ULONGLONG CompletionValue;
} VIRTUAL_DISK_PROGRESS;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct VIRTUAL_DISK_PROGRESS
{
public uint OperationStatus;
public ulong CurrentValue;
public ulong CompletionValue;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure VIRTUAL_DISK_PROGRESS
Public OperationStatus As UInteger
Public CurrentValue As ULong
Public CompletionValue As ULong
End Structureimport ctypes
from ctypes import wintypes
class VIRTUAL_DISK_PROGRESS(ctypes.Structure):
_fields_ = [
("OperationStatus", wintypes.DWORD),
("CurrentValue", ctypes.c_ulonglong),
("CompletionValue", ctypes.c_ulonglong),
]#[repr(C)]
pub struct VIRTUAL_DISK_PROGRESS {
pub OperationStatus: u32,
pub CurrentValue: u64,
pub CompletionValue: u64,
}import "golang.org/x/sys/windows"
type VIRTUAL_DISK_PROGRESS struct {
OperationStatus uint32
CurrentValue uint64
CompletionValue uint64
}type
VIRTUAL_DISK_PROGRESS = record
OperationStatus: DWORD;
CurrentValue: UInt64;
CompletionValue: UInt64;
end;const VIRTUAL_DISK_PROGRESS = extern struct {
OperationStatus: u32,
CurrentValue: u64,
CompletionValue: u64,
};type
VIRTUAL_DISK_PROGRESS {.bycopy.} = object
OperationStatus: uint32
CurrentValue: uint64
CompletionValue: uint64struct VIRTUAL_DISK_PROGRESS
{
uint OperationStatus;
ulong CurrentValue;
ulong CompletionValue;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; VIRTUAL_DISK_PROGRESS サイズ: 24 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; OperationStatus : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; CurrentValue : ULONGLONG (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; CompletionValue : 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 VIRTUAL_DISK_PROGRESS
#field int OperationStatus
#field int64 CurrentValue
#field int64 CompletionValue
#endstruct
stdim st, VIRTUAL_DISK_PROGRESS ; NSTRUCT 変数を確保
st->OperationStatus = 100
mes "OperationStatus=" + st->OperationStatus