ホーム › Storage.Vss › VSS_VOLUME_PROTECTION_INFO
VSS_VOLUME_PROTECTION_INFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| m_protectionLevel | VSS_PROTECTION_LEVEL | 4 | +0 | +0 | ボリュームの保護レベルを示すVSS_PROTECTION_LEVEL列挙値。 |
| m_volumeIsOfflineForProtection | BOOL | 4 | +4 | +4 | 保護のためボリュームがオフラインか否かを示すBOOL値。 |
| m_protectionFault | VSS_PROTECTION_FAULT | 4 | +8 | +8 | 発生した保護障害を示すVSS_PROTECTION_FAULT列挙値。 |
| m_failureStatus | INT | 4 | +12 | +12 | 障害のステータスコードを示す整数値。 |
| m_volumeHasUnusedDiffArea | BOOL | 4 | +16 | +16 | 未使用の差分領域があるか否かを示すBOOL値。 |
| m_reserved | DWORD | 4 | +20 | +20 | 将来の拡張用に予約された領域。 |
各言語での定義
#include <windows.h>
// VSS_VOLUME_PROTECTION_INFO (x64 24 / x86 24 バイト)
typedef struct VSS_VOLUME_PROTECTION_INFO {
VSS_PROTECTION_LEVEL m_protectionLevel;
BOOL m_volumeIsOfflineForProtection;
VSS_PROTECTION_FAULT m_protectionFault;
INT m_failureStatus;
BOOL m_volumeHasUnusedDiffArea;
DWORD m_reserved;
} VSS_VOLUME_PROTECTION_INFO;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct VSS_VOLUME_PROTECTION_INFO
{
public int m_protectionLevel;
[MarshalAs(UnmanagedType.Bool)] public bool m_volumeIsOfflineForProtection;
public int m_protectionFault;
public int m_failureStatus;
[MarshalAs(UnmanagedType.Bool)] public bool m_volumeHasUnusedDiffArea;
public uint m_reserved;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure VSS_VOLUME_PROTECTION_INFO
Public m_protectionLevel As Integer
<MarshalAs(UnmanagedType.Bool)> Public m_volumeIsOfflineForProtection As Boolean
Public m_protectionFault As Integer
Public m_failureStatus As Integer
<MarshalAs(UnmanagedType.Bool)> Public m_volumeHasUnusedDiffArea As Boolean
Public m_reserved As UInteger
End Structureimport ctypes
from ctypes import wintypes
class VSS_VOLUME_PROTECTION_INFO(ctypes.Structure):
_fields_ = [
("m_protectionLevel", ctypes.c_int),
("m_volumeIsOfflineForProtection", wintypes.BOOL),
("m_protectionFault", ctypes.c_int),
("m_failureStatus", ctypes.c_int),
("m_volumeHasUnusedDiffArea", wintypes.BOOL),
("m_reserved", wintypes.DWORD),
]#[repr(C)]
pub struct VSS_VOLUME_PROTECTION_INFO {
pub m_protectionLevel: i32,
pub m_volumeIsOfflineForProtection: i32,
pub m_protectionFault: i32,
pub m_failureStatus: i32,
pub m_volumeHasUnusedDiffArea: i32,
pub m_reserved: u32,
}import "golang.org/x/sys/windows"
type VSS_VOLUME_PROTECTION_INFO struct {
m_protectionLevel int32
m_volumeIsOfflineForProtection int32
m_protectionFault int32
m_failureStatus int32
m_volumeHasUnusedDiffArea int32
m_reserved uint32
}type
VSS_VOLUME_PROTECTION_INFO = record
m_protectionLevel: Integer;
m_volumeIsOfflineForProtection: BOOL;
m_protectionFault: Integer;
m_failureStatus: Integer;
m_volumeHasUnusedDiffArea: BOOL;
m_reserved: DWORD;
end;const VSS_VOLUME_PROTECTION_INFO = extern struct {
m_protectionLevel: i32,
m_volumeIsOfflineForProtection: i32,
m_protectionFault: i32,
m_failureStatus: i32,
m_volumeHasUnusedDiffArea: i32,
m_reserved: u32,
};type
VSS_VOLUME_PROTECTION_INFO {.bycopy.} = object
m_protectionLevel: int32
m_volumeIsOfflineForProtection: int32
m_protectionFault: int32
m_failureStatus: int32
m_volumeHasUnusedDiffArea: int32
m_reserved: uint32struct VSS_VOLUME_PROTECTION_INFO
{
int m_protectionLevel;
int m_volumeIsOfflineForProtection;
int m_protectionFault;
int m_failureStatus;
int m_volumeHasUnusedDiffArea;
uint m_reserved;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; VSS_VOLUME_PROTECTION_INFO サイズ: 24 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; m_protectionLevel : VSS_PROTECTION_LEVEL (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; m_volumeIsOfflineForProtection : BOOL (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; m_protectionFault : VSS_PROTECTION_FAULT (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; m_failureStatus : INT (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; m_volumeHasUnusedDiffArea : BOOL (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; m_reserved : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global VSS_VOLUME_PROTECTION_INFO
#field int m_protectionLevel
#field bool m_volumeIsOfflineForProtection
#field int m_protectionFault
#field int m_failureStatus
#field bool m_volumeHasUnusedDiffArea
#field int m_reserved
#endstruct
stdim st, VSS_VOLUME_PROTECTION_INFO ; NSTRUCT 変数を確保
st->m_protectionLevel = 100
mes "m_protectionLevel=" + st->m_protectionLevel