VirtualBox

Changeset 34645 in vbox for trunk/src/VBox/Frontends/VBoxSDL


Ignore:
Timestamp:
Dec 2, 2010 6:28:04 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
68447
Message:

Frontends/VBoxSDL: variable naming cleanup and other minor cleanups

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp

    r33976 r34645  
    108108    {
    109109        // make a copy of the shape
    110         com::SafeArray <BYTE> aShape(ComSafeArrayInArg (pShape));
     110        com::SafeArray<BYTE> aShape(ComSafeArrayInArg(pShape));
    111111        size_t cbShapeSize = aShape.size();
    112112        if (cbShapeSize > 0)
     
    192192static uint8_t gaModifiersState[256];
    193193
    194 static ComPtr<IMachine> gMachine;
    195 static ComPtr<IConsole> gConsole;
    196 static ComPtr<IMachineDebugger> gMachineDebugger;
    197 static ComPtr<IKeyboard> gKeyboard;
    198 static ComPtr<IMouse> gMouse;
    199 static ComPtr<IDisplay> gDisplay;
    200 static ComPtr<IVRDEServer> gVRDEServer;
    201 static ComPtr<IProgress> gProgress;
     194static ComPtr<IMachine> gpMachine;
     195static ComPtr<IConsole> gpConsole;
     196static ComPtr<IMachineDebugger> gpMachineDebugger;
     197static ComPtr<IKeyboard> gpKeyboard;
     198static ComPtr<IMouse> gpMouse;
     199static ComPtr<IDisplay> gpDisplay;
     200static ComPtr<IVRDEServer> gpVRDEServer;
     201static ComPtr<IProgress> gpProgress;
    202202
    203203static ULONG       gcMonitors = 1;
     
    232232
    233233/**
    234  * Event handler for VirtualBox events
     234 * Event handler for VirtualBox (server) events
    235235 */
    236236class VBoxSDLEventListener
     
    252252            {
    253253#ifdef VBOX_SECURELABEL
    254                 ComPtr<IExtraDataChangedEvent> edcev = aEvent;
    255                 Assert(edcev);
    256                 Bstr key, machineId;
    257                 edcev->COMGETTER(MachineId)(machineId.asOutParam());
    258                 if (gMachine)
     254                ComPtr<IExtraDataChangedEvent> pEDCEv = aEvent;
     255                Assert(pEDCEv);
     256                Bstr bstrMachineId;
     257                pEDCEv->COMGETTER(MachineId)(bstrMachineId.asOutParam());
     258                if (gpMachine)
    259259                {
    260260                    /*
    261261                     * check if we're interested in the message
    262262                     */
    263                     Bstr ourGuid;
    264                     gMachine->COMGETTER(Id)(ourGuid.asOutParam());
    265                     if (ourGuid == machineId)
     263                    Bstr bstrOurId;
     264                    gpMachine->COMGETTER(Id)(bstrOurId.asOutParam());
     265                    if (bstrOurId == bstrMachineId)
    266266                    {
    267                         Bstr keyString;
    268                         edcev->COMGETTER(Key)(keyString.asOutParam());
    269                         if (keyString == VBOXSDL_SECURELABEL_EXTRADATA)
     267                        Bstr bstrKey;
     268                        pEDCEv->COMGETTER(Key)(bstrKey.asOutParam());
     269                        if (bstrKey == VBOXSDL_SECURELABEL_EXTRADATA)
    270270                        {
    271271                            /*
     
    282282                break;
    283283            }
     284
    284285            default:
    285286                AssertFailed();
     
    291292
    292293/**
    293  * Event handler for machine events
     294 * Event handler for Console events
    294295 */
    295296class VBoxSDLConsoleEventListener
     
    312313            case VBoxEventType_OnMousePointerShapeChanged:
    313314            {
    314                 ComPtr<IMousePointerShapeChangedEvent> mpscev = aEvent;
    315                 Assert(mpscev);
     315                ComPtr<IMousePointerShapeChangedEvent> pMPSCEv = aEvent;
     316                Assert(pMPSCEv);
    316317                PointerShapeChangeData *data;
    317318                BOOL    visible,  alpha;
    318319                ULONG   xHot, yHot, width, height;
    319                 com::SafeArray <BYTE> shape;
    320 
    321                 mpscev->COMGETTER(Visible)(&visible);
    322                 mpscev->COMGETTER(Alpha)(&alpha);
    323                 mpscev->COMGETTER(Xhot)(&xHot);
    324                 mpscev->COMGETTER(Yhot)(&yHot);
    325                 mpscev->COMGETTER(Width)(&width);
    326                 mpscev->COMGETTER(Height)(&height);
    327                 mpscev->COMGETTER(Shape)(ComSafeArrayAsOutParam(shape));
     320                com::SafeArray<BYTE> shape;
     321
     322                pMPSCEv->COMGETTER(Visible)(&visible);
     323                pMPSCEv->COMGETTER(Alpha)(&alpha);
     324                pMPSCEv->COMGETTER(Xhot)(&xHot);
     325                pMPSCEv->COMGETTER(Yhot)(&yHot);
     326                pMPSCEv->COMGETTER(Width)(&width);
     327                pMPSCEv->COMGETTER(Height)(&height);
     328                pMPSCEv->COMGETTER(Shape)(ComSafeArrayAsOutParam(shape));
    328329                data = new PointerShapeChangeData(visible, alpha, xHot, yHot, width, height,
    329330                                                  ComSafeArrayAsInParam(shape));
     
    345346            case VBoxEventType_OnMouseCapabilityChanged:
    346347            {
    347                 ComPtr<IMouseCapabilityChangedEvent> mccev = aEvent;
    348                 Assert(mccev);
    349                 mccev->COMGETTER(SupportsAbsolute)(&gfAbsoluteMouseGuest);
    350                 mccev->COMGETTER(SupportsRelative)(&gfRelativeMouseGuest);
    351                 mccev->COMGETTER(NeedsHostCursor)(&gfGuestNeedsHostCursor);
     348                ComPtr<IMouseCapabilityChangedEvent> pMCCEv = aEvent;
     349                Assert(pMCCEv);
     350                pMCCEv->COMGETTER(SupportsAbsolute)(&gfAbsoluteMouseGuest);
     351                pMCCEv->COMGETTER(SupportsRelative)(&gfRelativeMouseGuest);
     352                pMCCEv->COMGETTER(NeedsHostCursor)(&gfGuestNeedsHostCursor);
    352353                SDL_Event event = {0};
    353354                event.type      = SDL_USEREVENT;
     
    359360            case VBoxEventType_OnKeyboardLedsChanged:
    360361            {
    361                 ComPtr<IKeyboardLedsChangedEvent> klcev = aEvent;
    362                 Assert(klcev);
     362                ComPtr<IKeyboardLedsChangedEvent> pCLCEv = aEvent;
     363                Assert(pCLCEv);
    363364                BOOL fNumLock, fCapsLock, fScrollLock;
    364                 klcev->COMGETTER(NumLock)(&fNumLock);
    365                 klcev->COMGETTER(CapsLock)(&fCapsLock);
    366                 klcev->COMGETTER(ScrollLock)(&fScrollLock);
     365                pCLCEv->COMGETTER(NumLock)(&fNumLock);
     366                pCLCEv->COMGETTER(CapsLock)(&fCapsLock);
     367                pCLCEv->COMGETTER(ScrollLock)(&fScrollLock);
    367368                /* Don't bother the guest with NumLock scancodes if he doesn't set the NumLock LED */
    368369                if (gfGuestNumLockPressed != fNumLock)
     
    378379            case VBoxEventType_OnStateChanged:
    379380            {
    380                 ComPtr<IStateChangedEvent> scev = aEvent;
    381                 Assert(scev);
     381                ComPtr<IStateChangedEvent> pSCEv = aEvent;
     382                Assert(pSCEv);
    382383                MachineState_T machineState;
    383                 scev->COMGETTER(State)(&machineState);
     384                pSCEv->COMGETTER(State)(&machineState);
    384385                LogFlow(("OnStateChange: machineState = %d (%s)\n", machineState, GetStateName(machineState)));
    385386                SDL_Event event = {0};
     
    415416            case VBoxEventType_OnRuntimeError:
    416417            {
    417                 ComPtr<IRuntimeErrorEvent> rteev = aEvent;
    418                 Assert(rteev);
    419                 Bstr id, message;
     418                ComPtr<IRuntimeErrorEvent> pRTEEv = aEvent;
     419                Assert(pRTEEv);
    420420                BOOL fFatal;
    421421
    422                 rteev->COMGETTER(Fatal)(&fFatal);
     422                pRTEEv->COMGETTER(Fatal)(&fFatal);
    423423                MachineState_T machineState;
    424                 gMachine->COMGETTER(State)(&machineState);
     424                gpMachine->COMGETTER(State)(&machineState);
    425425                const char *pszType;
    426426                bool fPaused = machineState == MachineState_Paused;
     
    431431                else
    432432                    pszType = "WARNING";
    433                 rteev->COMGETTER(Id)(id.asOutParam());
    434                 rteev->COMGETTER(Message)(message.asOutParam());
    435                 RTPrintf("\n%s: ** %lS **\n%lS\n%s\n", pszType, id.raw(), message.raw(),
     433                Bstr bstrId, bstrMessage;
     434                pRTEEv->COMGETTER(Id)(bstrId.asOutParam());
     435                pRTEEv->COMGETTER(Message)(bstrMessage.asOutParam());
     436                RTPrintf("\n%s: ** %lS **\n%lS\n%s\n", pszType, bstrId.raw(), bstrMessage.raw(),
    436437                         fPaused ? "The VM was paused. Continue with HostKey + P after you solved the problem.\n" : "");
    437438                break;
     
    440441            case VBoxEventType_OnCanShowWindow:
    441442            {
    442                 ComPtr<ICanShowWindowEvent> cswev = aEvent;
    443                 Assert(cswev);
     443                ComPtr<ICanShowWindowEvent> pCSWEv = aEvent;
     444                Assert(pCSWEv);
    444445#ifdef RT_OS_DARWIN
    445446                /* SDL feature not available on Quartz */
     
    448449                SDL_VERSION(&info.version);
    449450                if (!SDL_GetWMInfo(&info))
    450                     cswev->AddVeto(NULL);
     451                    pCSWEv->AddVeto(NULL);
    451452#endif
    452453                break;
     
    455456            case VBoxEventType_OnShowWindow:
    456457            {
    457                 ComPtr<IShowWindowEvent> swev = aEvent;
    458                 Assert(swev);
     458                ComPtr<IShowWindowEvent> pSWEv = aEvent;
     459                Assert(pSWEv);
    459460#ifndef RT_OS_DARWIN
    460461                SDL_SysWMinfo info;
     
    463464                {
    464465#if defined(VBOXSDL_WITH_X11)
    465                     swev->COMSETTER(WinId)((LONG64)info.info.x11.wmwindow);
     466                    pSWEv->COMSETTER(WinId)((LONG64)info.info.x11.wmwindow);
    466467#elif defined(RT_OS_WINDOWS)
    467                     swev->COMSETTER(WinId)((LONG64)info.window);
     468                    pSWEv->COMSETTER(WinId)((LONG64)info.window);
    468469#else
    469470                    AssertFailed();
     
    725726    uint32_t memorySize = 0;
    726727    uint32_t vramSize = 0;
    727     IEventListener *vboxListener = NULL;
    728     VBoxSDLConsoleEventListenerImpl *consoleListener = NULL;
     728    IEventListener *pVBoxListener = NULL;
     729    VBoxSDLConsoleEventListenerImpl *pConsoleListener = NULL;
    729730
    730731    bool fFullscreen = false;
     
    12401241    if (FAILED(rc))
    12411242    {
    1242         RTPrintf("Error: COM initialization failed, rc = 0x%x!\n", rc);
     1243        RTPrintf("Error: COM initialization failed (rc=%Rhrc)!\n", rc);
    12431244        return 1;
    12441245    }
     
    12511252    ////////////////////////////////////////////////////////////////////////////
    12521253
    1253     ComPtr <IVirtualBox> virtualBox;
    1254     ComPtr <ISession> session;
     1254    ComPtr<IVirtualBox> pVirtualBox;
     1255    ComPtr<ISession> pSession;
    12551256    bool sessionOpened = false;
    12561257    EventQueue* eventQ = com::EventQueue::getMainEventQueue();
     
    12591260    ComPtr<IMachine> pMachine;
    12601261
    1261     rc = virtualBox.createLocalObject(CLSID_VirtualBox);
     1262    rc = pVirtualBox.createLocalObject(CLSID_VirtualBox);
    12621263    if (FAILED(rc))
    12631264    {
     
    12671268                       info.getText().raw(), info.getComponent().raw());
    12681269        else
    1269             RTPrintf("Failed to create VirtualBox object! No error information available (rc = 0x%x).\n", rc);
     1270            RTPrintf("Failed to create VirtualBox object! No error information available (rc=%Rhrc).\n", rc);
    12701271        goto leave;
    12711272    }
    1272     rc = session.createInprocObject(sessionID);
     1273    rc = pSession.createInprocObject(sessionID);
    12731274    if (FAILED(rc))
    12741275    {
    1275         RTPrintf("Failed to create session object, rc = 0x%x!\n", rc);
     1276        RTPrintf("Failed to create session object (rc=%Rhrc)!\n", rc);
    12761277        goto leave;
    12771278    }
     
    12821283    if (vmName && uuidVM.isEmpty())
    12831284    {
    1284         Bstr  bstrVMName = vmName;
    1285         rc = virtualBox->FindMachine(bstrVMName.raw(), pMachine.asOutParam());
     1285        rc = pVirtualBox->FindMachine(Bstr(vmName).raw(), pMachine.asOutParam());
    12861286        if ((rc == S_OK) && pMachine)
    12871287        {
    1288             Bstr id;
    1289             pMachine->COMGETTER(Id)(id.asOutParam());
    1290             uuidVM = Guid(id);
     1288            Bstr bstrId;
     1289            pMachine->COMGETTER(Id)(bstrId.asOutParam());
     1290            uuidVM = Guid(bstrId);
    12911291        }
    12921292        else
     
    13061306    AssertReleaseRC(vrc);
    13071307
    1308     rc = pMachine->LockMachine(session, LockType_Write);
     1308    rc = pMachine->LockMachine(pSession, LockType_Write);
    13091309    if (FAILED(rc))
    13101310    {
     
    13121312        if (info.isFullAvailable())
    13131313            PrintError("Could not open VirtualBox session",
    1314                     info.getText().raw(), info.getComponent().raw());
     1314                       info.getText().raw(), info.getComponent().raw());
    13151315        goto leave;
    13161316    }
    1317     if (!session)
     1317    if (!pSession)
    13181318    {
    13191319        RTPrintf("Could not open VirtualBox session!\n");
     
    13221322    sessionOpened = true;
    13231323    // get the mutable VM we're dealing with
    1324     session->COMGETTER(Machine)(gMachine.asOutParam());
    1325     if (!gMachine)
     1324    pSession->COMGETTER(Machine)(gpMachine.asOutParam());
     1325    if (!gpMachine)
    13261326    {
    13271327        com::ErrorInfo info;
     
    13341334    }
    13351335    // get the VM console
    1336     session->COMGETTER(Console)(gConsole.asOutParam());
    1337     if (!gConsole)
     1336    pSession->COMGETTER(Console)(gpConsole.asOutParam());
     1337    if (!gpConsole)
    13381338    {
    13391339        RTPrintf("Given console not found!\n");
     
    13461346    if (hdaFile)
    13471347    {
     1348        ComPtr<IMedium> pMedium;
     1349
    13481350        /*
    1349          * Strategy: iterate through all registered hard disk
    1350          * and see if one of them points to the same file. If
    1351          * so, assign it. If not, register a new image and assign
    1352          * it to the VM.
     1351         * Strategy: if any registered hard disk points to the same file,
     1352         * assign it. If not, register a new image and assign it to the VM.
    13531353         */
    1354         Bstr hdaFileBstr = hdaFile;
    1355         ComPtr<IMedium> hardDisk;
    1356         virtualBox->FindMedium(hdaFileBstr.raw(), DeviceType_HardDisk,
    1357                                hardDisk.asOutParam());
    1358         if (!hardDisk)
     1354        Bstr bstrHdaFile(hdaFile);
     1355        pVirtualBox->FindMedium(bstrHdaFile.raw(), DeviceType_HardDisk,
     1356                                pMedium.asOutParam());
     1357        if (!pMedium)
    13591358        {
    13601359            /* we've not found the image */
    1361             RTPrintf("Adding hard disk '%S'...\n", hdaFile);
    1362             virtualBox->OpenMedium(hdaFileBstr.raw(), DeviceType_HardDisk,
    1363                                    AccessMode_ReadWrite, hardDisk.asOutParam());
     1360            RTPrintf("Adding hard disk '%s'...\n", hdaFile);
     1361            pVirtualBox->OpenMedium(bstrHdaFile.raw(), DeviceType_HardDisk,
     1362                                    AccessMode_ReadWrite, pMedium.asOutParam());
    13641363        }
    13651364        /* do we have the right image now? */
    1366         if (hardDisk)
    1367         {
    1368             /*
    1369              * Go and attach it!
    1370              */
    1371             Bstr storageCtlName;
     1365        if (pMedium)
     1366        {
     1367            Bstr bstrSCName;
    13721368
    13731369            /* get the first IDE controller to attach the harddisk to
    1374              * and if there is none, add one temporarily
    1375              */
    1376             {
    1377                 ComPtr<IStorageController> storageCtl;
     1370             * and if there is none, add one temporarily */
     1371            {
     1372                ComPtr<IStorageController> pStorageCtl;
    13781373                com::SafeIfaceArray<IStorageController> aStorageControllers;
    1379                 CHECK_ERROR(gMachine, COMGETTER(StorageControllers)(ComSafeArrayAsOutParam(aStorageControllers)));
     1374                CHECK_ERROR(gpMachine, COMGETTER(StorageControllers)(ComSafeArrayAsOutParam(aStorageControllers)));
    13801375                for (size_t i = 0; i < aStorageControllers.size(); ++ i)
    13811376                {
     
    13851380                    if (storageBus == StorageBus_IDE)
    13861381                    {
    1387                         storageCtl = aStorageControllers[i];
     1382                        pStorageCtl = aStorageControllers[i];
    13881383                        break;
    13891384                    }
    13901385                }
    13911386
    1392                 if (storageCtl)
     1387                if (pStorageCtl)
    13931388                {
    1394                     CHECK_ERROR(storageCtl, COMGETTER(Name)(storageCtlName.asOutParam()));
    1395                     gMachine->DetachDevice(storageCtlName.raw(), 0, 0);
     1389                    CHECK_ERROR(pStorageCtl, COMGETTER(Name)(bstrSCName.asOutParam()));
     1390                    gpMachine->DetachDevice(bstrSCName.raw(), 0, 0);
    13961391                }
    13971392                else
    13981393                {
    1399                     storageCtlName = "IDE Controller";
    1400                     CHECK_ERROR(gMachine, AddStorageController(storageCtlName.raw(),
    1401                                                                StorageBus_IDE,
    1402                                                                storageCtl.asOutParam()));
     1394                    bstrSCName = "IDE Controller";
     1395                    CHECK_ERROR(gpMachine, AddStorageController(bstrSCName.raw(),
     1396                                                                StorageBus_IDE,
     1397                                                                pStorageCtl.asOutParam()));
    14031398                }
    14041399            }
    14051400
    1406             gMachine->AttachDevice(storageCtlName.raw(), 0, 0,
    1407                                    DeviceType_HardDisk, hardDisk);
     1401            CHECK_ERROR(gpMachine, AttachDevice(bstrSCName.raw(), 0, 0,
     1402                                                DeviceType_HardDisk, pMedium));
    14081403            /// @todo why is this attachment saved?
    14091404        }
     
    14211416    do
    14221417    {
    1423         ComPtr<IMedium> floppyMedium;
     1418        ComPtr<IMedium> pMedium;
    14241419
    14251420        /* unmount? */
     
    14301425        else
    14311426        {
    1432             Bstr medium = fdaFile;
     1427            Bstr bstrFdaFile(fdaFile);
    14331428
    14341429            /* Assume it's a host drive name */
    1435             ComPtr <IHost> host;
    1436             CHECK_ERROR_BREAK(virtualBox, COMGETTER(Host)(host.asOutParam()));
    1437             rc = host->FindHostFloppyDrive(medium.raw(),
    1438                                            floppyMedium.asOutParam());
     1430            ComPtr<IHost> pHost;
     1431            CHECK_ERROR_BREAK(pVirtualBox, COMGETTER(Host)(pHost.asOutParam()));
     1432            rc = pHost->FindHostFloppyDrive(bstrFdaFile.raw(),
     1433                                            pMedium.asOutParam());
    14391434            if (FAILED(rc))
    14401435            {
    14411436                /* try to find an existing one */
    1442                 rc = virtualBox->FindMedium(medium.raw(), DeviceType_Floppy,
    1443                                             floppyMedium.asOutParam());
     1437                rc = pVirtualBox->FindMedium(bstrFdaFile.raw(), DeviceType_Floppy,
     1438                                             pMedium.asOutParam());
    14441439                if (FAILED(rc))
    14451440                {
    14461441                    /* try to add to the list */
    1447                     RTPrintf("Adding floppy image '%S'...\n", fdaFile);
    1448                     CHECK_ERROR_BREAK(virtualBox,
    1449                                       OpenMedium(medium.raw(),
     1442                    RTPrintf("Adding floppy image '%s'...\n", fdaFile);
     1443                    CHECK_ERROR_BREAK(pVirtualBox,
     1444                                      OpenMedium(bstrFdaFile.raw(),
    14501445                                                 DeviceType_Floppy,
    14511446                                                 AccessMode_ReadWrite,
    1452                                                  floppyMedium.asOutParam()));
     1447                                                 pMedium.asOutParam()));
    14531448                }
    14541449            }
    14551450        }
    14561451
    1457         Bstr storageCtlName;
     1452        Bstr bstrSCName;
    14581453
    14591454        /* get the first floppy controller to attach the floppy to
    1460          * and if there is none, add one temporarily
    1461          */
    1462         {
    1463             ComPtr<IStorageController> storageCtl;
     1455         * and if there is none, add one temporarily */
     1456        {
     1457            ComPtr<IStorageController> pStorageCtl;
    14641458            com::SafeIfaceArray<IStorageController> aStorageControllers;
    1465             CHECK_ERROR(gMachine, COMGETTER(StorageControllers)(ComSafeArrayAsOutParam(aStorageControllers)));
     1459            CHECK_ERROR(gpMachine, COMGETTER(StorageControllers)(ComSafeArrayAsOutParam(aStorageControllers)));
    14661460            for (size_t i = 0; i < aStorageControllers.size(); ++ i)
    14671461            {
     
    14711465                if (storageBus == StorageBus_Floppy)
    14721466                {
    1473                     storageCtl = aStorageControllers[i];
     1467                    pStorageCtl = aStorageControllers[i];
    14741468                    break;
    14751469                }
    14761470            }
    14771471
    1478             if (storageCtl)
    1479             {
    1480                 ComPtr<IMediumAttachment> floppyAttachment;
    1481 
    1482                 CHECK_ERROR(storageCtl, COMGETTER(Name)(storageCtlName.asOutParam()));
    1483                 rc = gMachine->GetMediumAttachment(storageCtlName.raw(), 0, 0,
    1484                                                    floppyAttachment.asOutParam());
    1485                 if (FAILED(rc))
    1486                     CHECK_ERROR(gMachine, AttachDevice(storageCtlName.raw(), 0, 0,
    1487                                                        DeviceType_Floppy, NULL));
     1472            if (pStorageCtl)
     1473            {
     1474                CHECK_ERROR(pStorageCtl, COMGETTER(Name)(bstrSCName.asOutParam()));
     1475                gpMachine->DetachDevice(bstrSCName.raw(), 0, 0);
    14881476            }
    14891477            else
    14901478            {
    1491                 storageCtlName = "Floppy Controller";
    1492                 CHECK_ERROR(gMachine, AddStorageController(storageCtlName.raw(),
    1493                                                            StorageBus_Floppy,
    1494                                                            storageCtl.asOutParam()));
    1495                 CHECK_ERROR(gMachine, AttachDevice(storageCtlName.raw(), 0, 0,
    1496                                                    DeviceType_Floppy, NULL));
    1497             }
    1498         }
    1499 
    1500         CHECK_ERROR(gMachine, MountMedium(storageCtlName.raw(), 0, 0, floppyMedium,
    1501                                           FALSE /* aForce */));
     1479                bstrSCName = "Floppy Controller";
     1480                CHECK_ERROR(gpMachine, AddStorageController(bstrSCName.raw(),
     1481                                                            StorageBus_Floppy,
     1482                                                            pStorageCtl.asOutParam()));
     1483            }
     1484        }
     1485
     1486        CHECK_ERROR(gpMachine, AttachDevice(bstrSCName.raw(), 0, 0,
     1487                                            DeviceType_Floppy, pMedium));
    15021488    }
    15031489    while (0);
     
    15111497    do
    15121498    {
    1513         ComPtr<IMedium> dvdMedium;
     1499        ComPtr<IMedium> pMedium;
    15141500
    15151501        /* unmount? */
     
    15201506        else
    15211507        {
    1522             Bstr medium = cdromFile;
     1508            Bstr bstrCdromFile(cdromFile);
    15231509
    15241510            /* Assume it's a host drive name */
    1525             ComPtr <IHost> host;
    1526             CHECK_ERROR_BREAK(virtualBox, COMGETTER(Host)(host.asOutParam()));
    1527             rc = host->FindHostDVDDrive(medium.raw(), dvdMedium.asOutParam());
     1511            ComPtr<IHost> pHost;
     1512            CHECK_ERROR_BREAK(pVirtualBox, COMGETTER(Host)(pHost.asOutParam()));
     1513            rc = pHost->FindHostDVDDrive(bstrCdromFile.raw(), pMedium.asOutParam());
    15281514            if (FAILED(rc))
    15291515            {
    15301516                /* try to find an existing one */
    1531                 rc = virtualBox->FindMedium(medium.raw(), DeviceType_DVD,
    1532                                             dvdMedium.asOutParam());
     1517                rc = pVirtualBox->FindMedium(bstrCdromFile.raw(), DeviceType_DVD,
     1518                                             pMedium.asOutParam());
    15331519                if (FAILED(rc))
    15341520                {
    15351521                    /* try to add to the list */
    1536                     RTPrintf("Adding ISO image '%S'...\n", cdromFile);
    1537                     CHECK_ERROR_BREAK(virtualBox, OpenMedium(medium.raw(),
    1538                                                              DeviceType_DVD,
    1539                                                              AccessMode_ReadWrite,
    1540                                                              dvdMedium.asOutParam()));
     1522                    RTPrintf("Adding ISO image '%s'...\n", cdromFile);
     1523                    CHECK_ERROR_BREAK(pVirtualBox,
     1524                                      OpenMedium(bstrCdromFile.raw(),
     1525                                                 DeviceType_DVD,
     1526                                                 AccessMode_ReadWrite,
     1527                                                 pMedium.asOutParam()));
    15411528                }
    15421529            }
    15431530        }
    15441531
    1545         Bstr storageCtlName;
    1546 
    1547         /* get the first IDE controller to attach the DVD Drive to
    1548          * and if there is none, add one temporarily
    1549          */
    1550         {
    1551             ComPtr<IStorageController> storageCtl;
     1532        Bstr bstrSCName;
     1533
     1534        /* get the first IDE controller to attach the DVD drive to
     1535         * and if there is none, add one temporarily */
     1536        {
     1537            ComPtr<IStorageController> pStorageCtl;
    15521538            com::SafeIfaceArray<IStorageController> aStorageControllers;
    1553             CHECK_ERROR(gMachine, COMGETTER(StorageControllers)(ComSafeArrayAsOutParam(aStorageControllers)));
     1539            CHECK_ERROR(gpMachine, COMGETTER(StorageControllers)(ComSafeArrayAsOutParam(aStorageControllers)));
    15541540            for (size_t i = 0; i < aStorageControllers.size(); ++ i)
    15551541            {
     
    15591545                if (storageBus == StorageBus_IDE)
    15601546                {
    1561                     storageCtl = aStorageControllers[i];
     1547                    pStorageCtl = aStorageControllers[i];
    15621548                    break;
    15631549                }
    15641550            }
    15651551
    1566             if (storageCtl)
    1567             {
    1568                 ComPtr<IMediumAttachment> dvdAttachment;
    1569 
    1570                 CHECK_ERROR(storageCtl, COMGETTER(Name)(storageCtlName.asOutParam()));
    1571                 gMachine->DetachDevice(storageCtlName.raw(), 1, 0);
    1572                 CHECK_ERROR(gMachine, AttachDevice(storageCtlName.raw(), 1, 0,
    1573                                                     DeviceType_DVD, NULL));
     1552            if (pStorageCtl)
     1553            {
     1554                CHECK_ERROR(pStorageCtl, COMGETTER(Name)(bstrSCName.asOutParam()));
     1555                gpMachine->DetachDevice(bstrSCName.raw(), 1, 0);
    15741556            }
    15751557            else
    15761558            {
    1577                 storageCtlName = "IDE Controller";
    1578                 CHECK_ERROR(gMachine, AddStorageController(storageCtlName.raw(),
    1579                                                            StorageBus_IDE,
    1580                                                            storageCtl.asOutParam()));
    1581                 CHECK_ERROR(gMachine, AttachDevice(storageCtlName.raw(), 1, 0,
    1582                                                    DeviceType_DVD, NULL));
    1583             }
    1584         }
    1585 
    1586         CHECK_ERROR(gMachine, MountMedium(storageCtlName.raw(), 1, 0, dvdMedium,
    1587                                           FALSE /*aForce */));
     1559                bstrSCName = "IDE Controller";
     1560                CHECK_ERROR(gpMachine, AddStorageController(bstrSCName.raw(),
     1561                                                            StorageBus_IDE,
     1562                                                            pStorageCtl.asOutParam()));
     1563            }
     1564        }
     1565
     1566        CHECK_ERROR(gpMachine, AttachDevice(bstrSCName.raw(), 1, 0,
     1567                                            DeviceType_DVD, pMedium));
    15881568    }
    15891569    while (0);
     
    15981578         */
    15991579        MachineState_T machineState;
    1600         gMachine->COMGETTER(State)(&machineState);
     1580        gpMachine->COMGETTER(State)(&machineState);
    16011581        if (machineState == MachineState_Saved)
    16021582        {
    1603             CHECK_ERROR(gConsole, DiscardSavedState(true /* fDeleteFile */));
     1583            CHECK_ERROR(gpConsole, DiscardSavedState(true /* fDeleteFile */));
    16041584        }
    16051585        /*
     
    16081588         */
    16091589        ULONG cSnapshots;
    1610         gMachine->COMGETTER(SnapshotCount)(&cSnapshots);
     1590        gpMachine->COMGETTER(SnapshotCount)(&cSnapshots);
    16111591        if (cSnapshots)
    16121592        {
    1613             gProgress = NULL;
     1593            gpProgress = NULL;
    16141594
    16151595            ComPtr<ISnapshot> pCurrentSnapshot;
    1616             CHECK_ERROR(gMachine, COMGETTER(CurrentSnapshot)(pCurrentSnapshot.asOutParam()));
     1596            CHECK_ERROR(gpMachine, COMGETTER(CurrentSnapshot)(pCurrentSnapshot.asOutParam()));
    16171597            if (FAILED(rc))
    16181598                goto leave;
    16191599
    1620             CHECK_ERROR(gConsole, RestoreSnapshot(pCurrentSnapshot, gProgress.asOutParam()));
    1621             rc = gProgress->WaitForCompletion(-1);
     1600            CHECK_ERROR(gpConsole, RestoreSnapshot(pCurrentSnapshot, gpProgress.asOutParam()));
     1601            rc = gpProgress->WaitForCompletion(-1);
    16221602        }
    16231603    }
    16241604
    16251605    // get the machine debugger (does not have to be there)
    1626     gConsole->COMGETTER(Debugger)(gMachineDebugger.asOutParam());
    1627     if (gMachineDebugger)
     1606    gpConsole->COMGETTER(Debugger)(gpMachineDebugger.asOutParam());
     1607    if (gpMachineDebugger)
    16281608    {
    16291609        Log(("Machine debugger available!\n"));
    16301610    }
    1631     gConsole->COMGETTER(Display)(gDisplay.asOutParam());
    1632     if (!gDisplay)
     1611    gpConsole->COMGETTER(Display)(gpDisplay.asOutParam());
     1612    if (!gpDisplay)
    16331613    {
    16341614        RTPrintf("Error: could not get display object!\n");
     
    16391619    if (bootDevice != DeviceType_Null)
    16401620    {
    1641         rc = gMachine->SetBootOrder(1, bootDevice);
     1621        rc = gpMachine->SetBootOrder(1, bootDevice);
    16421622        if (rc != S_OK)
    16431623        {
     
    16491629    if (memorySize)
    16501630    {
    1651         rc = gMachine->COMSETTER(MemorySize)(memorySize);
     1631        rc = gpMachine->COMSETTER(MemorySize)(memorySize);
    16521632        if (rc != S_OK)
    16531633        {
    16541634            ULONG ramSize = 0;
    1655             gMachine->COMGETTER(MemorySize)(&ramSize);
     1635            gpMachine->COMGETTER(MemorySize)(&ramSize);
    16561636            RTPrintf("Error: could not set memory size, using current setting of %d MBytes\n", ramSize);
    16571637        }
     
    16601640    if (vramSize)
    16611641    {
    1662         rc = gMachine->COMSETTER(VRAMSize)(vramSize);
     1642        rc = gpMachine->COMSETTER(VRAMSize)(vramSize);
    16631643        if (rc != S_OK)
    16641644        {
    1665             gMachine->COMGETTER(VRAMSize)((ULONG*)&vramSize);
     1645            gpMachine->COMGETTER(VRAMSize)((ULONG*)&vramSize);
    16661646            RTPrintf("Error: could not set VRAM size, using current setting of %d MBytes\n", vramSize);
    16671647        }
     
    16841664        goto leave;
    16851665
    1686     gMachine->COMGETTER(MonitorCount)(&gcMonitors);
     1666    gpMachine->COMGETTER(MonitorCount)(&gcMonitors);
    16871667    if (gcMonitors > 64)
    16881668        gcMonitors = 64;
     
    17491729            goto leave;
    17501730        }
    1751         Bstr key = VBOXSDL_SECURELABEL_EXTRADATA;
    1752         Bstr label;
    1753         gMachine->GetExtraData(key.raw(), label.asOutParam());
    1754         Utf8Str labelUtf8 = label;
     1731        Bstr bstrLabel;
     1732        gpMachine->GetExtraData(Bstr(VBOXSDL_SECURELABEL_EXTRADATA).raw(), bstrLabel.asOutParam());
     1733        Utf8Str labelUtf8(bstrLabel);
    17551734        /*
    17561735         * Now update the label
     
    17731752    {
    17741753        // register our framebuffer
    1775         rc = gDisplay->SetFramebuffer(i, gpFramebuffer[i]);
     1754        rc = gpDisplay->SetFramebuffer(i, gpFramebuffer[i]);
    17761755        if (FAILED(rc))
    17771756        {
     
    17811760        IFramebuffer *dummyFb;
    17821761        LONG xOrigin, yOrigin;
    1783         rc = gDisplay->GetFramebuffer(i, &dummyFb, &xOrigin, &yOrigin);
     1762        rc = gpDisplay->GetFramebuffer(i, &dummyFb, &xOrigin, &yOrigin);
    17841763        gpFramebuffer[i]->setOrigin(xOrigin, yOrigin);
    17851764    }
    17861765
    17871766    {
    1788         // register listener for global events
    1789         ComPtr<IEventSource> es;
    1790         CHECK_ERROR(virtualBox, COMGETTER(EventSource)(es.asOutParam()));
    1791         vboxListener = new VBoxSDLEventListenerImpl();
    1792         com::SafeArray <VBoxEventType_T> eventTypes;
     1767        // register listener for VirtualBox (server) events
     1768        ComPtr<IEventSource> pES;
     1769        CHECK_ERROR(pVirtualBox, COMGETTER(EventSource)(pES.asOutParam()));
     1770        pVBoxListener = new VBoxSDLEventListenerImpl();
     1771        com::SafeArray<VBoxEventType_T> eventTypes;
    17931772        eventTypes.push_back(VBoxEventType_OnExtraDataChanged);
    1794         CHECK_ERROR(es, RegisterListener(vboxListener, ComSafeArrayAsInParam(eventTypes), true));
    1795     }
    1796 
    1797     {
    1798         // register listener for machine events
    1799         ComPtr<IEventSource> es;
    1800         CHECK_ERROR(gConsole, COMGETTER(EventSource)(es.asOutParam()));
    1801         consoleListener = new VBoxSDLConsoleEventListenerImpl();
    1802         com::SafeArray <VBoxEventType_T> eventTypes;
     1773        CHECK_ERROR(pES, RegisterListener(pVBoxListener, ComSafeArrayAsInParam(eventTypes), true));
     1774    }
     1775
     1776    {
     1777        // register listener for Console events
     1778        ComPtr<IEventSource> pES;
     1779        CHECK_ERROR(gpConsole, COMGETTER(EventSource)(pES.asOutParam()));
     1780        pConsoleListener = new VBoxSDLConsoleEventListenerImpl();
     1781        com::SafeArray<VBoxEventType_T> eventTypes;
    18031782        eventTypes.push_back(VBoxEventType_OnMousePointerShapeChanged);
    18041783        eventTypes.push_back(VBoxEventType_OnMouseCapabilityChanged);
     
    18081787        eventTypes.push_back(VBoxEventType_OnCanShowWindow);
    18091788        eventTypes.push_back(VBoxEventType_OnShowWindow);
    1810         CHECK_ERROR(es, RegisterListener(consoleListener, ComSafeArrayAsInParam(eventTypes), true));
     1789        CHECK_ERROR(pES, RegisterListener(pConsoleListener, ComSafeArrayAsInParam(eventTypes), true));
    18111790        // until we've tried to to start the VM, ignore power off events
    1812         consoleListener->getWrapped()->ignorePowerOffEvents(true);
     1791        pConsoleListener->getWrapped()->ignorePowerOffEvents(true);
    18131792    }
    18141793
    18151794    if (portVRDP)
    18161795    {
    1817         rc = gMachine->COMGETTER(VRDEServer)(gVRDEServer.asOutParam());
    1818         AssertMsg((rc == S_OK) && gVRDEServer, ("Could not get VRDP Server! rc = 0x%x\n", rc));
    1819         if (gVRDEServer)
     1796        rc = gpMachine->COMGETTER(VRDEServer)(gpVRDEServer.asOutParam());
     1797        AssertMsg((rc == S_OK) && gpVRDEServer, ("Could not get VRDP Server! rc = 0x%x\n", rc));
     1798        if (gpVRDEServer)
    18201799        {
    18211800            // has a non standard VRDP port been requested?
    18221801            if (portVRDP > 0)
    18231802            {
    1824                 Bstr bstr = portVRDP;
    1825                 rc = gVRDEServer->SetVRDEProperty(Bstr("TCP/Ports").raw(), bstr.raw());
     1803                rc = gpVRDEServer->SetVRDEProperty(Bstr("TCP/Ports").raw(), Bstr(portVRDP).raw());
    18261804                if (rc != S_OK)
    18271805                {
     
    18311809            }
    18321810            // now enable VRDP
    1833             rc = gVRDEServer->COMSETTER(Enabled)(TRUE);
     1811            rc = gpVRDEServer->COMSETTER(Enabled)(TRUE);
    18341812            if (rc != S_OK)
    18351813            {
     
    18441822    if (fRawR0 != ~0U)
    18451823    {
    1846         if (!gMachineDebugger)
     1824        if (!gpMachineDebugger)
    18471825        {
    18481826            RTPrintf("Error: No debugger object; -%srawr0 cannot be executed!\n", fRawR0 ? "" : "no");
    18491827            goto leave;
    18501828        }
    1851         gMachineDebugger->COMSETTER(RecompileSupervisor)(!fRawR0);
     1829        gpMachineDebugger->COMSETTER(RecompileSupervisor)(!fRawR0);
    18521830    }
    18531831    if (fRawR3 != ~0U)
    18541832    {
    1855         if (!gMachineDebugger)
     1833        if (!gpMachineDebugger)
    18561834        {
    18571835            RTPrintf("Error: No debugger object; -%srawr3 cannot be executed!\n", fRawR0 ? "" : "no");
    18581836            goto leave;
    18591837        }
    1860         gMachineDebugger->COMSETTER(RecompileUser)(!fRawR3);
     1838        gpMachineDebugger->COMSETTER(RecompileUser)(!fRawR3);
    18611839    }
    18621840    if (fPATM != ~0U)
    18631841    {
    1864         if (!gMachineDebugger)
     1842        if (!gpMachineDebugger)
    18651843        {
    18661844            RTPrintf("Error: No debugger object; -%spatm cannot be executed!\n", fRawR0 ? "" : "no");
    18671845            goto leave;
    18681846        }
    1869         gMachineDebugger->COMSETTER(PATMEnabled)(fPATM);
     1847        gpMachineDebugger->COMSETTER(PATMEnabled)(fPATM);
    18701848    }
    18711849    if (fCSAM != ~0U)
    18721850    {
    1873         if (!gMachineDebugger)
     1851        if (!gpMachineDebugger)
    18741852        {
    18751853            RTPrintf("Error: No debugger object; -%scsam cannot be executed!\n", fRawR0 ? "" : "no");
    18761854            goto leave;
    18771855        }
    1878         gMachineDebugger->COMSETTER(CSAMEnabled)(fCSAM);
     1856        gpMachineDebugger->COMSETTER(CSAMEnabled)(fCSAM);
    18791857    }
    18801858    if (fHWVirt != ~0U)
    18811859    {
    1882         gMachine->SetHWVirtExProperty(HWVirtExPropertyType_Enabled, fHWVirt);
     1860        gpMachine->SetHWVirtExProperty(HWVirtExPropertyType_Enabled, fHWVirt);
    18831861    }
    18841862    if (u32WarpDrive != 0)
    18851863    {
    1886         if (!gMachineDebugger)
     1864        if (!gpMachineDebugger)
    18871865        {
    18881866            RTPrintf("Error: No debugger object; --warpdrive %d cannot be executed!\n", u32WarpDrive);
    18891867            goto leave;
    18901868        }
    1891         gMachineDebugger->COMSETTER(VirtualTimeRate)(u32WarpDrive);
     1869        gpMachineDebugger->COMSETTER(VirtualTimeRate)(u32WarpDrive);
    18921870    }
    18931871#endif /* VBOXSDL_ADVANCED_OPTIONS */
     
    19511929
    19521930    LogFlow(("Powering up the VM...\n"));
    1953     rc = gConsole->PowerUp(gProgress.asOutParam());
     1931    rc = gpConsole->PowerUp(gpProgress.asOutParam());
    19541932    if (rc != S_OK)
    19551933    {
    1956         com::ErrorInfo info(gConsole, COM_IIDOF(IConsole));
     1934        com::ErrorInfo info(gpConsole, COM_IIDOF(IConsole));
    19571935        if (info.isBasicAvailable())
    19581936            PrintError("Failed to power up VM", info.getText().raw());
     
    19791957
    19801958    LogRel(("VBoxSDL: NUM lock initially %s, CAPS lock initially %s\n",
    1981               !!(SDL_GetModState() & KMOD_NUM)  ? "ON" : "OFF",
    1982               !!(SDL_GetModState() & KMOD_CAPS) ? "ON" : "OFF"));
     1959            !!(SDL_GetModState() & KMOD_NUM)  ? "ON" : "OFF",
     1960            !!(SDL_GetModState() & KMOD_CAPS) ? "ON" : "OFF"));
    19831961
    19841962    /* start regular timer so we don't starve in the event loop */
     
    19901968    do
    19911969    {
    1992         rc = gMachine->COMGETTER(State)(&machineState);
     1970        rc = gpMachine->COMGETTER(State)(&machineState);
    19931971        if (    rc == S_OK
    19941972            &&  (   machineState == MachineState_Starting
     
    20412019                        gpFramebuffer[event.user.code]->resizeGuest();
    20422020                        /* update xOrigin, yOrigin -> mouse */
    2043                         rc = gDisplay->GetFramebuffer(event.user.code, &dummyFb, &xOrigin, &yOrigin);
     2021                        rc = gpDisplay->GetFramebuffer(event.user.code, &dummyFb, &xOrigin, &yOrigin);
    20442022                        gpFramebuffer[event.user.code]->setOrigin(xOrigin, yOrigin);
    20452023                        /* notify the display that the resize has been completed */
    2046                         gDisplay->ResizeCompleted(event.user.code);
     2024                        gpDisplay->ResizeCompleted(event.user.code);
    20472025                        break;
    20482026                    }
     
    20682046                        if (event.user.code != VBOXSDL_TERM_NORMAL)
    20692047                        {
    2070                             com::ProgressErrorInfo info(gProgress);
     2048                            com::ProgressErrorInfo info(gpProgress);
    20712049                            if (info.isBasicAvailable())
    20722050                                PrintError("Failed to power up VM", info.getText().raw());
     
    21062084    if (machineState != MachineState_Running)
    21072085    {
    2108         com::ProgressErrorInfo info(gProgress);
     2086        com::ProgressErrorInfo info(gpProgress);
    21092087        if (info.isBasicAvailable())
    21102088            PrintError("Failed to power up VM", info.getText().raw());
     
    21162094    // accept power off events from now on because we're running
    21172095    // note that there's a possible race condition here...
    2118     consoleListener->getWrapped()->ignorePowerOffEvents(false);
    2119 
    2120     rc = gConsole->COMGETTER(Keyboard)(gKeyboard.asOutParam());
    2121     if (!gKeyboard)
     2096    pConsoleListener->getWrapped()->ignorePowerOffEvents(false);
     2097
     2098    rc = gpConsole->COMGETTER(Keyboard)(gpKeyboard.asOutParam());
     2099    if (!gpKeyboard)
    21222100    {
    21232101        RTPrintf("Error: could not get keyboard object!\n");
    21242102        goto leave;
    21252103    }
    2126     gConsole->COMGETTER(Mouse)(gMouse.asOutParam());
    2127     if (!gMouse)
     2104    gpConsole->COMGETTER(Mouse)(gpMouse.asOutParam());
     2105    if (!gpMouse)
    21282106    {
    21292107        RTPrintf("Error: could not get mouse object!\n");
     
    23332311                if (!gfACPITerm || gSdlQuitTimer)
    23342312                    goto leave;
    2335                 if (gConsole)
    2336                     gConsole->PowerButton();
     2313                if (gpConsole)
     2314                    gpConsole->PowerButton();
    23372315                gSdlQuitTimer = SDL_AddTimer(1000, QuitTimer, NULL);
    23382316                break;
     
    24422420            case SDL_VIDEORESIZE:
    24432421            {
    2444                 if (gDisplay)
     2422                if (gpDisplay)
    24452423                {
    24462424                    if (gfIgnoreNextResize)
     
    24842462                int h = DECODEH(event);
    24852463                LogFlow(("SDL_USER_EVENT_UPDATERECT: x = %d, y = %d, w = %d, h = %d\n",
    2486                         x, y, w, h));
     2464                         x, y, w, h));
    24872465
    24882466                Assert(gpFramebuffer[event.user.code]);
     
    25092487                 */
    25102488                /* communicate the resize event to the guest */
    2511                 gDisplay->SetVideoModeHint(uResizeWidth, uResizeHeight, 0, 0);
     2489                gpDisplay->SetVideoModeHint(uResizeWidth, uResizeHeight, 0, 0);
    25122490                break;
    25132491
     
    25242502                gpFramebuffer[event.user.code]->resizeGuest();
    25252503                /* update xOrigin, yOrigin -> mouse */
    2526                 rc = gDisplay->GetFramebuffer(event.user.code, &dummyFb, &xOrigin, &yOrigin);
     2504                rc = gpDisplay->GetFramebuffer(event.user.code, &dummyFb, &xOrigin, &yOrigin);
    25272505                gpFramebuffer[event.user.code]->setOrigin(xOrigin, yOrigin);
    25282506                /* notify the display that the resize has been completed */
    2529                 gDisplay->ResizeCompleted(event.user.code);
     2507                gpDisplay->ResizeCompleted(event.user.code);
    25302508                break;
    25312509            }
     
    25722550                 * Query the new label text
    25732551                 */
    2574                 Bstr key = VBOXSDL_SECURELABEL_EXTRADATA;
    2575                 Bstr label;
    2576                 gMachine->GetExtraData(key.raw(), label.asOutParam());
    2577                 Utf8Str labelUtf8 = label;
     2552                Bstr bstrLabel;
     2553                gpMachine->GetExtraData(Bstr(VBOXSDL_SECURELABEL_EXTRADATA).raw(), bstrLabel.asOutParam());
     2554                Utf8Str labelUtf8(bstrLabel);
    25782555                /*
    25792556                 * Now update the label
     
    26222599#endif /* VBOX_WITH_XPCOM */
    26232600
    2624     if (gVRDEServer)
    2625         rc = gVRDEServer->COMSETTER(Enabled)(FALSE);
     2601    if (gpVRDEServer)
     2602        rc = gpVRDEServer->COMSETTER(Enabled)(FALSE);
    26262603
    26272604    /*
    26282605     * Get the machine state.
    26292606     */
    2630     if (gMachine)
    2631         gMachine->COMGETTER(State)(&machineState);
     2607    if (gpMachine)
     2608        gpMachine->COMGETTER(State)(&machineState);
    26322609    else
    26332610        machineState = MachineState_Aborted;
     
    26362613     * Turn off the VM if it's running
    26372614     */
    2638     if (   gConsole
     2615    if (   gpConsole
    26392616        && (   machineState == MachineState_Running
    26402617            || machineState == MachineState_Teleporting
     
    26452622    do
    26462623    {
    2647         consoleListener->getWrapped()->ignorePowerOffEvents(true);
    2648         ComPtr<IProgress> progress;
    2649         CHECK_ERROR_BREAK(gConsole, PowerDown(progress.asOutParam()));
    2650         CHECK_ERROR_BREAK(progress, WaitForCompletion(-1));
     2624        pConsoleListener->getWrapped()->ignorePowerOffEvents(true);
     2625        ComPtr<IProgress> pProgress;
     2626        CHECK_ERROR_BREAK(gpConsole, PowerDown(pProgress.asOutParam()));
     2627        CHECK_ERROR_BREAK(pProgress, WaitForCompletion(-1));
    26512628        BOOL completed;
    2652         CHECK_ERROR_BREAK(progress, COMGETTER(Completed)(&completed));
     2629        CHECK_ERROR_BREAK(pProgress, COMGETTER(Completed)(&completed));
    26532630        ASSERT(completed);
    26542631        LONG hrc;
    2655         CHECK_ERROR_BREAK(progress, COMGETTER(ResultCode)(&hrc));
     2632        CHECK_ERROR_BREAK(pProgress, COMGETTER(ResultCode)(&hrc));
    26562633        if (FAILED(hrc))
    26572634        {
     
    26662643    } while (0);
    26672644
    2668     /* unregister console listener */
    2669     if (consoleListener)
    2670     {
    2671         ComPtr<IEventSource> es;
    2672         CHECK_ERROR(gConsole, COMGETTER(EventSource)(es.asOutParam()));
    2673         CHECK_ERROR(es, UnregisterListener(consoleListener));
    2674         consoleListener->Release();
    2675         consoleListener = NULL;
     2645    /* unregister Console listener */
     2646    if (pConsoleListener)
     2647    {
     2648        ComPtr<IEventSource> pES;
     2649        CHECK_ERROR(gpConsole, COMGETTER(EventSource)(pES.asOutParam()));
     2650        if (!pES.isNull())
     2651            CHECK_ERROR(pES, UnregisterListener(pConsoleListener));
     2652        pConsoleListener->Release();
     2653        pConsoleListener = NULL;
    26762654    }
    26772655
     
    26802658     * not be flushed to the permanent configuration
    26812659     */
    2682     if (   gMachine
     2660    if (   gpMachine
    26832661        && machineState != MachineState_Saved)
    26842662    {
    2685         rc = gMachine->DiscardSettings();
     2663        rc = gpMachine->DiscardSettings();
    26862664        AssertComRC(rc);
    26872665    }
     
    26902668    if (sessionOpened)
    26912669    {
    2692         rc = session->UnlockMachine();
     2670        rc = pSession->UnlockMachine();
    26932671        AssertComRC(rc);
    26942672    }
     
    27322710
    27332711    LogFlow(("Releasing mouse, keyboard, remote desktop server, display, console...\n"));
    2734     if (gDisplay)
     2712    if (gpDisplay)
    27352713    {
    27362714        for (unsigned i = 0; i < gcMonitors; i++)
    2737             gDisplay->SetFramebuffer(i, NULL);
    2738     }
    2739 
    2740     gMouse = NULL;
    2741     gKeyboard = NULL;
    2742     gVRDEServer = NULL;
    2743     gDisplay = NULL;
    2744     gConsole = NULL;
    2745     gMachineDebugger = NULL;
    2746     gProgress = NULL;
     2715            gpDisplay->SetFramebuffer(i, NULL);
     2716    }
     2717
     2718    gpMouse = NULL;
     2719    gpKeyboard = NULL;
     2720    gpVRDEServer = NULL;
     2721    gpDisplay = NULL;
     2722    gpConsole = NULL;
     2723    gpMachineDebugger = NULL;
     2724    gpProgress = NULL;
    27472725    // we can only uninitialize SDL here because it is not threadsafe
    27482726
     
    27652743#endif
    27662744
    2767     /* global listener unregistration. */
    2768     if (vboxListener)
    2769     {
    2770         ComPtr<IEventSource> es;
    2771         CHECK_ERROR(virtualBox, COMGETTER(EventSource)(es.asOutParam()));
    2772         CHECK_ERROR(es, UnregisterListener(vboxListener));
    2773         vboxListener->Release();
    2774         vboxListener = NULL;
    2775     }
     2745    /* VirtualBox (server) listener unregistration. */
     2746    if (pVBoxListener)
     2747    {
     2748        ComPtr<IEventSource> pES;
     2749        CHECK_ERROR(pVirtualBox, COMGETTER(EventSource)(pES.asOutParam()));
     2750        if (!pES.isNull())
     2751            CHECK_ERROR(pES, UnregisterListener(pVBoxListener));
     2752        pVBoxListener->Release();
     2753        pVBoxListener = NULL;
     2754    }
     2755
    27762756    LogFlow(("Releasing machine, session...\n"));
    2777     gMachine = NULL;
    2778     session = NULL;
     2757    gpMachine = NULL;
     2758    pSession = NULL;
    27792759    LogFlow(("Releasing VirtualBox object...\n"));
    2780     virtualBox = NULL;
     2760    pVirtualBox = NULL;
    27812761
    27822762    // end "all-stuff" scope
     
    33113291    int i;
    33123292
    3313     if (!gKeyboard)
     3293    if (!gpKeyboard)
    33143294        return;
    33153295
     
    33193299        {
    33203300            if (i & 0x80)
    3321                 gKeyboard->PutScancode(0xe0);
    3322             gKeyboard->PutScancode(i | 0x80);
     3301                gpKeyboard->PutScancode(0xe0);
     3302            gpKeyboard->PutScancode(i | 0x80);
    33233303            gaModifiersState[i] = 0;
    33243304        }
     
    33343314{
    33353315#if (defined(DEBUG) || defined(VBOX_WITH_STATISTICS)) && !defined(VBOX_WITH_SDL13)
    3336     if (gMachineDebugger && ev->type == SDL_KEYDOWN)
     3316    if (gpMachineDebugger && ev->type == SDL_KEYDOWN)
    33373317    {
    33383318        // first handle the debugger hotkeys
     
    33503330                case SDLK_F12:
    33513331                    RTPrintf("ResetStats\n"); /* Visual feedback in console window */
    3352                     gMachineDebugger->ResetStats(NULL);
     3332                    gpMachineDebugger->ResetStats(NULL);
    33533333                    break;
    33543334                // pressing CTRL+ALT+F12 resets all statistics counter
    33553335                case SDLK_F11:
    3356                     gMachineDebugger->DumpStats(NULL);
     3336                    gpMachineDebugger->DumpStats(NULL);
    33573337                    RTPrintf("DumpStats\n");  /* Vistual feedback in console window */
    33583338                    break;
     
    33703350                    {
    33713351                        BOOL recompileSupervisor;
    3372                         gMachineDebugger->COMGETTER(RecompileSupervisor)(&recompileSupervisor);
    3373                         gMachineDebugger->COMSETTER(RecompileSupervisor)(!recompileSupervisor);
     3352                        gpMachineDebugger->COMGETTER(RecompileSupervisor)(&recompileSupervisor);
     3353                        gpMachineDebugger->COMSETTER(RecompileSupervisor)(!recompileSupervisor);
    33743354                        break;
    33753355                    }
     
    33783358                    {
    33793359                        BOOL recompileUser;
    3380                         gMachineDebugger->COMGETTER(RecompileUser)(&recompileUser);
    3381                         gMachineDebugger->COMSETTER(RecompileUser)(!recompileUser);
     3360                        gpMachineDebugger->COMGETTER(RecompileUser)(&recompileUser);
     3361                        gpMachineDebugger->COMSETTER(RecompileUser)(!recompileUser);
    33823362                        break;
    33833363                    }
     
    33863366                    {
    33873367                        BOOL patmEnabled;
    3388                         gMachineDebugger->COMGETTER(PATMEnabled)(&patmEnabled);
    3389                         gMachineDebugger->COMSETTER(PATMEnabled)(!patmEnabled);
     3368                        gpMachineDebugger->COMGETTER(PATMEnabled)(&patmEnabled);
     3369                        gpMachineDebugger->COMSETTER(PATMEnabled)(!patmEnabled);
    33903370                        break;
    33913371                    }
     
    33943374                    {
    33953375                        BOOL csamEnabled;
    3396                         gMachineDebugger->COMGETTER(CSAMEnabled)(&csamEnabled);
    3397                         gMachineDebugger->COMSETTER(CSAMEnabled)(!csamEnabled);
     3376                        gpMachineDebugger->COMGETTER(CSAMEnabled)(&csamEnabled);
     3377                        gpMachineDebugger->COMSETTER(CSAMEnabled)(!csamEnabled);
    33983378                        break;
    33993379                    }
     
    34023382                    {
    34033383                        BOOL singlestepEnabled;
    3404                         gMachineDebugger->COMGETTER(Singlestep)(&singlestepEnabled);
    3405                         gMachineDebugger->COMSETTER(Singlestep)(!singlestepEnabled);
     3384                        gpMachineDebugger->COMGETTER(Singlestep)(&singlestepEnabled);
     3385                        gpMachineDebugger->COMSETTER(Singlestep)(!singlestepEnabled);
    34063386                        break;
    34073387                    }
     
    34153395        {
    34163396            BOOL logEnabled = TRUE;
    3417             gMachineDebugger->COMGETTER(LogEnabled)(&logEnabled);
    3418             gMachineDebugger->COMSETTER(LogEnabled)(!logEnabled);
     3397            gpMachineDebugger->COMGETTER(LogEnabled)(&logEnabled);
     3398            gpMachineDebugger->COMSETTER(LogEnabled)(!logEnabled);
    34193399#ifdef DEBUG_bird
    34203400            return;
     
    34383418        if (ev->type == SDL_KEYUP)
    34393419            v |= 0x80;
    3440         gKeyboard->PutScancode(0xe1);
    3441         gKeyboard->PutScancode(0x1d | v);
    3442         gKeyboard->PutScancode(0x45 | v);
     3420        gpKeyboard->PutScancode(0xe1);
     3421        gpKeyboard->PutScancode(0x1d | v);
     3422        gpKeyboard->PutScancode(0x45 | v);
    34433423        return;
    34443424    }
     
    34813461            if (ev->type == SDL_KEYDOWN || ev->type == SDL_KEYUP)
    34823462            {
    3483                 gKeyboard->PutScancode(keycode);
    3484                 gKeyboard->PutScancode(keycode | 0x80);
     3463                gpKeyboard->PutScancode(keycode);
     3464                gpKeyboard->PutScancode(keycode | 0x80);
    34853465            }
    34863466            return;
     
    35033483        {
    35043484            gcGuestNumLockAdaptions--;
    3505             gKeyboard->PutScancode(0x45);
    3506             gKeyboard->PutScancode(0x45 | 0x80);
     3485            gpKeyboard->PutScancode(0x45);
     3486            gpKeyboard->PutScancode(0x45 | 0x80);
    35073487        }
    35083488        if (   gcGuestCapsLockAdaptions
     
    35103490        {
    35113491            gcGuestCapsLockAdaptions--;
    3512             gKeyboard->PutScancode(0x3a);
    3513             gKeyboard->PutScancode(0x3a | 0x80);
     3492            gpKeyboard->PutScancode(0x3a);
     3493            gpKeyboard->PutScancode(0x3a | 0x80);
    35143494        }
    35153495    }
     
    35193499     */
    35203500    if (keycode & 0x100)
    3521         gKeyboard->PutScancode(0xe0);
    3522 
    3523     gKeyboard->PutScancode(ev->type == SDL_KEYUP ? (keycode & 0x7f) | 0x80
     3501        gpKeyboard->PutScancode(0xe0);
     3502
     3503    gpKeyboard->PutScancode(ev->type == SDL_KEYUP ? (keycode & 0x7f) | 0x80
    35243504                                                 : (keycode & 0x7f));
    35253505}
     
    37773757             * or state it in PutMouseEventAbsolute() docs?
    37783758             */
    3779             gMouse->PutMouseEventAbsolute(x + 1 - xMin + xOrigin,
    3780                                           y + 1 - yMin + yOrigin,
    3781                                           dz, 0 /* horizontal scroll wheel */,
    3782                                           buttons | tmp_button);
     3759            gpMouse->PutMouseEventAbsolute(x + 1 - xMin + xOrigin,
     3760                                           y + 1 - yMin + yOrigin,
     3761                                           dz, 0 /* horizontal scroll wheel */,
     3762                                           buttons | tmp_button);
    37833763        }
    37843764        else
    37853765        {
    3786             gMouse->PutMouseEvent(0, 0, dz,
    3787                                   0 /* horizontal scroll wheel */,
    3788                                   buttons | tmp_button);
     3766            gpMouse->PutMouseEvent(0, 0, dz,
     3767                                   0 /* horizontal scroll wheel */,
     3768                                   buttons | tmp_button);
    37893769        }
    37903770    }
     
    37993779         * or state it in PutMouseEventAbsolute() docs?
    38003780         */
    3801         gMouse->PutMouseEventAbsolute(x + 1 - xMin + xOrigin,
    3802                                       y + 1 - yMin + yOrigin,
    3803                                       dz, 0 /* Horizontal wheel */, buttons);
     3781        gpMouse->PutMouseEventAbsolute(x + 1 - xMin + xOrigin,
     3782                                       y + 1 - yMin + yOrigin,
     3783                                       dz, 0 /* Horizontal wheel */, buttons);
    38043784    }
    38053785    else
    38063786    {
    3807         gMouse->PutMouseEvent(x, y, dz, 0 /* Horizontal wheel */, buttons);
     3787        gpMouse->PutMouseEvent(x, y, dz, 0 /* Horizontal wheel */, buttons);
    38083788    }
    38093789}
     
    38143794void ResetVM(void)
    38153795{
    3816     if (gConsole)
    3817         gConsole->Reset();
     3796    if (gpConsole)
     3797        gpConsole->Reset();
    38183798}
    38193799
     
    38293809    RTThreadYield();
    38303810    UpdateTitlebar(TITLEBAR_SAVE);
    3831     gProgress = NULL;
    3832     HRESULT rc = gConsole->SaveState(gProgress.asOutParam());
     3811    gpProgress = NULL;
     3812    HRESULT rc = gpConsole->SaveState(gpProgress.asOutParam());
    38333813    if (FAILED(rc))
    38343814    {
     
    38363816        return;
    38373817    }
    3838     Assert(gProgress);
     3818    Assert(gpProgress);
    38393819
    38403820    /*
     
    38473827    {
    38483828        BOOL fCompleted = false;
    3849         rc = gProgress->COMGETTER(Completed)(&fCompleted);
     3829        rc = gpProgress->COMGETTER(Completed)(&fCompleted);
    38503830        if (FAILED(rc) || fCompleted)
    38513831            break;
    38523832        ULONG cPercentNow;
    3853         rc = gProgress->COMGETTER(Percent)(&cPercentNow);
     3833        rc = gpProgress->COMGETTER(Percent)(&cPercentNow);
    38543834        if (FAILED(rc))
    38553835            break;
     
    38613841
    38623842        /* wait */
    3863         rc = gProgress->WaitForCompletion(100);
     3843        rc = gpProgress->WaitForCompletion(100);
    38643844        if (FAILED(rc))
    38653845            break;
     
    38793859         */
    38803860        BOOL fCompleted = false;
    3881         rc = gProgress->COMGETTER(Completed)(&fCompleted);
     3861        rc = gpProgress->COMGETTER(Completed)(&fCompleted);
    38823862        if (FAILED(rc) || fCompleted)
    38833863            break;
    38843864        ULONG cPercentNow;
    3885         rc = gProgress->COMGETTER(Percent)(&cPercentNow);
     3865        rc = gpProgress->COMGETTER(Percent)(&cPercentNow);
    38863866        if (FAILED(rc))
    38873867            break;
     
    39433923     */
    39443924    LONG lrc;
    3945     rc = gProgress->COMGETTER(ResultCode)(&lrc);
     3925    rc = gpProgress->COMGETTER(ResultCode)(&lrc);
    39463926    if (FAILED(rc))
    39473927        lrc = ~0;
     
    39673947    strcpy(szPrevTitle, szTitle);
    39683948
    3969     Bstr name;
    3970     gMachine->COMGETTER(Name)(name.asOutParam());
     3949    Bstr bstrName;
     3950    gpMachine->COMGETTER(Name)(bstrName.asOutParam());
    39713951
    39723952    RTStrPrintf(szTitle, sizeof(szTitle), "%s - " VBOX_PRODUCT,
    3973                 !name.isEmpty() ? Utf8Str(name).c_str() : "<noname>");
     3953                !bstrName.isEmpty() ? Utf8Str(bstrName).c_str() : "<noname>");
    39743954
    39753955    /* which mode are we in? */
     
    39793959        {
    39803960            MachineState_T machineState;
    3981             gMachine->COMGETTER(State)(&machineState);
     3961            gpMachine->COMGETTER(State)(&machineState);
    39823962            if (machineState == MachineState_Paused)
    39833963                RTStrPrintf(szTitle + strlen(szTitle), sizeof(szTitle) - strlen(szTitle), " - [Paused]");
     
    39883968#if defined(DEBUG) || defined(VBOX_WITH_STATISTICS)
    39893969            // do we have a debugger interface
    3990             if (gMachineDebugger)
     3970            if (gpMachineDebugger)
    39913971            {
    39923972                // query the machine state
     
    39993979                BOOL hwVirtEnabled = FALSE;
    40003980                ULONG virtualTimeRate = 100;
    4001                 gMachineDebugger->COMGETTER(RecompileSupervisor)(&recompileSupervisor);
    4002                 gMachineDebugger->COMGETTER(RecompileUser)(&recompileUser);
    4003                 gMachineDebugger->COMGETTER(PATMEnabled)(&patmEnabled);
    4004                 gMachineDebugger->COMGETTER(CSAMEnabled)(&csamEnabled);
    4005                 gMachineDebugger->COMGETTER(LogEnabled)(&logEnabled);
    4006                 gMachineDebugger->COMGETTER(Singlestep)(&singlestepEnabled);
    4007                 gMachineDebugger->COMGETTER(HWVirtExEnabled)(&hwVirtEnabled);
    4008                 gMachineDebugger->COMGETTER(VirtualTimeRate)(&virtualTimeRate);
     3981                gpMachineDebugger->COMGETTER(RecompileSupervisor)(&recompileSupervisor);
     3982                gpMachineDebugger->COMGETTER(RecompileUser)(&recompileUser);
     3983                gpMachineDebugger->COMGETTER(PATMEnabled)(&patmEnabled);
     3984                gpMachineDebugger->COMGETTER(CSAMEnabled)(&csamEnabled);
     3985                gpMachineDebugger->COMGETTER(LogEnabled)(&logEnabled);
     3986                gpMachineDebugger->COMGETTER(Singlestep)(&singlestepEnabled);
     3987                gpMachineDebugger->COMGETTER(HWVirtExEnabled)(&hwVirtEnabled);
     3988                gpMachineDebugger->COMGETTER(VirtualTimeRate)(&virtualTimeRate);
    40093989                RTStrPrintf(szTitle + strlen(szTitle), sizeof(szTitle) - strlen(szTitle),
    40103990                            " [STEP=%d CS=%d PAT=%d RR0=%d RR3=%d LOG=%d HWVirt=%d",
     
    40284008             */
    40294009            MachineState_T machineState;
    4030             gMachine->COMGETTER(State)(&machineState);
     4010            gpMachine->COMGETTER(State)(&machineState);
    40314011            if (machineState == MachineState_Starting)
    40324012                RTStrPrintf(szTitle + strlen(szTitle), sizeof(szTitle) - strlen(szTitle),
     
    40354015            {
    40364016                ULONG cPercentNow;
    4037                 HRESULT rc = gProgress->COMGETTER(Percent)(&cPercentNow);
     4017                HRESULT rc = gpProgress->COMGETTER(Percent)(&cPercentNow);
    40384018                if (SUCCEEDED(rc))
    40394019                    RTStrPrintf(szTitle + strlen(szTitle), sizeof(szTitle) - strlen(szTitle),
     
    40464026            {
    40474027                ULONG cPercentNow;
    4048                 HRESULT rc = gProgress->COMGETTER(Percent)(&cPercentNow);
     4028                HRESULT rc = gpProgress->COMGETTER(Percent)(&cPercentNow);
    40494029                if (SUCCEEDED(rc))
    40504030                    RTStrPrintf(szTitle + strlen(szTitle), sizeof(szTitle) - strlen(szTitle),
     
    40964076
    40974077#if 0
    4098 static void vbox_show_shape (unsigned short w, unsigned short h,
    4099                              uint32_t bg, const uint8_t *image)
     4078static void vbox_show_shape(unsigned short w, unsigned short h,
     4079                            uint32_t bg, const uint8_t *image)
    41004080{
    41014081    size_t x, y;
     
    44284408        gpOffCursor = NULL;
    44294409    }
    4430     if (gMouse && UseAbsoluteMouse())
     4410    if (gpMouse && UseAbsoluteMouse())
    44314411    {
    44324412        // Actually switch to absolute coordinates
    44334413        if (gfGrabbed)
    44344414            InputGrabEnd();
    4435         gMouse->PutMouseEventAbsolute(-1, -1, 0, 0, 0);
     4415        gpMouse->PutMouseEventAbsolute(-1, -1, 0, 0, 0);
    44364416    }
    44374417}
     
    44564436        case SDLK_DELETE:
    44574437        {
    4458             gKeyboard->PutCAD();
     4438            gpKeyboard->PutCAD();
    44594439            break;
    44604440        }
     
    44754455             */
    44764456            MachineState_T machineState;
    4477             gMachine->COMGETTER(State)(&machineState);
     4457            gpMachine->COMGETTER(State)(&machineState);
    44784458            bool fPauseIt = machineState == MachineState_Running
    44794459                         || machineState == MachineState_Teleporting
    44804460                         || machineState == MachineState_LiveSnapshotting;
    44814461            if (fPauseIt)
    4482                 gConsole->Pause();
     4462                gpConsole->Pause();
    44834463            SetFullscreen(!gpFramebuffer[0]->getFullscreen());
    44844464            if (fPauseIt)
    4485                 gConsole->Resume();
     4465                gpConsole->Resume();
    44864466
    44874467            /*
     
    44894469             * screen repaint, just to be sure.
    44904470             */
    4491             gDisplay->InvalidateAndUpdate();
     4471            gpDisplay->InvalidateAndUpdate();
    44924472            break;
    44934473        }
     
    45024482
    45034483            MachineState_T machineState;
    4504             gMachine->COMGETTER(State)(&machineState);
     4484            gpMachine->COMGETTER(State)(&machineState);
    45054485            if (   machineState == MachineState_Running
    45064486                || machineState == MachineState_Teleporting
     
    45104490                if (gfGrabbed)
    45114491                    InputGrabEnd();
    4512                 gConsole->Pause();
     4492                gpConsole->Pause();
    45134493            }
    45144494            else if (machineState == MachineState_Paused)
    45154495            {
    4516                 gConsole->Resume();
     4496                gpConsole->Resume();
    45174497            }
    45184498            UpdateTitlebar(TITLEBAR_NORMAL);
     
    45604540                return VERR_NOT_SUPPORTED;
    45614541
    4562             if (gConsole)
    4563                 gConsole->PowerButton();
     4542            if (gpConsole)
     4543                gpConsole->PowerButton();
    45644544            break;
    45654545        }
     
    45754555            RTThreadYield();
    45764556            ULONG cSnapshots = 0;
    4577             gMachine->COMGETTER(SnapshotCount)(&cSnapshots);
     4557            gpMachine->COMGETTER(SnapshotCount)(&cSnapshots);
    45784558            char pszSnapshotName[20];
    45794559            RTStrPrintf(pszSnapshotName, sizeof(pszSnapshotName), "Snapshot %d", cSnapshots + 1);
    4580             gProgress = NULL;
     4560            gpProgress = NULL;
    45814561            HRESULT rc;
    4582             CHECK_ERROR(gConsole, TakeSnapshot(Bstr(pszSnapshotName).raw(),
    4583                                                Bstr("Taken by VBoxSDL").raw(),
    4584                                                gProgress.asOutParam()));
     4562            CHECK_ERROR(gpConsole, TakeSnapshot(Bstr(pszSnapshotName).raw(),
     4563                                                Bstr("Taken by VBoxSDL").raw(),
     4564                                                gpProgress.asOutParam()));
    45854565            if (FAILED(rc))
    45864566            {
     
    45974577            {
    45984578                BOOL fCompleted = false;
    4599                 rc = gProgress->COMGETTER(Completed)(&fCompleted);
     4579                rc = gpProgress->COMGETTER(Completed)(&fCompleted);
    46004580                if (FAILED(rc) || fCompleted)
    46014581                    break;
    46024582                ULONG cPercentNow;
    4603                 rc = gProgress->COMGETTER(Percent)(&cPercentNow);
     4583                rc = gpProgress->COMGETTER(Percent)(&cPercentNow);
    46044584                if (FAILED(rc))
    46054585                    break;
     
    46114591
    46124592                /* wait */
    4613                 rc = gProgress->WaitForCompletion(100);
     4593                rc = gpProgress->WaitForCompletion(100);
    46144594                if (FAILED(rc))
    46154595                    break;
     
    46364616            keys[5] = 0x9d;  // Ctrl up
    46374617
    4638             gKeyboard->PutScancodes(ComSafeArrayAsInParam(keys), NULL);
     4618            gpKeyboard->PutScancodes(ComSafeArrayAsInParam(keys), NULL);
    46394619            return VINF_SUCCESS;
    46404620        }
     
    46874667
    46884668    gSdlQuitTimer = NULL;
    4689     if (gConsole)
    4690     {
    4691         int rc = gConsole->GetPowerButtonHandled(&fHandled);
     4669    if (gpConsole)
     4670    {
     4671        int rc = gpConsole->GetPowerButtonHandled(&fHandled);
    46924672        LogRel(("QuitTimer: rc=%d handled=%d\n", rc, fHandled));
    46934673        if (RT_FAILURE(rc) || !fHandled)
     
    47474727    }
    47484728    LogRel(("WARNING: Failed to enqueue SDL event %d.%d!\n",
    4749            event->type, event->type == SDL_USEREVENT ? event->user.type : 0));
     4729            event->type, event->type == SDL_USEREVENT ? event->user.type : 0));
    47504730    return -1;
    47514731}
     
    48234803            gpFramebuffer[0]->setFullscreen(enable);
    48244804            gfIgnoreNextResize = TRUE;
    4825             gDisplay->SetVideoModeHint(NewWidth, NewHeight, 0, 0);
     4805            gpDisplay->SetVideoModeHint(NewWidth, NewHeight, 0, 0);
    48264806        }
    48274807    }
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette