Reputation: 649
IVssBackupComponents::InitializeForBackup failes with E_UNEXPECTED error. And in the Event viewer there are two errors:
Error 1
Volume Shadow Copy Service error: A critical component required by
the Volume Shadow Copy service is not registered. This might
happened if an error occurred during Windows setup or during
installation of a Shadow Copy provider.
The error returned from
CoCreateInstance on class with CLSID
{e579ab5f-1cc4-44b4-bed9-de0991ff0623} and Name IVssCoordinatorEx2
is [0x80040154, Class not registered ].
Operation:
Instantiating VSS server
Error 2
Volume Shadow Copy Service error: Unexpected error calling routine
CoCreateInstance. hr = 0x80040154, Class not registered.
Operation:
Instantiating VSS server
I have created simple "hello world" VSS program:
#include "vss.h"
#include "vswriter.h"
#include <VsBackup.h>
#include <stdio.h>
int main()
{
#define CHECK_PRINT(result) printf("%s %#08x\n",result==S_OK?"S_OK":"error", result)
HRESULT result = CoInitialize(NULL);
CHECK_PRINT(result);
IVssBackupComponents *VssHandle;
result = CreateVssBackupComponents(&VssHandle);
CHECK_PRINT(result);
result = VssHandle->InitializeForBackup();
CHECK_PRINT(result);
return 0;
}
It reports the same output S_OK 00000000 S_OK 00000000 error 0x80042302
On my main development Windows 10 PC and virtual Windows10 with clean installation. VSS, swprv services are running.
Upvotes: 2
Views: 1455
Reputation: 14525
For future readers, the problem is gone for me when I changed build platform from "Win32"(default option) to "x64". My test environment is a 64-bit Win7.
It should also run as Administrator to avoid "ACCESS DENIED" error(0x80070005).
Upvotes: 3
Reputation: 6099
I tracked down my problem to installing Apple's Bootcamp on my Windows 10 machine. I've read that it fills up the EFI boot volume or something.
So I found the bootcamp's .msi installer, right clicked to get the context menu, then selected uninstall.
All my issues went away.
Upvotes: 0
Reputation: 649
Well. Debugging the disassembly with looking into the Process Monitor shows that in my case the problem was missing registry key
"HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{F2C2787D-95AB-40D4-942D-298F5F757874}"
google told me that the value should be
[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{F2C2787D-95AB-40D4-942D-298F5F757874}]
@="PSFactoryBuffer"
[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{F2C2787D-95AB-40D4-942D-298F5F757874}\InProcServer32]
@=hex(2):25,00,73,00,79,00,73,00,74,00,65,00,6d,00,72,00,6f,00,6f,00,74,00,25,\
00,5c,00,53,00,79,00,73,00,57,00,4f,00,57,00,36,00,34,00,5c,00,76,00,73,00,\
73,00,5f,00,70,00,73,00,2e,00,64,00,6c,00,6c,00,00,00
"ThreadingModel"="Both"
Upvotes: 3