CVssWriter::Subscribe method (vswriter.h)

The Subscribe method subscribes the writer with VSS.

Subscribe is a public method implemented by the base class.

Syntax

HRESULT Subscribe(
  [in] DWORD dwEventFlags
);

Parameters

[in] dwEventFlags

A bit mask (or bitwise OR) of VSS_SUBSCRIBE_MASK values indicating the events that VSS should notify the writer about.

The default value for this argument is (VSS_SM_BACKUP_EVENTS_FLAG | VSS_SM_RESTORE_EVENTS_FLAG). Currently, the caller should not override the default value.

This parameter is reserved for future use.

Return value

The following are the valid return codes for this method.

Value Meaning
S_OK
Successfully subscribed the writer object.
E_ACCESSDENIED
The caller does not have sufficient backup privileges or is not an administrator.
E_OUTOFMEMORY
The caller is 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.

VSS_E_WRITER_ALREADY_SUBSCRIBED
The writer has previously called this method.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header vswriter.h (include Vss.h, VsWriter.h)
Library VssApi.lib

See also

CVssWriter

CVssWriter::Initialize

CVssWriter::Unsubscribe

VSS_SUBSCRIBE_MASK