第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

在 Virtual Box 中還原虛擬機(jī)快照時(shí)出錯(cuò)

在 Virtual Box 中還原虛擬機(jī)快照時(shí)出錯(cuò)

C#
慕田峪7331174 2022-12-31 11:39:09
我在我的項(xiàng)目中使用 VirtualBox 和 Virtual Box API Microsoft Com C++。它是 VirtualBox 6.0.6 軟件開發(fā)工具包 (SDK) 和 VirtualBox 6.0.6 平臺(tái)包。我有個(gè)問題。我想恢復(fù)早期創(chuàng)建的快照系統(tǒng),但程序顯示錯(cuò)誤。我的代碼與評(píng)論:HRESULT rc; IVirtualBoxClient *virtualBoxClient = nullptr; IVirtualBox *virtualBox = nullptr; IMachine *machine = nullptr; ISession *session = nullptr; IProgress *progress = nullptr; ISnapshot* snapshot = nullptr; BSTR sessiontype = SysAllocString(L"gui"); BSTR machineName = SysAllocString(L"Win7x64"); HRESULT rc = CoCreateInstance(CLSID_VirtualBoxClient, NULL, CLSCTX_INPROC_SERVER, IID_IVirtualBoxClient, (void**)&virtualBoxClient); rc = virtualBoxClient->get_VirtualBox(&virtualBox); // looking for a machine with a name Win7x64 rc = virtualBox->FindMachine(machineName, &machine); // create a session object rc = CoCreateInstance(CLSID_Session, NULL, CLSCTX_INPROC_SERVER, IID_ISession, (void**)&session); if (!SUCCEEDED(rc)) { printf("Error creating Session instance! rc = 0x%x\n", rc); break; } // block the machine machine->LockMachine(session, LockType::LockType_Shared); // the name of the snapshot system BSTR snapshotUUID = SysAllocString(L"Win7_test_snapshot"); // looking for a snapshot system rc = machine->FindSnapshot(snapshotUUID, &snapshot); // recover snapshot. ERROR: variable rc - E_NOTIMPL Not implemented. rc = machine->RestoreSnapshot(snapshot, &progress); printf("Starting VM, please wait ...\n"); //waiting for the end of the operation. Abnormal termination- progress == nullptr ! rc = progress->WaitForCompletion(-1); // unlocking the machine rc = session->UnlockMachine(); if (!SUCCEEDED(rc)) { printf("Error restore state machine!\n"); break; }此外,我創(chuàng)建了一個(gè)簡(jiǎn)單的 C# 應(yīng)用程序,并在那里得到了完全相同的錯(cuò)誤。怎么了?這是錯(cuò)誤的API?我什至多次更改操作系統(tǒng)(虛擬):你能幫我嗎,如何修復(fù)調(diào)用方法錯(cuò)誤“RestoreSnapshot - E_NOTIMPL Not implemented”或者如何正確恢復(fù)系統(tǒng)快照?謝謝你。PS:我在官方論壇上問過這個(gè)問題,沒人幫我。
查看完整描述

1 回答

?
蝴蝶不菲

TA貢獻(xiàn)1810條經(jīng)驗(yàn) 獲得超4個(gè)贊

我找到了問題的解決方案。應(yīng)使用會(huì)話的當(dāng)前系統(tǒng)恢復(fù)快照。所以代碼將如下所示:


HRESULT rc = machine->LockMachine(session, LockType::LockType_Shared);

rc = machine->FindSnapshot(snapshotUUID, &snapshot);

IMachine* currentMachine(nullptr);

rc = session->get_Machine(&currentMachine);

rc = currentMachine->RestoreSnapshot(snapshot, &progress);

rc = progress->WaitForCompletion(300000);

rc = session->UnlockMachine();

它適用于此代碼。


查看完整回答
反對(duì) 回復(fù) 2022-12-31
  • 1 回答
  • 0 關(guān)注
  • 167 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)