CVssWriterEx2::GetSessionId method

Returns the writer's session identifier.

Syntax

HRESULT GetSessionId(
  VSS_ID *idSession
);

Parameters

idSession

A pointer to a variable that receives the session identifier.

Return Value

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

The session identifier is an opaque value that uniquely identifies a backup or restore session. It is used to distinguish the current session among multiple parallel backup or restore sessions.

As a best practice, writers and requesters should include the session ID in all diagnostics messages used for event logging and tracing.

If a writer's event handler (such as CVssWriter::OnFreeze) calls this method, it must do so in the same thread that called the event handler. For more information, see Writer Event Handling.

Requirements

   
Minimum supported client Windows 7 [desktop apps only]
Minimum supported server Windows Server 2008 R2 [desktop apps only]
Target Platform Windows
Header vswriter.h (include Vss.h, VsWriter.h)
Library VssApi.lib

See Also

CVssWriterEx2

IVssBackupComponentsEx3::GetSessionId