Skip to content

Commit

Permalink
Release version 7.0 - Persimmon
Browse files Browse the repository at this point in the history
Updated COM API to make it work with VirtualBox 7.0.
  • Loading branch information
onlyfang committed Oct 22, 2022
1 parent 6a4ea26 commit 4be6f4b
Show file tree
Hide file tree
Showing 5 changed files with 23,298 additions and 13,736 deletions.
6 changes: 6 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## Change log

### 2022-10-22 Release 7.0 "Persimmon"
* Updated COM API to make it work with VirtualBox 7.0. Note this is not compatible with old versions of VirtualBox. If you need to use VirtualBox 6.1.X, please stay with 6.1 "Kiwi".
* Add a dependency on LanmanServer to ensure networking is available.
* Fix a few typos.
* Project is now built with Visual Studio 2022.

### 2019-12-14 Release 6.1 "Kiwi"
* Updated COM API to make it work with VirtualBox 6.1. Note this is not compatible with old versions of VirtualBox. If you need to use VirtualBox 6.0.X, please stay with 6.0 "Pumpkin".

Expand Down
2 changes: 1 addition & 1 deletion setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "VBoxVmService"
#define MyAppVersion "6.1-Kiwi"
#define MyAppVersion "7.0-Persimmon"
#define MyAppPublisher "VBoxVmService Development Team"
#define MyAppURL "https://github.com/onlyfang/VBoxVmService"

Expand Down
21 changes: 16 additions & 5 deletions src/VBoxVmService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ char pServiceName[nBufferSize+1];
char pExeFile[nBufferSize+1];
char pInitFile[nBufferSize+1];
char pLogFile[nBufferSize+1];
IVirtualBoxClient *virtualBoxClient;
IVirtualBox *virtualBox;
ISession *session = NULL;
HANDLE ghVMStoppedEvent = NULL;
Expand Down Expand Up @@ -702,21 +703,30 @@ unsigned __stdcall WorkerProc(void* pParam)
HRESULT rc;
rc = CoInitialize(NULL);

rc = CoCreateInstance(CLSID_VirtualBox,
rc = CoCreateInstance(CLSID_VirtualBoxClient,
NULL,
CLSCTX_LOCAL_SERVER,
IID_IVirtualBox,
(void**)&virtualBox);
CLSCTX_INPROC_SERVER,
IID_IVirtualBoxClient,
(void**)&virtualBoxClient);
if (!SUCCEEDED(rc))
{
char pTemp[nBufferSize + 1];
sprintf_s(pTemp, nBufferSize, "Error creating VirtualBox instance! rc = 0x%x", rc);
sprintf_s(pTemp, nBufferSize, "Error creating VirtualBoxClient instance! rc = 0x%x", rc);
if (rc == CO_E_SERVER_EXEC_FAILURE)
strcat_s(pTemp, nBufferSize, ". You need to stop VirtualBox GUI before starting VBoxVmService.");

WriteLog(pTemp);
goto end;
}
rc = virtualBoxClient->get_VirtualBox(&virtualBox);
if (!SUCCEEDED(rc))
{
char pTemp[nBufferSize + 1];
sprintf_s(pTemp, nBufferSize, "Error creating VirtualBox instance! rc = 0x%x", rc);

WriteLog(pTemp);
goto end;
}

// Create the session object.
rc = CoCreateInstance(CLSID_Session, // the VirtualBox base object
Expand Down Expand Up @@ -826,6 +836,7 @@ unsigned __stdcall WorkerProc(void* pParam)
}

virtualBox->Release();
virtualBoxClient->Release();
CoUninitialize();

end:
Expand Down
Loading

0 comments on commit 4be6f4b

Please sign in to comment.