///////////////////////////////////////////////////////////////////////////////
//
//      Copyright (c) 2000      Microsoft Corporation
//



///////////////////////////////////////////////////////////////////////////////
//      Imports
//


cpp_quote("#include <winapifamily.h>")

#pragma region Desktop Family
cpp_quote("#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)")

import "oaidl.idl";
import "ocidl.idl";

import "vss.idl";
import "vdslun.idl";

///////////////////////////////////////////////////////////////////////////////
// Forward declarations
//

// interfaces supported by the provider
interface IVssSnapshotProvider;
interface IVssProviderNotifications;


typedef VSS_PWSZ *PVSS_PWSZ;

///////////////////////////////////////////////////////////////////////////////
//      Interfaces
//

[
        object,
        uuid(609e123e-2c5a-44d3-8f01-0b1d9a47d1ff),        
        helpstring("IVssSoftwareSnapshotProvider interface"),
        pointer_default(unique)
]
interface IVssSoftwareSnapshotProvider : IUnknown
{
        [helpstring("method SetContext")]
        HRESULT SetContext(
                [in]    LONG    lContext
                );

        [helpstring("method GetSnapshot")]
        HRESULT GetSnapshotProperties(
                [in]    VSS_ID                  SnapshotId,
                [out]   VSS_SNAPSHOT_PROP       *pProp
                );

        [helpstring("method Query")]
        HRESULT Query(
                [in]    VSS_ID                  QueriedObjectId,
                [in]    VSS_OBJECT_TYPE eQueriedObjectType,
                [in]    VSS_OBJECT_TYPE eReturnedObjectsType,
                [out]   IVssEnumObject **ppEnum
                );

        [helpstring("method DeleteSnapshots")]
        HRESULT DeleteSnapshots(
                [in]    VSS_ID                  SourceObjectId,
                [in]    VSS_OBJECT_TYPE eSourceObjectType,
                [in]    BOOL                    bForceDelete,
                [out]   LONG*                   plDeletedSnapshots,
                [out]   VSS_ID*                 pNondeletedSnapshotID
                );

        [helpstring("method BeginPrepareSnapshot")]
        HRESULT BeginPrepareSnapshot(
                [in]    VSS_ID          SnapshotSetId,
                [in]    VSS_ID          SnapshotId,
                [in]    VSS_PWSZ     pwszVolumeName,
                [in]    LONG              lNewContext  
                );

        [helpstring("method IsVolumeSupported")]
    HRESULT IsVolumeSupported(
        [in]    VSS_PWSZ        pwszVolumeName,
        [out]   BOOL *          pbSupportedByThisProvider
    );

        [helpstring("method IsVolumeSnapshotted")]
    HRESULT IsVolumeSnapshotted(
        [in]    VSS_PWSZ        pwszVolumeName,
        [out]   BOOL *          pbSnapshotsPresent,
        [out]   LONG *              plSnapshotCompatibility
    );

    [helpstring("method SetSnapshotProperty")]
        HRESULT SetSnapshotProperty (
                [in] VSS_ID                     SnapshotId,
                [in] VSS_SNAPSHOT_PROPERTY_ID   eSnapshotPropertyId,
                [in] VARIANT                    vProperty
                );

    [helpstring("method RevertToSnapshot")]
        HRESULT RevertToSnapshot(
                [in] VSS_ID                     SnapshotId
        );

    [helpstring("method QueryRevertStatus")]
        HRESULT QueryRevertStatus(
            [in]   VSS_PWSZ                         pwszVolume,
            [out] IVssAsync**                  ppAsync
         );        
};


[
        object,
        uuid(5F894E5B-1E39-4778-8E23-9ABAD9F0E08C),        
        helpstring("IVssProviderCreateSnapshotSet interface"),
        pointer_default(unique)
]
interface IVssProviderCreateSnapshotSet : IUnknown
{
        [helpstring("method EndPrepareSnapshots")]
        HRESULT EndPrepareSnapshots(
                [in]    VSS_ID          SnapshotSetId
                );

        [helpstring("method PreCommitSnapshots")]
        HRESULT PreCommitSnapshots(
                [in]    VSS_ID          SnapshotSetId
                );

        [helpstring("method CommitSnapshots")]
        HRESULT CommitSnapshots(
                [in]    VSS_ID          SnapshotSetId
                );

        [helpstring("method PostCommitSnapshots")]
        HRESULT PostCommitSnapshots(
                [in]    VSS_ID          SnapshotSetId,
                [in]    LONG        lSnapshotsCount
                );

        [helpstring("method PreFinalCommitSnapshots")]
        HRESULT PreFinalCommitSnapshots(
                [in]    VSS_ID     SnapshotSetId
                );

        [helpstring("method PostFinalCommitSnapshots")]
        HRESULT PostFinalCommitSnapshots(
                [in]    VSS_ID    SnapshotSetId
                );
                
        [helpstring("method AbortSnapshots")]
        HRESULT AbortSnapshots(
                [in]    VSS_ID          SnapshotSetId
                );
};


[
        object,
        uuid(E561901F-03A5-4afe-86D0-72BAEECE7004),
        helpstring("IVssProviderNotifications interface"),
        pointer_default(unique)
]
interface IVssProviderNotifications : IUnknown
{
        [helpstring("method OnLoad")]
        HRESULT OnLoad(
                [in,unique] IUnknown* pCallback
                );

        [helpstring("method OnUnload")]
        HRESULT OnUnload(
                [in]    BOOL    bForceUnload
                );
};


[
        object,
        uuid(9593A157-44E9-4344-BBEB-44FBF9B06B10),
        helpstring("IVssHardwareSnapshotProvider interface"),
        pointer_default(unique)
]
interface IVssHardwareSnapshotProvider : IUnknown
{
        [helpstring("method AreLunsSupported")]
        HRESULT AreLunsSupported (
                [in]    LONG    lLunCount,
                [in]    LONG    lContext,
                [in, unique, size_is(lLunCount)] VSS_PWSZ *rgwszDevices,
                [in, out, size_is(lLunCount)] VDS_LUN_INFORMATION *pLunInformation,
                [out] BOOL *pbIsSupported
                );

        [helpstring("method FillInLunInfo")]
        HRESULT FillInLunInfo (
                [in]    VSS_PWSZ wszDeviceName,
                [in, out] VDS_LUN_INFORMATION *pLunInfo,
                [out] BOOL *pbIsSupported
                );


        [helpstring("method BeginPrepareSnapshot")]
        HRESULT BeginPrepareSnapshot(
                [in]    VSS_ID          SnapshotSetId,
                [in]    VSS_ID          SnapshotId,
                [in]    LONG            lContext,
                [in]    LONG            lLunCount,
                [in, unique, size_is(lLunCount)] VSS_PWSZ *rgDeviceNames,
                [in, out, size_is(lLunCount)] VDS_LUN_INFORMATION *rgLunInformation
                );



        [helpstring("method GetTargetLuns")]
        HRESULT GetTargetLuns(
                [in]    LONG            lLunCount,
                [in, unique, size_is(lLunCount)] VSS_PWSZ *rgDeviceNames,
                [in, unique, size_is(lLunCount)] VDS_LUN_INFORMATION *rgSourceLuns,
                [in, out, size_is(lLunCount)] VDS_LUN_INFORMATION *rgDestinationLuns
                );

        [helpstring("method LocateLuns")]
        HRESULT LocateLuns(
                [in]    LONG    lLunCount,
                [in, unique, size_is(lLunCount)]
                        VDS_LUN_INFORMATION *rgSourceLuns
                );

        [helpstring("OnLunEmpty")]
        HRESULT OnLunEmpty (
                [in, unique]    VSS_PWSZ wszDeviceName,
                [in, unique]    VDS_LUN_INFORMATION *pInformation
                );

};


[
        object,
        uuid(7F5BA925-CDB1-4d11-A71F-339EB7E709FD),
        helpstring("IVssHardwareSnapshotProviderEx interface"),
        pointer_default(unique)
]
interface IVssHardwareSnapshotProviderEx : IVssHardwareSnapshotProvider
{
	 // Informs VSS of provider supported features
        [helpstring("method GetProviderCapabilities")]
        HRESULT GetProviderCapabilities (
                [out]   ULONGLONG    *pllOriginalCapabilityMask
                );

	 // Notifies provider about LUN state change during break/fast recovery
        [helpstring("method OnLunStateChange")]
        HRESULT OnLunStateChange (
                [in, unique, size_is(dwCount)] VDS_LUN_INFORMATION *pSnapshotLuns,
                [in, unique, size_is(dwCount)] VDS_LUN_INFORMATION *pOriginalLuns,
                [in]    DWORD dwCount,
                [in]    DWORD dwFlags
                );

	 // Resync LUNs (used during Fast Recovery LUN resync)
        [helpstring("method ResyncLuns")]
        HRESULT ResyncLuns (
		 [in, unique, size_is(dwCount)] VDS_LUN_INFORMATION *pSourceLuns,
		 [in, unique, size_is(dwCount)] VDS_LUN_INFORMATION *pTargetLuns,
		 [in]    DWORD dwCount,
		 [out]   IVssAsync ** ppAsync
               );

	 // Reuse recyclable LUNs (during Delete)
        [helpstring("method OnReuseLuns")]
	 HRESULT OnReuseLuns(
               [in, unique, size_is(dwCount)] VDS_LUN_INFORMATION *pSnapshotLuns,
               [in, unique, size_is(dwCount)] VDS_LUN_INFORMATION *pOriginalLuns,
               [in]    DWORD dwCount
               );
};


[
        object,
        uuid(c8636060-7c2e-11df-8c4a-0800200c9a66),        
        helpstring("IVssFileShareSnapshotProvider interface"),
        pointer_default(unique)
]
interface IVssFileShareSnapshotProvider : IUnknown
{
        [helpstring("method SetContext")]
        HRESULT SetContext(
                [in]    LONG    lContext
                );

        [helpstring("method GetSnapshot")]
        HRESULT GetSnapshotProperties(
                [in]    VSS_ID            SnapshotId,
                [out]   VSS_SNAPSHOT_PROP *pProp
                );

        [helpstring("method Query")]
        HRESULT Query(
                [in]    VSS_ID           QueriedObjectId,
                [in]    VSS_OBJECT_TYPE  eQueriedObjectType,
                [in]    VSS_OBJECT_TYPE  eReturnedObjectsType,
                [out]   IVssEnumObject **ppEnum
                );

        [helpstring("method DeleteSnapshots")]
        HRESULT DeleteSnapshots(
                [in]    VSS_ID          SourceObjectId,
                [in]    VSS_OBJECT_TYPE eSourceObjectType,
                [in]    BOOL            bForceDelete,
                [out]   LONG*           plDeletedSnapshots,
                [out]   VSS_ID*         pNondeletedSnapshotID
                );

        [helpstring("method BeginPrepareSnapshot")]
        HRESULT BeginPrepareSnapshot(
                [in]    VSS_ID          SnapshotSetId,
                [in]    VSS_ID          SnapshotId,
                [in]    VSS_PWSZ        pwszSharePath,
                [in]    LONG            lNewContext,
                [in]    VSS_ID          ProviderId
                );

        [helpstring("method IsPathSupported")]
        HRESULT IsPathSupported(
                [in]    VSS_PWSZ        pwszSharePath,
                [out]   BOOL *          pbSupportedByThisProvider
                );

        [helpstring("method IsPathSnapshotted")]
        HRESULT IsPathSnapshotted(
                [in]    VSS_PWSZ        pwszSharePath,
                [out]   BOOL *          pbSnapshotsPresent,
                [out]   LONG *          plSnapshotCompatibility
                );

        [helpstring("method SetSnapshotProperty")]
        HRESULT SetSnapshotProperty (
                [in] VSS_ID                     SnapshotId,
                [in] VSS_SNAPSHOT_PROPERTY_ID   eSnapshotPropertyId,
                [in] VARIANT                    vProperty
                );
};


////////////////////////////////////////////////////////
//      VSS Type Library

[

	uuid(73C8B4C1-6E9D-4fc2-B304-030EC763FE81),
	version(1.0),
	helpstring("Volume Shadow Copy Service Provider 1.0 Type Library")

]
library VSSProvider
{
        importlib("stdole2.tlb");       
}

cpp_quote("#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */")
#pragma endregion

