#pragma once
#include "pch.h"
#include "vswriter.h"
#include "vsbackup.h"
using namespace System;
using namespace Runtime::InteropServices;
namespace Vanara { namespace PInvoke { namespace VssApi {
public ref class VssFactory sealed
{
public:
/// The CreateVssExamineWriterMetadata function creates an IVssExamineWriterMetadata object.
///
/// An XML string containing a Writer Metadata Document with which to initialize the returned IVssExamineWriterMetadata object.
///
/// A variable that receives an IVssExamineWriterMetadata interface pointer to the object.
///
/// The return values listed here are in addition to the normal COM HRESULTs that may be returned at any time from the function.
///
///
/// Value
/// Meaning
///
/// -
/// S_OK
/// Successfully returned a pointer to an IVssExamineWriterMetadata interface.
///
/// -
/// E_ACCESSDENIED
/// The caller does not have sufficient backup privileges or is not an administrator.
///
/// -
/// E_INVALIDARG
/// One of the parameters is not valid.
///
/// -
/// E_OUTOFMEMORY
/// Out of memory or other system resources.
///
/// -
/// VSS_E_INVALID_XML_DOCUMENT
///
/// The XML document passed in the bstrXML parameter is not valid—that is, either it is not a correctly formed XML string or it does
/// not match the schema.
///
///
/// -
/// VSS_E_UNEXPECTED
///
/// Unexpected error. The error code is logged in the error log file. For more information, see Event and Error Handling Under VSS.
/// Windows Server 2008, Windows Vista, Windows Server 2003 and Windows XP: This value is not supported until Windows Server 2008 R2
/// and Windows 7. E_UNEXPECTED is used instead.
///
///
///
///
///
///
/// To save a copy of a writer’s Writer Metadata Document into an XML string to pass in the bstrXML parameter, use the
/// IVssExamineWriterMetadata::SaveAsXML method.
///
///
/// To retrieve the latest version of a writer’s Writer Metadata Document, use the IVssBackupComponents::GetWriterMetadata method.
///
///
/// To load a writer metadata document into an existing IVssExamineWriterMetadata object, use the
/// IVssExamineWriterMetadata::LoadFromXML method.
///
/// Users should not attempt to modify the contents of the Writer Metadata Document.
///
/// The calling application is responsible for calling IUnknown::Release to release the resources held by the
/// IVssExamineWriterMetadata object when the object is no longer needed.
///
///
[PInvokeData("vsbackup.h", MSDNShortId = "NF:vsbackup.CreateVssExamineWriterMetadata")]
static HRESULT CreateVssExamineWriterMetadata(String^ bstrXML, [Runtime::InteropServices::Out] Vanara::PInvoke::VssApi::IVssExamineWriterMetadata^% ppMetadata);
/// Creates an IVssExpressWriter interface object and returns a pointer to it.
/// Doubly indirect pointer to the newly created IVssExpressWriter object.
///
///
/// The return values listed here are in addition to the normal COM HRESULT values that may be returned at any time from the function.
///
///
///
/// Value
/// Meaning
///
/// -
/// S_OK
/// Successfully returned a pointer to an IVssExpressWriter interface.
///
/// -
/// E_ACCESSDENIED
/// The caller does not have sufficient privileges.
///
/// -
/// E_INVALIDARG
/// One of the parameters is not valid.
///
///
///
// https://docs.microsoft.com/en-us/windows/win32/api/vswriter/nf-vswriter-createvssexpresswriter HRESULT CreateVssExpressWriter(
// [out] IVssExpressWriter **ppWriter );
[PInvokeData("vswriter.h", MSDNShortId = "NF:vswriter.CreateVssExpressWriter")]
static HRESULT CreateVssExpressWriter([Runtime::InteropServices::Out] Vanara::PInvoke::VssApi::IVssExpressWriter^% ppWriter);
///
///
/// The CreateVssBackupComponents function creates an IVssBackupComponents interface object and returns a pointer to it.
///
///
/// Doubly indirect pointer to the created IVssBackupComponents interface object.
///
///
/// The return values listed here are in addition to the normal COM HRESULT s that may be returned at any time from the function.
///
///
///
/// Value
/// Meaning
///
/// -
/// S_OK
/// Successfully returned a pointer to an IVssBackupComponents interface.
///
/// -
/// E_ACCESSDENIED
/// The caller does not have sufficient backup privileges or is not an administrator.
///
/// -
/// E_INVALIDARG
/// One of the parameters is not valid.
///
/// -
/// E_OUTOFMEMORY
/// Out of memory or other system resources.
///
/// -
/// VSS_E_UNEXPECTED
///
/// Unexpected error. The error code is logged in the error log file. For more information, see Event and Error Handling Under VSS.
/// Windows Server 2008, Windows Vista, Windows Server 2003 and Windows XP: This value is not supported until Windows Server 2008 R2
/// and Windows 7. E_UNEXPECTED is used instead.
///
///
///
///
///
/// The calling application is responsible for calling IUnknown::Release to release the resources held by the returned
/// IVssBackupComponents when it is no longer needed.
///
// https://docs.microsoft.com/en-us/windows/win32/api/vsbackup/nf-vsbackup-createvssbackupcomponents HRESULT
// CreateVssBackupComponents( [out] IVssBackupComponents **ppBackup);
[PInvokeData("vsbackup.h", MSDNShortId = "NF:vsbackup.CreateVssBackupComponents")]
static HRESULT CreateVssBackupComponents([Runtime::InteropServices::Out] Vanara::PInvoke::VssApi::IVssBackupComponents^% ppBackup);
};
}}}