Quick Updates

svn path=/trunk/boinc/; revision=22783
This commit is contained in:
Rom Walton 2010-12-01 16:06:31 +00:00
parent 30190aa77c
commit 3fa1f8d94d
1 changed files with 30 additions and 30 deletions

View File

@ -71,41 +71,41 @@ int virtualbox_initialize() {
int virtualbox_cleanup() {
// Cleanup.
CoUninitialize();
CoUninitialize();
return 0;
}
int virtualbox_enumeratevms() {
HRESULT rc;
SAFEARRAY *machinesArray = NULL;
rc = pVirtualBox->get_Machines(&machinesArray);
if (SUCCEEDED(rc))
{
IMachine **machines;
rc = SafeArrayAccessData (machinesArray, (void **) &machines);
if (SUCCEEDED(rc))
{
for (ULONG i = 0; i < machinesArray->rgsabound[0].cElements; ++i)
{
BSTR str;
rc = machines[i]->get_Name(&str);
if (SUCCEEDED(rc))
{
fprintf(stderr, "Name: %S\n", str);
SysFreeString(str);
}
}
SafeArrayUnaccessData (machinesArray);
}
SafeArrayDestroy (machinesArray);
}
HRESULT rc;
SAFEARRAY *machinesArray = NULL;
rc = pVirtualBox->get_Machines(&machinesArray);
if (SUCCEEDED(rc))
{
IMachine **machines;
rc = SafeArrayAccessData (machinesArray, (void **) &machines);
if (SUCCEEDED(rc))
{
for (ULONG i = 0; i < machinesArray->rgsabound[0].cElements; ++i)
{
BSTR str;
rc = machines[i]->get_Name(&str);
if (SUCCEEDED(rc))
{
fprintf(stderr, "Name: %S\n", str);
SysFreeString(str);
}
}
SafeArrayUnaccessData (machinesArray);
}
SafeArrayDestroy (machinesArray);
}
return 0;
}