2016-11-22 219 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)。