From: Adrien Reboisson on

Hi,

I'm using the Volume Shadow Service (VSS) to backup some files that are
exclusively opened.
It works (locked files are opened and copied), but BackupComplete() always
gives me VSS_E_BAD_STATE.

The following VSS calls are done by my application :

CreateVSSBackupComponents();
InitializeForBackup();
SetBackupState();
GatherWriterMetadata();
StartSnapshotSet();
AddToSnapshotSet();
PrepareForBackup();
DoSnapshotSet();
GetSnapshotProperties();
<Backup all files>
VssFreeSnapshotProperties();
BackupComplete();

All work fine, except the call to BackupComplete - on XP SP2 and Vista.

What should I do in order to have more details about what happens exactly ?
Do I miss something ?

If I don't call BackupComplete() (while I release the IVssBackupComponents
interface on backup terminaison) what happens ? Is the shadow copy correctly
destroyed, or left in an inconsistent state ?

Best regards,

A.R.

NB: the same issue has already been reported in February by "David L"
(http://groups.google.fr/group/microsoft.public.win32.programmer.kernel/browse_thread/thread/bdbf3493668db073/29f9e14b31f93e9d?lnk=st&q=vss+backupcomplete+VSS_E_BAD_STATE&rnum=1&hl=fr#29f9e14b31f93e9d), without no answer ;-(


From: Adrien Reboisson on
Indeed, the call to BackupComplete seems to generate a VSS failure
event, shown in the MS Event Viewer as :

"Volume Shadow Copy Service error: Unexpected error querying for the
IVssWriterCallback interface. hr = 0x80070005.

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.

Event ID 8194"

I googled this without having any useful information about what causes
this error and how to solve it.

Furthermore, when I use vssadmin to obtain the list of the VSS writers
and their state, I've got an "unrecoverable error" for the "System
Writer". This does not prevent any new creation of shadow copies,
though. And as said before, locked files are also copied.

With no more information and no additional help about this error, I
guess I've simply to ignore it. Not the right solution, but...

Regards,

A.R.