2016-11-22 100 views
1

IVssBackupComponents :: InitializeForBackup失败,并显示E_UNEXPECTED错误。 而在事件查看器有两个误区:IVssBackupComponents :: InitializeForBackup失败

错误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 

Volume Shadow Copy Service error: Unexpected error calling routine 
    CoCreateInstance. hr = 0x80040154, Class not registered. 

    Operation: 
     Instantiating VSS server 

我创建简单的 “Hello World” VSS程序时出现错误:

#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; 
} 

它报告了相同的输出 S_OK 00000000 S_OK 00000000 错误0x80042302

在我的主要开发的Windows 10 PC和虚拟Windows10用干净的安装。 VSS,swprv服务正在运行。

回答

0

好吧。与寻找到进程监视器调试拆解显示,在我的情况下,问题是缺少的注册表项

"HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{F2C2787D-95AB-40D4-942D-298F5F757874}" 

谷歌告诉我,值应该是

[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" 
0

我找到了我的问题,在安装苹果我的Windows 10机器上的训练营。我读过它填充EFI启动卷或其他东西。

所以我找到了bootcamp的.msi安装程序,右键单击以获取上下文菜单,然后选择卸载。

我所有的问题都消失了。

0

对于未来的读者,当我将构建平台从“Win32”(默认选项)更改为“x64”时,问题就不存在了。我的测试环境是一个64位的Win7。

它也应该以管理员身份运行以避免“访问被拒绝”错误(0x80070005)。