' ########################################################################################
' Microsoft Windows
' File: vss.inc
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_vss_PBI)
#DEFINE PBX_vss_PBI
%EQUATE `VSS_INC = 1
' /* header files for imported files */
#INCLUDE ONCE "Legacy/COM/OAIdl.inc"
#INCLUDE ONCE "Legacy/COM/OCIdl.inc"
'#pragma pack(push, 8)
#INCLUDE ONCE "Legacy/System/vsserror.inc"
' ========================================================================================
' enum VSS_OBJECT_TYPE
' ========================================================================================
%EQUATE `VSS_OBJECT_UNKNOWN = 0
%EQUATE `VSS_OBJECT_NONE = %VSS_OBJECT_UNKNOWN + 1
%EQUATE `VSS_OBJECT_SNAPSHOT_SET = %VSS_OBJECT_NONE + 1
%EQUATE `VSS_OBJECT_SNAPSHOT = %VSS_OBJECT_SNAPSHOT_SET + 1
%EQUATE `VSS_OBJECT_PROVIDER = %VSS_OBJECT_SNAPSHOT + 1
%EQUATE `VSS_OBJECT_TYPE_COUNT = %VSS_OBJECT_PROVIDER + 1
' ========================================================================================
' enum VSS_SNAPSHOT_STATE
' ========================================================================================
%EQUATE `VSS_SS_UNKNOWN = 0
%EQUATE `VSS_SS_PREPARING = %VSS_SS_UNKNOWN + 1
%EQUATE `VSS_SS_PROCESSING_PREPARE = %VSS_SS_PREPARING + 1
%EQUATE `VSS_SS_PREPARED = %VSS_SS_PROCESSING_PREPARE + 1
%EQUATE `VSS_SS_PROCESSING_PRECOMMIT = %VSS_SS_PREPARED + 1
%EQUATE `VSS_SS_PRECOMMITTED = %VSS_SS_PROCESSING_PRECOMMIT + 1
%EQUATE `VSS_SS_PROCESSING_COMMIT = %VSS_SS_PRECOMMITTED + 1
%EQUATE `VSS_SS_COMMITTED = %VSS_SS_PROCESSING_COMMIT + 1
%EQUATE `VSS_SS_PROCESSING_POSTCOMMIT = %VSS_SS_COMMITTED + 1
%EQUATE `VSS_SS_PROCESSING_PREFINALCOMMIT = %VSS_SS_PROCESSING_POSTCOMMIT + 1
%EQUATE `VSS_SS_PREFINALCOMMITTED = %VSS_SS_PROCESSING_PREFINALCOMMIT + 1
%EQUATE `VSS_SS_PROCESSING_POSTFINALCOMMIT = %VSS_SS_PREFINALCOMMITTED + 1
%EQUATE `VSS_SS_CREATED = %VSS_SS_PROCESSING_POSTFINALCOMMIT + 1
%EQUATE `VSS_SS_ABORTED = %VSS_SS_CREATED + 1
%EQUATE `VSS_SS_DELETED = %VSS_SS_ABORTED + 1
%EQUATE `VSS_SS_POSTCOMMITTED = %VSS_SS_DELETED + 1
%EQUATE `VSS_SS_COUNT = %VSS_SS_POSTCOMMITTED + 1
' ========================================================================================
' enum VSS_VOLUME_SNAPSHOT_ATTRIBUTES
' ========================================================================================
%EQUATE `VSS_VOLSNAP_ATTR_PERSISTENT = &H1
%EQUATE `VSS_VOLSNAP_ATTR_NO_AUTORECOVERY = &H2
%EQUATE `VSS_VOLSNAP_ATTR_CLIENT_ACCESSIBLE = &H4
%EQUATE `VSS_VOLSNAP_ATTR_NO_AUTO_RELEASE = &H8
%EQUATE `VSS_VOLSNAP_ATTR_NO_WRITERS = &H10
%EQUATE `VSS_VOLSNAP_ATTR_TRANSPORTABLE = &H20
%EQUATE `VSS_VOLSNAP_ATTR_NOT_SURFACED = &H40
%EQUATE `VSS_VOLSNAP_ATTR_NOT_TRANSACTED = &H80
%EQUATE `VSS_VOLSNAP_ATTR_HARDWARE_ASSISTED = &H10000
%EQUATE `VSS_VOLSNAP_ATTR_DIFFERENTIAL = &H20000
%EQUATE `VSS_VOLSNAP_ATTR_PLEX = &H40000
%EQUATE `VSS_VOLSNAP_ATTR_IMPORTED = &H80000
%EQUATE `VSS_VOLSNAP_ATTR_EXPOSED_LOCALLY = &H100000
%EQUATE `VSS_VOLSNAP_ATTR_EXPOSED_REMOTELY = &H200000
%EQUATE `VSS_VOLSNAP_ATTR_AUTORECOVER = &H400000
%EQUATE `VSS_VOLSNAP_ATTR_ROLLBACK_RECOVERY = &H800000
%EQUATE `VSS_VOLSNAP_ATTR_DELAYED_POSTSNAPSHOT = &H1000000
%EQUATE `VSS_VOLSNAP_ATTR_TXF_RECOVERY = &H2000000
' ========================================================================================
' enum VSS_SNAPSHOT_CONTEXT
' ========================================================================================
%EQUATE `VSS_CTX_BACKUP = 0
%EQUATE `VSS_CTX_FILE_SHARE_BACKUP = %VSS_VOLSNAP_ATTR_NO_WRITERS
%EQUATE `VSS_CTX_NAS_ROLLBACK = (%VSS_VOLSNAP_ATTR_PERSISTENT OR %VSS_VOLSNAP_ATTR_NO_AUTO_RELEASE) OR %VSS_VOLSNAP_ATTR_NO_WRITERS
%EQUATE `VSS_CTX_APP_ROLLBACK = %VSS_VOLSNAP_ATTR_PERSISTENT OR %VSS_VOLSNAP_ATTR_NO_AUTO_RELEASE
%EQUATE `VSS_CTX_CLIENT_ACCESSIBLE = ((%VSS_VOLSNAP_ATTR_PERSISTENT OR %VSS_VOLSNAP_ATTR_CLIENT_ACCESSIBLE) OR %VSS_VOLSNAP_ATTR_NO_AUTO_RELEASE) OR %VSS_VOLSNAP_ATTR_NO_WRITERS
%EQUATE `VSS_CTX_CLIENT_ACCESSIBLE_WRITERS = (%VSS_VOLSNAP_ATTR_PERSISTENT OR %VSS_VOLSNAP_ATTR_CLIENT_ACCESSIBLE) OR %VSS_VOLSNAP_ATTR_NO_AUTO_RELEASE
%EQUATE `VSS_CTX_ALL = &Hffffffff
' ========================================================================================
' enum VSS_PROVIDER_CAPABILITIES
' ========================================================================================
%EQUATE `VSS_PRV_CAPABILITY_LEGACY = &H1
%EQUATE `VSS_PRV_CAPABILITY_COMPLIANT = &H2
%EQUATE `VSS_PRV_CAPABILITY_LUN_REPOINT = &H4
%EQUATE `VSS_PRV_CAPABILITY_LUN_RESYNC = &H8
%EQUATE `VSS_PRV_CAPABILITY_OFFLINE_CREATION = &H10
%EQUATE `VSS_PRV_CAPABILITY_MULTIPLE_IMPORT = &H20
%EQUATE `VSS_PRV_CAPABILITY_RECYCLING = &H40
%EQUATE `VSS_PRV_CAPABILITY_PLEX = &H80
%EQUATE `VSS_PRV_CAPABILITY_DIFFERENTIAL = &H100
%EQUATE `VSS_PRV_CAPABILITY_CLUSTERED = &H200
' ========================================================================================
' enum VSS_FASTRECOVERY_OPTIONS
' Note: Removed from the SDK for Windows Server 2008
' ========================================================================================
%EQUATE `VSS_BREAK_FLAG_MASK_LUNS = &H1
%EQUATE `VSS_BREAK_FLAG_MAKE_READ_WRITE = &H2
%EQUATE `VSS_FAST_RECOVERY_LUN_REPOINT = &H4
%EQUATE `VSS_FAST_RECOVERY_LUN_RESYNC = &H8
' ========================================================================================
' enum VSS_HARDWARE_OPTIONS
' ========================================================================================
%EQUATE `VSS_BREAKEX_FLAG_MASK_LUNS = &H1
%EQUATE `VSS_BREAKEX_FLAG_MAKE_READ_WRITE = &H2
%EQUATE `VSS_BREAKEX_FLAG_REVERT_IDENTITY_ALL = &H4
%EQUATE `VSS_BREAKEX_FLAG_REVERT_IDENTITY_NONE = &H8
%EQUATE `VSS_ONLUNSTATECHANGE_NOTIFY_READ_WRITE = &H100
%EQUATE `VSS_ONLUNSTATECHANGE_NOTIFY_LUN_PRE_RECOVERY = &H200
%EQUATE `VSS_ONLUNSTATECHANGE_NOTIFY_LUN_POST_RECOVERY = &H400
%EQUATE `VSS_ONLUNSTATECHANGE_DO_MASK_LUNS = &H800
' ========================================================================================
' enum VSS_RECOVERY_OPTIONS
' ========================================================================================
%EQUATE `VSS_RECOVERY_REVERT_IDENTITY_ALL = &H100
%EQUATE `VSS_RECOVERY_NO_VOLUME_CHECK = &H200
' ========================================================================================
' enum VSS_WRITER_STATE
' ========================================================================================
%EQUATE `VSS_WS_UNKNOWN = 0
%EQUATE `VSS_WS_STABLE = %VSS_WS_UNKNOWN + 1
%EQUATE `VSS_WS_WAITING_FOR_FREEZE = %VSS_WS_STABLE + 1
%EQUATE `VSS_WS_WAITING_FOR_THAW = %VSS_WS_WAITING_FOR_FREEZE + 1
%EQUATE `VSS_WS_WAITING_FOR_POST_SNAPSHOT = %VSS_WS_WAITING_FOR_THAW + 1
%EQUATE `VSS_WS_WAITING_FOR_BACKUP_COMPLETE = %VSS_WS_WAITING_FOR_POST_SNAPSHOT + 1
%EQUATE `VSS_WS_FAILED_AT_IDENTIFY = %VSS_WS_WAITING_FOR_BACKUP_COMPLETE + 1
%EQUATE `VSS_WS_FAILED_AT_PREPARE_BACKUP = %VSS_WS_FAILED_AT_IDENTIFY + 1
%EQUATE `VSS_WS_FAILED_AT_PREPARE_SNAPSHOT = %VSS_WS_FAILED_AT_PREPARE_BACKUP + 1
%EQUATE `VSS_WS_FAILED_AT_FREEZE = %VSS_WS_FAILED_AT_PREPARE_SNAPSHOT + 1
%EQUATE `VSS_WS_FAILED_AT_THAW = %VSS_WS_FAILED_AT_FREEZE + 1
%EQUATE `VSS_WS_FAILED_AT_POST_SNAPSHOT = %VSS_WS_FAILED_AT_THAW + 1
%EQUATE `VSS_WS_FAILED_AT_BACKUP_COMPLETE = %VSS_WS_FAILED_AT_POST_SNAPSHOT + 1
%EQUATE `VSS_WS_FAILED_AT_PRE_RESTORE = %VSS_WS_FAILED_AT_BACKUP_COMPLETE + 1
%EQUATE `VSS_WS_FAILED_AT_POST_RESTORE = %VSS_WS_FAILED_AT_PRE_RESTORE + 1
%EQUATE `VSS_WS_FAILED_AT_BACKUPSHUTDOWN = %VSS_WS_FAILED_AT_POST_RESTORE + 1
%EQUATE `VSS_WS_COUNT = %VSS_WS_FAILED_AT_BACKUPSHUTDOWN + 1
' ========================================================================================
' enum VSS_BACKUP_TYPE
' ========================================================================================
%EQUATE `VSS_BT_UNDEFINED = 0
%EQUATE `VSS_BT_FULL = %VSS_BT_UNDEFINED + 1
%EQUATE `VSS_BT_INCREMENTAL = %VSS_BT_FULL + 1
%EQUATE `VSS_BT_DIFFERENTIAL = %VSS_BT_INCREMENTAL + 1
%EQUATE `VSS_BT_LOG = %VSS_BT_DIFFERENTIAL + 1
%EQUATE `VSS_BT_COPY = %VSS_BT_LOG + 1
%EQUATE `VSS_BT_OTHER = %VSS_BT_COPY + 1
' ========================================================================================
' enum VSS_RESTORE_TYPE
' ========================================================================================
%EQUATE `VSS_RTYPE_UNDEFINED = 0
%EQUATE `VSS_RTYPE_BY_COPY = %VSS_RTYPE_UNDEFINED + 1
%EQUATE `VSS_RTYPE_IMPORT = %VSS_RTYPE_BY_COPY + 1
%EQUATE `VSS_RTYPE_OTHER = %VSS_RTYPE_IMPORT + 1
' ========================================================================================
' enum VSS_ROLLFORWARD_TYPE
' ========================================================================================
%EQUATE `VSS_RF_UNDEFINED = 0
%EQUATE `VSS_RF_NONE = %VSS_RF_UNDEFINED + 1
%EQUATE `VSS_RF_ALL = %VSS_RF_NONE + 1
%EQUATE `VSS_RF_PARTIAL = %VSS_RF_ALL + 1
' ========================================================================================
' enum VSS_PROVIDER_TYPE
' ========================================================================================
%EQUATE `VSS_PROV_UNKNOWN = 0
%EQUATE `VSS_PROV_SYSTEM = 1
%EQUATE `VSS_PROV_SOFTWARE = 2
%EQUATE `VSS_PROV_HARDWARE = 3
' ========================================================================================
' enum VSS_APPLICATION_LEVEL
' ========================================================================================
%EQUATE `VSS_APP_UNKNOWN = 0
%EQUATE `VSS_APP_SYSTEM = 1
%EQUATE `VSS_APP_BACK_END = 2
%EQUATE `VSS_APP_FRONT_END = 3
%EQUATE `VSS_APP_SYSTEM_RM = 4
%EQUATE `VSS_APP_AUTO = -1
' ========================================================================================
' enum _VSS_SNAPSHOT_COMPATIBILITY
' ========================================================================================
%EQUATE `VSS_SC_DISABLE_DEFRAG = &H1
%EQUATE `VSS_SC_DISABLE_CONTENTINDEX = &H2
' ========================================================================================
' enum VSS_SNAPSHOT_PROPERTY_ID
' ========================================================================================
%EQUATE `VSS_SPROPID_UNKNOWN = 0
%EQUATE `VSS_SPROPID_SNAPSHOT_ID = &H1
%EQUATE `VSS_SPROPID_SNAPSHOT_SET_ID = &H2
%EQUATE `VSS_SPROPID_SNAPSHOTS_COUNT = &H3
%EQUATE `VSS_SPROPID_SNAPSHOT_DEVICE = &H4
%EQUATE `VSS_SPROPID_ORIGINAL_VOLUME = &H5
%EQUATE `VSS_SPROPID_ORIGINATING_MACHINE = &H6
%EQUATE `VSS_SPROPID_SERVICE_MACHINE = &H7
%EQUATE `VSS_SPROPID_EXPOSED_NAME = &H8
%EQUATE `VSS_SPROPID_EXPOSED_PATH = &H9
%EQUATE `VSS_SPROPID_PROVIDER_ID = &Ha
%EQUATE `VSS_SPROPID_SNAPSHOT_ATTRIBUTES = &Hb
%EQUATE `VSS_SPROPID_CREATION_TIMESTAMP = &Hc
%EQUATE `VSS_SPROPID_STATUS = &Hd
' ========================================================================================
' enum VSS_FILE_SPEC_BACKUP_TYPE
' ========================================================================================
%EQUATE `VSS_FSBT_FULL_BACKUP_REQUIRED = &H1
%EQUATE `VSS_FSBT_DIFFERENTIAL_BACKUP_REQUIRED = &H2
%EQUATE `VSS_FSBT_INCREMENTAL_BACKUP_REQUIRED = &H4
%EQUATE `VSS_FSBT_LOG_BACKUP_REQUIRED = &H8
%EQUATE `VSS_FSBT_FULL_SNAPSHOT_REQUIRED = &H100
%EQUATE `VSS_FSBT_DIFFERENTIAL_SNAPSHOT_REQUIRED = &H200
%EQUATE `VSS_FSBT_INCREMENTAL_SNAPSHOT_REQUIRED = &H400
%EQUATE `VSS_FSBT_LOG_SNAPSHOT_REQUIRED = &H800
%EQUATE `VSS_FSBT_ALL_BACKUP_REQUIRED = &Hf
%EQUATE `VSS_FSBT_ALL_SNAPSHOT_REQUIRED = &Hf00
' ========================================================================================
' enum VSS_BACKUP_SCHEMA
' ========================================================================================
%EQUATE `VSS_BS_UNDEFINED = 0
%EQUATE `VSS_BS_DIFFERENTIAL = &H1
%EQUATE `VSS_BS_INCREMENTAL = &H2
%EQUATE `VSS_BS_EXCLUSIVE_INCREMENTAL_DIFFERENTIAL = &H4
%EQUATE `VSS_BS_LOG = &H8
%EQUATE `VSS_BS_COPY = &H10
%EQUATE `VSS_BS_TIMESTAMPED = &H20
%EQUATE `VSS_BS_LAST_MODIFY = &H40
%EQUATE `VSS_BS_LSN = &H80
%EQUATE `VSS_BS_WRITER_SUPPORTS_NEW_TARGET = &H100
%EQUATE `VSS_BS_WRITER_SUPPORTS_RESTORE_WITH_MOVE = &H200
%EQUATE `VSS_BS_INDEPENDENT_SYSTEM_STATE = &H400
%EQUATE `VSS_BS_ROLLFORWARD_RESTORE = &H1000
%EQUATE `VSS_BS_RESTORE_RENAME = &H2000
%EQUATE `VSS_BS_AUTHORITATIVE_RESTORE = &H4000
%EQUATE `VSS_BS_WRITER_SUPPORTS_PARALLEL_RESTORES = &H8000
'typedef GUID VSS_ID;
'typedef /* [string][unique] */ __RPC_unique_pointer __RPC_string WCHAR *VSS_PWSZ;
'typedef LONGLONG VSS_TIMESTAMP;
' ========================================================================================
' VSS_SNAPSHOT_PROP structure
' ========================================================================================
' // Size = 96 bytes
TYPE VSS_SNAPSHOT_PROP ' Must be 8 byte aligned
 m_SnapshotId AS GUID ' VSS_ID
 m_SnapshotSetId AS GUID ' VSS_ID
 m_lSnapshotsCount AS LONG
 m_pwszSnapshotDeviceObject AS WSTRINGZ PTR ' VSS_PWSZ
 m_pwszOriginalVolumeName AS WSTRINGZ PTR ' VSS_PWSZ
 m_pwszOriginatingMachine AS WSTRINGZ PTR ' VSS_PWSZ
 m_pwszServiceMachine AS WSTRINGZ PTR ' VSS_PWSZ
 m_pwszExposedName AS WSTRINGZ PTR ' VSS_PWSZ
 m_pwszExposedPath AS WSTRINGZ PTR ' VSS_PWSZ
 m_ProviderId AS GUID ' VSS_ID
 m_lSnapshotAttributes AS LONG
 m_tsCreationTimestamp AS QUAD ' VSS_TIMESTAMP
 m_eStatus AS LONG ' VSS_SNAPSHOT_STATE
 alignment__ AS DWORD ' // To keep 8 byte alignment
END TYPE
' ========================================================================================
' VSS_PROVIDER_PROP structure
' ========================================================================================
' // Size = 60 bytes
TYPE VSS_PROVIDER_PROP DWORD
 m_ProviderId AS GUID ' VSS_ID
 m_pwszProviderName AS WSTRINGZ PTR ' VSS_PWSZ
 m_eProviderType AS LONG ' VSS_PROVIDER_TYPE
 m_pwszProviderVersion AS WSTRINGZ PTR ' VSS_PWSZ
 m_ProviderVersionId AS GUID ' VSS_ID
 m_ClassId AS GUID ' CLSID
END TYPE
' ========================================================================================
' VSS_OBJECT_UNION union
' ========================================================================================
' // Size = 96 bytes
UNION VSS_OBJECT_UNION ' Must be 8 byte aligned
 Snap AS VSS_SNAPSHOT_PROP
 Prov AS VSS_SNAPSHOT_PROP
END UNION
' ========================================================================================
' VSS_OBJECT_PROP structure
' ========================================================================================
' // Size = 104 bytes
TYPE VSS_OBJECT_PROP ' Must be 8 byte aligned
 Type AS LONG ' VSS_OBJECT_TYPE
 alignment_ AS DWORD
 Obj AS VSS_OBJECT_UNION
END TYPE
' ########################################################################################
' Interface name = IVssEnumObject
' IID = {AE1C7110-2F60-11D3-8A39-00C04F72D8E3}
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IVssEnumObject_INTERFACE_DEFINED)
 %IVssEnumObject_INTERFACE_DEFINED = 1
$IID_IVssEnumObject = GUID$("{AE1C7110-2F60-11D3-8A39-00C04F72D8E3}")
INTERFACE IVssEnumObject $IID_IVssEnumObject
 INHERIT IUnknown
 ' =====================================================================================
 METHOD Next ( ' VTable offset = 12
 BYVAL celt AS DWORD
 , BYREF rgelt AS VSS_OBJECT_PROP
 , BYREF pceltFetched AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD Skip ( ' VTable offset = 16
 BYVAL celt AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD Reset ( ' VTable offset = 20
 ) AS LONG
 ' =====================================================================================
 METHOD Clone ( ' VTable offset = 24
 BYREF ppenum AS IVssEnumObject
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IVssEnumObject_INTERFACE_DEFINED__ */
' ########################################################################################
' Interface name = IVssAsync
' IID = {C7B98A22-222D-4E62-B875-1A44980634AF}
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IVssAsync_INTERFACE_DEFINED)
 %IVssAsync_INTERFACE_DEFINED = 1
$IID_IVssAsync = GUID$("{C7B98A22-222D-4E62-B875-1A44980634AF}")
INTERFACE IVssAsync $IID_IVssAsync
 INHERIT IUnknown
 ' =====================================================================================
 METHOD Cancel ( ' VTable offset = 12
 ) AS LONG
 ' =====================================================================================
 METHOD Wait ( ' VTable offset = 16
 BYVAL dwMilliseconds AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD QueryStatus ( ' VTable offset = 20
 BYREF pHrResult AS LONG
 , BYREF pReserved AS LONG
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IVssAsync_INTERFACE_DEFINED__ */
'#pragma pack(pop)
#ENDIF
