IVssBackupComponents::InitializeForBackup fails

IVssBackupComponents::InitializeForBackup fails

本文关键字:fails InitializeForBackup IVssBackupComponents      更新时间:2023-10-16

ivssbackupcomponents :: initizeizeforbackup失败,而e_unepped错误。如果查看器有两个错误:

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

错误2

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 %#08xn",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 00000000S_OK 00000000错误0x80042302

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

很好。通过查看过程监视器调试拆卸拆卸表明,在我的情况下,问题是注册表密钥

"HKEY_CLASSES_ROOTWow6432NodeCLSID{F2C2787D-95AB-40D4-942D-298F5F757874}"

Google告诉我,该值应该为

[HKEY_CLASSES_ROOTWow6432NodeCLSID{F2C2787D-95AB-40D4-942D-298F5F757874}]
@="PSFactoryBuffer"
[HKEY_CLASSES_ROOTWow6432NodeCLSID{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"

对于将来的读者来说,当我将构建平台从" win32"(默认选项)更改为" x64"时,问题对我来说已经消失了。我的测试环境是64位Win7。

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

我跟踪了我的问题,以在Windows 10机器上安装Apple的训练营。我读到它填充了EFI启动音量或其他内容。

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

我所有的问题都消失了。