VirtualBox

Ignore:
Timestamp:
Aug 8, 2008 4:24:48 PM (16 years ago)
Author:
vboxsync
Message:

Devices: pData -> pThis.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/VMMDev/VBoxDev.cpp

    r11267 r11269  
    284284static DECLCALLBACK(int) vmmdevBackdoorLog(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb)
    285285{
    286     VMMDevState *pData = PDMINS_2_DATA(pDevIns, VMMDevState *);
    287 
    288     if (!pData->fBackdoorLogDisabled && cb == 1 && Port == RTLOG_DEBUG_PORT)
     286    VMMDevState *pThis = PDMINS_2_DATA(pDevIns, VMMDevState *);
     287
     288    if (!pThis->fBackdoorLogDisabled && cb == 1 && Port == RTLOG_DEBUG_PORT)
    289289    {
    290290
     
    301301        if (u32 == '\n' || u32 == '\r')
    302302        {
    303             pData->szMsg[pData->iMsg] = '\0';
    304             if (pData->iMsg)
    305                 LogRel(("Guest Log: %s\n", pData->szMsg));
    306             pData->iMsg = 0;
     303            pThis->szMsg[pThis->iMsg] = '\0';
     304            if (pThis->iMsg)
     305                LogRel(("Guest Log: %s\n", pThis->szMsg));
     306            pThis->iMsg = 0;
    307307        }
    308308        else
    309309        {
    310             if (pData->iMsg >= sizeof(pData->szMsg)-1)
    311             {
    312                 pData->szMsg[pData->iMsg] = '\0';
    313                 LogRel(("Guest Log: %s\n", pData->szMsg));
    314                 pData->iMsg = 0;
    315             }
    316             pData->szMsg[pData->iMsg] = (char )u32;
    317             pData->szMsg[++pData->iMsg] = '\0';
     310            if (pThis->iMsg >= sizeof(pThis->szMsg)-1)
     311            {
     312                pThis->szMsg[pThis->iMsg] = '\0';
     313                LogRel(("Guest Log: %s\n", pThis->szMsg));
     314                pThis->iMsg = 0;
     315            }
     316            pThis->szMsg[pThis->iMsg] = (char )u32;
     317            pThis->szMsg[++pThis->iMsg] = '\0';
    318318        }
    319319    }
     
    340340    if (cb == 4)
    341341    {
    342         VMMDevState *pData = PDMINS_2_DATA(pDevIns, VMMDevState *);
     342        VMMDevState *pThis = PDMINS_2_DATA(pDevIns, VMMDevState *);
    343343        switch (u32)
    344344        {
    345345            case 0:
    346                 pData->fTimesyncBackdoorLo = false;
     346                pThis->fTimesyncBackdoorLo = false;
    347347                break;
    348348            case 1:
    349                 pData->fTimesyncBackdoorLo = true;
     349                pThis->fTimesyncBackdoorLo = true;
    350350        }
    351351        return VINF_SUCCESS;
     
    372372    if (cb == 4)
    373373    {
    374         VMMDevState *pData = PDMINS_2_DATA(pDevIns, VMMDevState *);
     374        VMMDevState *pThis = PDMINS_2_DATA(pDevIns, VMMDevState *);
    375375        RTTIMESPEC now;
    376376
    377         if (pData->fTimesyncBackdoorLo)
    378         {
    379             *pu32 = (uint32_t)(pData->hostTime & (uint64_t)0xFFFFFFFF);
     377        if (pThis->fTimesyncBackdoorLo)
     378        {
     379            *pu32 = (uint32_t)(pThis->hostTime & (uint64_t)0xFFFFFFFF);
    380380        }
    381381        else
    382382        {
    383             pData->hostTime = RTTimeSpecGetMilli(PDMDevHlpUTCNow(pDevIns, &now));
    384             *pu32 = (uint32_t)(pData->hostTime >> 32);
     383            pThis->hostTime = RTTimeSpecGetMilli(PDMDevHlpUTCNow(pDevIns, &now));
     384            *pu32 = (uint32_t)(pThis->hostTime >> 32);
    385385        }
    386386        rc = VINF_SUCCESS;
     
    398398static DECLCALLBACK(int) vmmdevRequestHandler(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb)
    399399{
    400     VMMDevState *pData = (VMMDevState*)pvUser;
     400    VMMDevState *pThis = (VMMDevState*)pvUser;
    401401    int rcRet = VINF_SUCCESS;
    402402
     
    429429
    430430    if (    requestHeader.requestType != VMMDevReq_ReportGuestInfo
    431         && !pData->fu32AdditionsOk)
     431        && !pThis->fu32AdditionsOk)
    432432    {
    433433        Log(("VMMDev: guest has not yet reported to us. Refusing operation.\n"));
     
    484484                VMMDevReportGuestInfo *guestInfo = (VMMDevReportGuestInfo*)pRequestHeader;
    485485
    486                 if (memcmp (&pData->guestInfo, &guestInfo->guestInfo, sizeof (guestInfo->guestInfo)) != 0)
     486                if (memcmp (&pThis->guestInfo, &guestInfo->guestInfo, sizeof (guestInfo->guestInfo)) != 0)
    487487                {
    488488                    /* make a copy of supplied information */
    489                     pData->guestInfo = guestInfo->guestInfo;
     489                    pThis->guestInfo = guestInfo->guestInfo;
    490490
    491491                    /* Check additions version */
    492                     pData->fu32AdditionsOk = VBOX_GUEST_ADDITIONS_VERSION_OK(pData->guestInfo.additionsVersion);
     492                    pThis->fu32AdditionsOk = VBOX_GUEST_ADDITIONS_VERSION_OK(pThis->guestInfo.additionsVersion);
    493493
    494494                    LogRel(("Guest Additions information report: additionsVersion = 0x%08X  osType = 0x%08X\n",
    495                             pData->guestInfo.additionsVersion,
    496                             pData->guestInfo.osType));
    497                     pData->pDrv->pfnUpdateGuestVersion(pData->pDrv, &pData->guestInfo);
    498                 }
    499 
    500                 if (pData->fu32AdditionsOk)
     495                            pThis->guestInfo.additionsVersion,
     496                            pThis->guestInfo.osType));
     497                    pThis->pDrv->pfnUpdateGuestVersion(pThis->pDrv, &pThis->guestInfo);
     498                }
     499
     500                if (pThis->fu32AdditionsOk)
    501501                {
    502502                    pRequestHeader->rc = VINF_SUCCESS;
     
    526526                /** @todo change this when we next bump the interface version */
    527527                guestCaps->caps |= VMMDEV_GUEST_SUPPORTS_GRAPHICS;
    528                 if (pData->guestCaps != guestCaps->caps)
     528                if (pThis->guestCaps != guestCaps->caps)
    529529                {
    530530                    /* make a copy of supplied information */
    531                     pData->guestCaps = guestCaps->caps;
     531                    pThis->guestCaps = guestCaps->caps;
    532532
    533533                    LogRel(("Guest Additions capability report: (0x%x) "
     
    540540                            guestCaps->caps & VMMDEV_GUEST_SUPPORTS_GRAPHICS ? "yes" : "no"));
    541541
    542                     pData->pDrv->pfnUpdateGuestCapabilities(pData->pDrv, guestCaps->caps);
     542                    pThis->pDrv->pfnUpdateGuestCapabilities(pThis->pDrv, guestCaps->caps);
    543543                }
    544544                pRequestHeader->rc = VINF_SUCCESS;
     
    559559                VMMDevReqGuestCapabilities2 *guestCaps = (VMMDevReqGuestCapabilities2*)pRequestHeader;
    560560
    561                 pData->guestCaps |= guestCaps->u32OrMask;
    562                 pData->guestCaps &= ~guestCaps->u32NotMask;
     561                pThis->guestCaps |= guestCaps->u32OrMask;
     562                pThis->guestCaps &= ~guestCaps->u32NotMask;
    563563
    564564                LogRel(("Guest Additions capability report: (0x%x) "
     
    566566                        "hostWindowMapping: %s, "
    567567                        "graphics: %s\n",
    568                         pData->guestCaps,
    569                         pData->guestCaps & VMMDEV_GUEST_SUPPORTS_SEAMLESS ? "yes" : "no",
    570                         pData->guestCaps & VMMDEV_GUEST_SUPPORTS_GUEST_HOST_WINDOW_MAPPING ? "yes" : "no",
    571                         pData->guestCaps & VMMDEV_GUEST_SUPPORTS_GRAPHICS ? "yes" : "no"));
    572 
    573                 pData->pDrv->pfnUpdateGuestCapabilities(pData->pDrv, pData->guestCaps);
     568                        pThis->guestCaps,
     569                        pThis->guestCaps & VMMDEV_GUEST_SUPPORTS_SEAMLESS ? "yes" : "no",
     570                        pThis->guestCaps & VMMDEV_GUEST_SUPPORTS_GUEST_HOST_WINDOW_MAPPING ? "yes" : "no",
     571                        pThis->guestCaps & VMMDEV_GUEST_SUPPORTS_GRAPHICS ? "yes" : "no"));
     572
     573                pThis->pDrv->pfnUpdateGuestCapabilities(pThis->pDrv, pThis->guestCaps);
    574574                pRequestHeader->rc = VINF_SUCCESS;
    575575            }
     
    591591                VMMDevReqMouseStatus *mouseStatus = (VMMDevReqMouseStatus*)pRequestHeader;
    592592                mouseStatus->mouseFeatures = 0;
    593                 if (pData->mouseCapabilities & VMMDEV_MOUSEHOSTWANTSABS)
     593                if (pThis->mouseCapabilities & VMMDEV_MOUSEHOSTWANTSABS)
    594594                {
    595595                    mouseStatus->mouseFeatures |= VBOXGUEST_MOUSE_HOST_CAN_ABSOLUTE;
    596596                }
    597                 if (pData->mouseCapabilities & VMMDEV_MOUSEGUESTWANTSABS)
     597                if (pThis->mouseCapabilities & VMMDEV_MOUSEGUESTWANTSABS)
    598598                {
    599599                    mouseStatus->mouseFeatures |= VBOXGUEST_MOUSE_GUEST_CAN_ABSOLUTE;
    600600                }
    601                 if (pData->mouseCapabilities & VMMDEV_MOUSEHOSTCANNOTHWPOINTER)
     601                if (pThis->mouseCapabilities & VMMDEV_MOUSEHOSTCANNOTHWPOINTER)
    602602                {
    603603                    mouseStatus->mouseFeatures |= VBOXGUEST_MOUSE_HOST_CANNOT_HWPOINTER;
    604604                }
    605                 mouseStatus->pointerXPos = pData->mouseXAbs;
    606                 mouseStatus->pointerYPos = pData->mouseYAbs;
     605                mouseStatus->pointerXPos = pThis->mouseXAbs;
     606                mouseStatus->pointerYPos = pThis->mouseYAbs;
    607607                Log2(("returning mouse status: features = %d, absX = %d, absY = %d\n", mouseStatus->mouseFeatures,
    608608                      mouseStatus->pointerXPos, mouseStatus->pointerYPos));
     
    633633                {
    634634                    /* set the capability flag and the changed flag if it's actually a change */
    635                     if (!(pData->mouseCapabilities & VMMDEV_MOUSEGUESTWANTSABS))
     635                    if (!(pThis->mouseCapabilities & VMMDEV_MOUSEGUESTWANTSABS))
    636636                    {
    637                         pData->mouseCapabilities |= VMMDEV_MOUSEGUESTWANTSABS;
     637                        pThis->mouseCapabilities |= VMMDEV_MOUSEGUESTWANTSABS;
    638638                        bCapsChanged = true;
    639639                        LogRel(("Guest requests mouse pointer integration\n"));
     
    641641                } else
    642642                {
    643                     if (pData->mouseCapabilities & VMMDEV_MOUSEGUESTWANTSABS)
     643                    if (pThis->mouseCapabilities & VMMDEV_MOUSEGUESTWANTSABS)
    644644                    {
    645                         pData->mouseCapabilities &= ~VMMDEV_MOUSEGUESTWANTSABS;
     645                        pThis->mouseCapabilities &= ~VMMDEV_MOUSEGUESTWANTSABS;
    646646                        bCapsChanged = true;
    647647                        LogRel(("Guest disables mouse pointer integration\n"));
     
    649649                }
    650650                if (mouseStatus->mouseFeatures & VBOXGUEST_MOUSE_GUEST_NEEDS_HOST_CURSOR)
    651                     pData->mouseCapabilities |= VMMDEV_MOUSEGUESTNEEDSHOSTCUR;
     651                    pThis->mouseCapabilities |= VMMDEV_MOUSEGUESTNEEDSHOSTCUR;
    652652                else
    653                     pData->mouseCapabilities &= ~VMMDEV_MOUSEGUESTNEEDSHOSTCUR;
     653                    pThis->mouseCapabilities &= ~VMMDEV_MOUSEGUESTNEEDSHOSTCUR;
    654654
    655655                /*
     
    658658                if (bCapsChanged)
    659659                {
    660                     Log(("VMMDevReq_SetMouseStatus: capabilities changed (%x), informing connector\n", pData->mouseCapabilities));
    661                     pData->pDrv->pfnUpdateMouseCapabilities(pData->pDrv, pData->mouseCapabilities);
     660                    Log(("VMMDevReq_SetMouseStatus: capabilities changed (%x), informing connector\n", pThis->mouseCapabilities));
     661                    pThis->pDrv->pfnUpdateMouseCapabilities(pThis->pDrv, pThis->mouseCapabilities);
    662662                }
    663663                pRequestHeader->rc = VINF_SUCCESS;
     
    699699                if (fShape)
    700700                {
    701                     pData->pDrv->pfnUpdatePointerShape(pData->pDrv,
     701                    pThis->pDrv->pfnUpdatePointerShape(pThis->pDrv,
    702702                                                       fVisible,
    703703                                                       fAlpha,
     
    708708                else
    709709                {
    710                     pData->pDrv->pfnUpdatePointerShape(pData->pDrv,
     710                    pThis->pDrv->pfnUpdatePointerShape(pThis->pDrv,
    711711                                                       fVisible,
    712712                                                       0,
     
    730730                pRequestHeader->rc = VERR_INVALID_PARAMETER;
    731731            }
    732             else if (RT_UNLIKELY(pData->fGetHostTimeDisabled))
     732            else if (RT_UNLIKELY(pThis->fGetHostTimeDisabled))
    733733                pRequestHeader->rc = VERR_NOT_SUPPORTED;
    734734            else
     
    863863                {
    864864                    /* Remember which resolution the client has queried, subsequent reads will return the same values. */
    865                     pData->lastReadDisplayChangeRequest = pData->displayChangeRequest;
     865                    pThis->lastReadDisplayChangeRequest = pThis->displayChangeRequest;
    866866                }
    867867
    868868                /* just pass on the information */
    869869                Log(("VMMDev: returning display change request xres = %d, yres = %d, bpp = %d\n",
    870                      pData->displayChangeRequest.xres, pData->displayChangeRequest.yres, pData->displayChangeRequest.bpp));
    871                 displayChangeRequest->xres = pData->lastReadDisplayChangeRequest.xres;
    872                 displayChangeRequest->yres = pData->lastReadDisplayChangeRequest.yres;
    873                 displayChangeRequest->bpp  = pData->lastReadDisplayChangeRequest.bpp;
     870                     pThis->displayChangeRequest.xres, pThis->displayChangeRequest.yres, pThis->displayChangeRequest.bpp));
     871                displayChangeRequest->xres = pThis->lastReadDisplayChangeRequest.xres;
     872                displayChangeRequest->yres = pThis->lastReadDisplayChangeRequest.yres;
     873                displayChangeRequest->bpp  = pThis->lastReadDisplayChangeRequest.bpp;
    874874
    875875                pRequestHeader->rc = VINF_SUCCESS;
     
    891891                {
    892892                    /* Remember which resolution the client has queried, subsequent reads will return the same values. */
    893                     pData->lastReadDisplayChangeRequest = pData->displayChangeRequest;
     893                    pThis->lastReadDisplayChangeRequest = pThis->displayChangeRequest;
    894894                }
    895895
    896896                /* just pass on the information */
    897897                Log(("VMMDev: returning display change request xres = %d, yres = %d, bpp = %d at %d\n",
    898                      pData->displayChangeRequest.xres, pData->displayChangeRequest.yres, pData->displayChangeRequest.bpp, pData->displayChangeRequest.display));
    899                 displayChangeRequest->xres    = pData->lastReadDisplayChangeRequest.xres;
    900                 displayChangeRequest->yres    = pData->lastReadDisplayChangeRequest.yres;
    901                 displayChangeRequest->bpp     = pData->lastReadDisplayChangeRequest.bpp;
    902                 displayChangeRequest->display = pData->lastReadDisplayChangeRequest.display;
     898                     pThis->displayChangeRequest.xres, pThis->displayChangeRequest.yres, pThis->displayChangeRequest.bpp, pThis->displayChangeRequest.display));
     899                displayChangeRequest->xres    = pThis->lastReadDisplayChangeRequest.xres;
     900                displayChangeRequest->yres    = pThis->lastReadDisplayChangeRequest.yres;
     901                displayChangeRequest->bpp     = pThis->lastReadDisplayChangeRequest.bpp;
     902                displayChangeRequest->display = pThis->lastReadDisplayChangeRequest.display;
    903903
    904904                pRequestHeader->rc = VINF_SUCCESS;
     
    921921                VMMDevVideoModeSupportedRequest *videoModeSupportedRequest = (VMMDevVideoModeSupportedRequest*)pRequestHeader;
    922922                /* forward the call */
    923                 pRequestHeader->rc = pData->pDrv->pfnVideoModeSupported(pData->pDrv,
     923                pRequestHeader->rc = pThis->pDrv->pfnVideoModeSupported(pThis->pDrv,
    924924                                                                       videoModeSupportedRequest->width,
    925925                                                                       videoModeSupportedRequest->height,
     
    944944                VMMDevGetHeightReductionRequest *heightReductionRequest = (VMMDevGetHeightReductionRequest*)pRequestHeader;
    945945                /* forward the call */
    946                 pRequestHeader->rc = pData->pDrv->pfnGetHeightReduction(pData->pDrv,
     946                pRequestHeader->rc = pThis->pDrv->pfnGetHeightReduction(pThis->pDrv,
    947947                                                                       &heightReductionRequest->heightReduction);
    948948            }
     
    962962            else
    963963            {
    964                 if (VBOX_GUEST_ADDITIONS_VERSION_1_03 (pData))
    965                 {
    966                     vmmdevSetIRQ_Legacy_EMT (pData);
     964                if (VBOX_GUEST_ADDITIONS_VERSION_1_03 (pThis))
     965                {
     966                    vmmdevSetIRQ_Legacy_EMT (pThis);
    967967                }
    968968                else
     
    970970                    VMMDevEvents *pAckRequest;
    971971
    972                     if (pData->fNewGuestFilterMask)
     972                    if (pThis->fNewGuestFilterMask)
    973973                    {
    974                         pData->fNewGuestFilterMask = false;
    975                         pData->u32GuestFilterMask = pData->u32NewGuestFilterMask;
     974                        pThis->fNewGuestFilterMask = false;
     975                        pThis->u32GuestFilterMask = pThis->u32NewGuestFilterMask;
    976976                    }
    977977
    978978                    pAckRequest = (VMMDevEvents *)pRequestHeader;
    979979                    pAckRequest->events =
    980                         pData->u32HostEventFlags & pData->u32GuestFilterMask;
    981 
    982                     pData->u32HostEventFlags &= ~pData->u32GuestFilterMask;
    983                     pData->pVMMDevRAMHC->V.V1_04.fHaveEvents = false;
    984                     PDMDevHlpPCISetIrqNoWait (pData->pDevIns, 0, 0);
     980                        pThis->u32HostEventFlags & pThis->u32GuestFilterMask;
     981
     982                    pThis->u32HostEventFlags &= ~pThis->u32GuestFilterMask;
     983                    pThis->pVMMDevRAMHC->V.V1_04.fHaveEvents = false;
     984                    PDMDevHlpPCISetIrqNoWait (pThis->pDevIns, 0, 0);
    985985                }
    986986                pRequestHeader->rc = VINF_SUCCESS;
     
    10071007                 * HGCM command is issued. The guest then can not disable these events.
    10081008                 */
    1009                 vmmdevCtlGuestFilterMask_EMT (pData,
     1009                vmmdevCtlGuestFilterMask_EMT (pThis,
    10101010                                              pCtlMaskRequest->u32OrMask,
    10111011                                              pCtlMaskRequest->u32NotMask & ~VMMDEV_EVENT_HGCM);
     
    10271027                pRequestHeader->rc = VERR_INVALID_PARAMETER;
    10281028            }
    1029             else if (!pData->pHGCMDrv)
     1029            else if (!pThis->pHGCMDrv)
    10301030            {
    10311031                Log(("VMMDevReq_HGCMConnect HGCM Connector is NULL!\n"));
     
    10381038                Log(("VMMDevReq_HGCMConnect\n"));
    10391039
    1040                 pRequestHeader->rc = vmmdevHGCMConnect (pData, pHGCMConnect, (RTGCPHYS)u32);
     1040                pRequestHeader->rc = vmmdevHGCMConnect (pThis, pHGCMConnect, (RTGCPHYS)u32);
    10411041            }
    10421042            break;
     
    10501050                pRequestHeader->rc = VERR_INVALID_PARAMETER;
    10511051            }
    1052             else if (!pData->pHGCMDrv)
     1052            else if (!pThis->pHGCMDrv)
    10531053            {
    10541054                Log(("VMMDevReq_HGCMDisconnect HGCM Connector is NULL!\n"));
     
    10601060
    10611061                Log(("VMMDevReq_VMMDevHGCMDisconnect\n"));
    1062                 pRequestHeader->rc = vmmdevHGCMDisconnect (pData, pHGCMDisconnect, (RTGCPHYS)u32);
     1062                pRequestHeader->rc = vmmdevHGCMDisconnect (pThis, pHGCMDisconnect, (RTGCPHYS)u32);
    10631063            }
    10641064            break;
     
    10771077                pRequestHeader->rc = VERR_INVALID_PARAMETER;
    10781078            }
    1079             else if (!pData->pHGCMDrv)
     1079            else if (!pThis->pHGCMDrv)
    10801080            {
    10811081                Log(("VMMDevReq_HGCMCall HGCM Connector is NULL!\n"));
     
    10951095#endif /* VBOX_WITH_64_BITS_GUESTS */
    10961096
    1097                 pRequestHeader->rc = vmmdevHGCMCall (pData, pHGCMCall, (RTGCPHYS)u32, f64Bits);
     1097                pRequestHeader->rc = vmmdevHGCMCall (pThis, pHGCMCall, (RTGCPHYS)u32, f64Bits);
    10981098            }
    10991099            break;
     
    11081108                pRequestHeader->rc = VERR_INVALID_PARAMETER;
    11091109            }
    1110             else if (!pData->pHGCMDrv)
     1110            else if (!pThis->pHGCMDrv)
    11111111            {
    11121112                Log(("VMMDevReq_HGCMCancel HGCM Connector is NULL!\n"));
     
    11181118
    11191119                Log(("VMMDevReq_VMMDevHGCMCancel\n"));
    1120                 pRequestHeader->rc = vmmdevHGCMCancel (pData, pHGCMCancel, (RTGCPHYS)u32);
     1120                pRequestHeader->rc = vmmdevHGCMCancel (pThis, pHGCMCancel, (RTGCPHYS)u32);
    11211121            }
    11221122            break;
     
    11301130                pRequestHeader->rc = VERR_INVALID_PARAMETER;
    11311131            }
    1132             else if (!pData->pDrv)
     1132            else if (!pThis->pDrv)
    11331133            {
    11341134                Log(("VMMDevReq_VideoAccelEnable Connector is NULL!!!\n"));
     
    11531153
    11541154                    pRequestHeader->rc = ptr->u32Enable?
    1155                         pData->pDrv->pfnVideoAccelEnable (pData->pDrv, true, &pData->pVMMDevRAMHC->vbvaMemory):
    1156                         pData->pDrv->pfnVideoAccelEnable (pData->pDrv, false, NULL);
     1155                        pThis->pDrv->pfnVideoAccelEnable (pThis->pDrv, true, &pThis->pVMMDevRAMHC->vbvaMemory):
     1156                        pThis->pDrv->pfnVideoAccelEnable (pThis->pDrv, false, NULL);
    11571157
    11581158                    if (   ptr->u32Enable
     
    11641164                         * We need to reestablish it on restoring the VM from saved state.
    11651165                         */
    1166                         pData->u32VideoAccelEnabled = 1;
     1166                        pThis->u32VideoAccelEnabled = 1;
    11671167                    }
    11681168                    else
    11691169                    {
    11701170                        /* The acceleration was not enabled. Remember that. */
    1171                         pData->u32VideoAccelEnabled = 0;
     1171                        pThis->u32VideoAccelEnabled = 0;
    11721172                    }
    11731173                }
     
    11831183                pRequestHeader->rc = VERR_INVALID_PARAMETER;
    11841184            }
    1185             else if (!pData->pDrv)
     1185            else if (!pThis->pDrv)
    11861186            {
    11871187                Log(("VMMDevReq_VideoAccelFlush Connector is NULL!\n"));
     
    11901190            else
    11911191            {
    1192                 pData->pDrv->pfnVideoAccelFlush (pData->pDrv);
     1192                pThis->pDrv->pfnVideoAccelFlush (pThis->pDrv);
    11931193
    11941194                pRequestHeader->rc = VINF_SUCCESS;
     
    12041204                pRequestHeader->rc = VERR_INVALID_PARAMETER;
    12051205            }
    1206             else if (!pData->pDrv)
     1206            else if (!pThis->pDrv)
    12071207            {
    12081208                Log(("VMMDevReq_VideoSetVisibleRegion Connector is NULL!!!\n"));
     
    12281228                    Log(("VMMDevReq_VideoSetVisibleRegion %d rectangles\n", ptr->cRect));
    12291229                    /* forward the call */
    1230                     pRequestHeader->rc = pData->pDrv->pfnSetVisibleRegion(pData->pDrv, ptr->cRect, &ptr->Rect);
     1230                    pRequestHeader->rc = pThis->pDrv->pfnSetVisibleRegion(pThis->pDrv, ptr->cRect, &ptr->Rect);
    12311231                }
    12321232            }
     
    12441244                VMMDevSeamlessChangeRequest *seamlessChangeRequest = (VMMDevSeamlessChangeRequest*)pRequestHeader;
    12451245                /* just pass on the information */
    1246                 Log(("VMMDev: returning seamless change request mode=%d\n", pData->fSeamlessEnabled));
    1247                 if (pData->fSeamlessEnabled)
     1246                Log(("VMMDev: returning seamless change request mode=%d\n", pThis->fSeamlessEnabled));
     1247                if (pThis->fSeamlessEnabled)
    12481248                    seamlessChangeRequest->mode = VMMDev_Seamless_Visible_Region;
    12491249                else
     
    12531253                {
    12541254                    /* Remember which mode the client has queried. */
    1255                     pData->fLastSeamlessEnabled = pData->fSeamlessEnabled;
     1255                    pThis->fLastSeamlessEnabled = pThis->fSeamlessEnabled;
    12561256                }
    12571257
     
    12711271                VMMDevVRDPChangeRequest *vrdpChangeRequest = (VMMDevVRDPChangeRequest*)pRequestHeader;
    12721272                /* just pass on the information */
    1273                 Log(("VMMDev: returning VRDP status %d level %d\n", pData->fVRDPEnabled, pData->u32VRDPExperienceLevel));
    1274 
    1275                 vrdpChangeRequest->u8VRDPActive = pData->fVRDPEnabled;
    1276                 vrdpChangeRequest->u32VRDPExperienceLevel = pData->u32VRDPExperienceLevel;
     1273                Log(("VMMDev: returning VRDP status %d level %d\n", pThis->fVRDPEnabled, pThis->u32VRDPExperienceLevel));
     1274
     1275                vrdpChangeRequest->u8VRDPActive = pThis->fVRDPEnabled;
     1276                vrdpChangeRequest->u32VRDPExperienceLevel = pThis->u32VRDPExperienceLevel;
    12771277
    12781278                pRequestHeader->rc = VINF_SUCCESS;
     
    12931293                VMMDevGetMemBalloonChangeRequest *memBalloonChangeRequest = (VMMDevGetMemBalloonChangeRequest*)pRequestHeader;
    12941294                /* just pass on the information */
    1295                 Log(("VMMDev: returning memory balloon size =%d\n", pData->u32MemoryBalloonSize));
    1296                 memBalloonChangeRequest->u32BalloonSize = pData->u32MemoryBalloonSize;
    1297                 memBalloonChangeRequest->u32PhysMemSize = pData->cbGuestRAM / (uint64_t)_1M;
     1295                Log(("VMMDev: returning memory balloon size =%d\n", pThis->u32MemoryBalloonSize));
     1296                memBalloonChangeRequest->u32BalloonSize = pThis->u32MemoryBalloonSize;
     1297                memBalloonChangeRequest->u32PhysMemSize = pThis->cbGuestRAM / (uint64_t)_1M;
    12981298
    12991299                if (memBalloonChangeRequest->eventAck == VMMDEV_EVENT_BALLOON_CHANGE_REQUEST)
    13001300                {
    13011301                    /* Remember which mode the client has queried. */
    1302                     pData->u32LastMemoryBalloonSize = pData->u32MemoryBalloonSize;
     1302                    pThis->u32LastMemoryBalloonSize = pThis->u32MemoryBalloonSize;
    13031303                }
    13041304
     
    13221322            else
    13231323            {
    1324                 pRequestHeader->rc = pData->pDrv->pfnChangeMemoryBalloon(pData->pDrv, !!memBalloonChange->fInflate, memBalloonChange->cPages, memBalloonChange->aPhysPage);
     1324                pRequestHeader->rc = pThis->pDrv->pfnChangeMemoryBalloon(pThis->pDrv, !!memBalloonChange->fInflate, memBalloonChange->cPages, memBalloonChange->aPhysPage);
    13251325            }
    13261326            break;
     
    13391339                VMMDevGetStatisticsChangeRequest *statIntervalChangeRequest = (VMMDevGetStatisticsChangeRequest*)pRequestHeader;
    13401340                /* just pass on the information */
    1341                 Log(("VMMDev: returning statistics interval %d seconds\n", pData->u32StatIntervalSize));
    1342                 statIntervalChangeRequest->u32StatInterval = pData->u32StatIntervalSize;
     1341                Log(("VMMDev: returning statistics interval %d seconds\n", pThis->u32StatIntervalSize));
     1342                statIntervalChangeRequest->u32StatInterval = pThis->u32StatIntervalSize;
    13431343
    13441344                if (statIntervalChangeRequest->eventAck == VMMDEV_EVENT_STATISTICS_INTERVAL_CHANGE_REQUEST)
    13451345                {
    13461346                    /* Remember which mode the client has queried. */
    1347                     pData->u32LastStatIntervalSize= pData->u32StatIntervalSize;
     1347                    pThis->u32LastStatIntervalSize= pThis->u32StatIntervalSize;
    13481348                }
    13491349
     
    14241424
    14251425                /* forward the call */
    1426                 pRequestHeader->rc = pData->pDrv->pfnReportStatistics(pData->pDrv, &stats->guestStats);
     1426                pRequestHeader->rc = pThis->pDrv->pfnReportStatistics(pThis->pDrv, &stats->guestStats);
    14271427            }
    14281428            break;
     
    14481448                if (credentials->u32Flags & VMMDEV_CREDENTIALS_QUERYPRESENCE)
    14491449                {
    1450                     if (   pData->credentialsLogon.szUserName[0]
    1451                         || pData->credentialsLogon.szPassword[0]
    1452                         || pData->credentialsLogon.szDomain[0])
     1450                    if (   pThis->credentialsLogon.szUserName[0]
     1451                        || pThis->credentialsLogon.szPassword[0]
     1452                        || pThis->credentialsLogon.szDomain[0])
    14531453                    {
    14541454                        credentials->u32Flags |= VMMDEV_CREDENTIALS_PRESENT;
     
    14631463                if (credentials->u32Flags & VMMDEV_CREDENTIALS_READ)
    14641464                {
    1465                     if (pData->credentialsLogon.szUserName[0])
    1466                         strcpy(credentials->szUserName, pData->credentialsLogon.szUserName);
    1467                     if (pData->credentialsLogon.szPassword[0])
    1468                         strcpy(credentials->szPassword, pData->credentialsLogon.szPassword);
    1469                     if (pData->credentialsLogon.szDomain[0])
    1470                         strcpy(credentials->szDomain, pData->credentialsLogon.szDomain);
    1471                     if (!pData->credentialsLogon.fAllowInteractiveLogon)
     1465                    if (pThis->credentialsLogon.szUserName[0])
     1466                        strcpy(credentials->szUserName, pThis->credentialsLogon.szUserName);
     1467                    if (pThis->credentialsLogon.szPassword[0])
     1468                        strcpy(credentials->szPassword, pThis->credentialsLogon.szPassword);
     1469                    if (pThis->credentialsLogon.szDomain[0])
     1470                        strcpy(credentials->szDomain, pThis->credentialsLogon.szDomain);
     1471                    if (!pThis->credentialsLogon.fAllowInteractiveLogon)
    14721472                        credentials->u32Flags |= VMMDEV_CREDENTIALS_NOLOCALLOGON;
    14731473                    else
     
    14751475                }
    14761476
    1477                 if (!pData->fKeepCredentials)
     1477                if (!pThis->fKeepCredentials)
    14781478                {
    14791479                    /* does the caller want us to destroy the logon credentials? */
    14801480                    if (credentials->u32Flags & VMMDEV_CREDENTIALS_CLEAR)
    14811481                    {
    1482                         memset(pData->credentialsLogon.szUserName, '\0', VMMDEV_CREDENTIALS_STRLEN);
    1483                         memset(pData->credentialsLogon.szPassword, '\0', VMMDEV_CREDENTIALS_STRLEN);
    1484                         memset(pData->credentialsLogon.szDomain, '\0', VMMDEV_CREDENTIALS_STRLEN);
     1482                        memset(pThis->credentialsLogon.szUserName, '\0', VMMDEV_CREDENTIALS_STRLEN);
     1483                        memset(pThis->credentialsLogon.szPassword, '\0', VMMDEV_CREDENTIALS_STRLEN);
     1484                        memset(pThis->credentialsLogon.szDomain, '\0', VMMDEV_CREDENTIALS_STRLEN);
    14851485                    }
    14861486                }
     
    14891489                if (credentials->u32Flags & VMMDEV_CREDENTIALS_READJUDGE)
    14901490                {
    1491                     if (pData->credentialsJudge.szUserName[0])
    1492                         strcpy(credentials->szUserName, pData->credentialsJudge.szUserName);
    1493                     if (pData->credentialsJudge.szPassword[0])
    1494                         strcpy(credentials->szPassword, pData->credentialsJudge.szPassword);
    1495                     if (pData->credentialsJudge.szDomain[0])
    1496                         strcpy(credentials->szDomain, pData->credentialsJudge.szDomain);
     1491                    if (pThis->credentialsJudge.szUserName[0])
     1492                        strcpy(credentials->szUserName, pThis->credentialsJudge.szUserName);
     1493                    if (pThis->credentialsJudge.szPassword[0])
     1494                        strcpy(credentials->szPassword, pThis->credentialsJudge.szPassword);
     1495                    if (pThis->credentialsJudge.szDomain[0])
     1496                        strcpy(credentials->szDomain, pThis->credentialsJudge.szDomain);
    14971497                }
    14981498
     
    15001500                if (credentials->u32Flags & VMMDEV_CREDENTIALS_CLEARJUDGE)
    15011501                {
    1502                     memset(pData->credentialsJudge.szUserName, '\0', VMMDEV_CREDENTIALS_STRLEN);
    1503                     memset(pData->credentialsJudge.szPassword, '\0', VMMDEV_CREDENTIALS_STRLEN);
    1504                     memset(pData->credentialsJudge.szDomain, '\0', VMMDEV_CREDENTIALS_STRLEN);
     1502                    memset(pThis->credentialsJudge.szUserName, '\0', VMMDEV_CREDENTIALS_STRLEN);
     1503                    memset(pThis->credentialsJudge.szPassword, '\0', VMMDEV_CREDENTIALS_STRLEN);
     1504                    memset(pThis->credentialsJudge.szDomain, '\0', VMMDEV_CREDENTIALS_STRLEN);
    15051505                }
    15061506
     
    15241524                if (credentials->u32Flags & VMMDEV_CREDENTIALS_JUDGE_DENY)
    15251525                {
    1526                     pData->pDrv->pfnSetCredentialsJudgementResult(pData->pDrv, VMMDEV_CREDENTIALS_JUDGE_DENY);
     1526                    pThis->pDrv->pfnSetCredentialsJudgementResult(pThis->pDrv, VMMDEV_CREDENTIALS_JUDGE_DENY);
    15271527                }
    15281528                else if (credentials->u32Flags & VMMDEV_CREDENTIALS_JUDGE_NOJUDGEMENT)
    15291529                {
    1530                     pData->pDrv->pfnSetCredentialsJudgementResult(pData->pDrv, VMMDEV_CREDENTIALS_JUDGE_NOJUDGEMENT);
     1530                    pThis->pDrv->pfnSetCredentialsJudgementResult(pThis->pDrv, VMMDEV_CREDENTIALS_JUDGE_NOJUDGEMENT);
    15311531                }
    15321532                else if (credentials->u32Flags & VMMDEV_CREDENTIALS_JUDGE_OK)
    15331533                {
    1534                     pData->pDrv->pfnSetCredentialsJudgementResult(pData->pDrv, VMMDEV_CREDENTIALS_JUDGE_OK);
     1534                    pThis->pDrv->pfnSetCredentialsJudgementResult(pThis->pDrv, VMMDEV_CREDENTIALS_JUDGE_OK);
    15351535                }
    15361536                else
     
    16041604{
    16051605    LogFlow(("vmmdevR3IORAMRegionMap: iRegion=%d GCPhysAddress=%VGp cb=%#x enmType=%d\n", iRegion, GCPhysAddress, cb, enmType));
    1606     VMMDevState *pData = PCIDEV_2_VMMDEVSTATE(pPciDev);
     1606    VMMDevState *pThis = PCIDEV_2_VMMDEVSTATE(pPciDev);
    16071607    int rc;
    16081608
    16091609    AssertReturn(iRegion == 1 && enmType == PCI_ADDRESS_SPACE_MEM, VERR_INTERNAL_ERROR);
    1610     Assert(pData->pVMMDevRAMHC != NULL);
     1610    Assert(pThis->pVMMDevRAMHC != NULL);
    16111611
    16121612    if (GCPhysAddress != NIL_RTGCPHYS)
     
    16151615         * Map the MMIO2 memory.
    16161616         */
    1617         pData->GCPhysVMMDevRAM = GCPhysAddress;
    1618         Assert(pData->GCPhysVMMDevRAM == GCPhysAddress);
     1617        pThis->GCPhysVMMDevRAM = GCPhysAddress;
     1618        Assert(pThis->GCPhysVMMDevRAM == GCPhysAddress);
    16191619        rc = PDMDevHlpMMIO2Map(pPciDev->pDevIns, iRegion, GCPhysAddress);
    16201620    }
     
    16241624         * It is about to be unmapped, just clean up.
    16251625         */
    1626         pData->GCPhysVMMDevRAM = NIL_RTGCPHYS32;
     1626        pThis->GCPhysVMMDevRAM = NIL_RTGCPHYS32;
    16271627        rc = VINF_SUCCESS;
    16281628    }
     
    16451645static DECLCALLBACK(int) vmmdevIOPortRegionMap(PPCIDEVICE pPciDev, /*unsigned*/ int iRegion, RTGCPHYS GCPhysAddress, uint32_t cb, PCIADDRESSSPACE enmType)
    16461646{
    1647     VMMDevState *pData = PCIDEV_2_VMMDEVSTATE(pPciDev);
     1647    VMMDevState *pThis = PCIDEV_2_VMMDEVSTATE(pPciDev);
    16481648    int         rc = VINF_SUCCESS;
    16491649
     
    16551655     * Save the base port address to simplify Port offset calculations.
    16561656     */
    1657     pData->PortBase = (RTIOPORT)GCPhysAddress;
     1657    pThis->PortBase = (RTIOPORT)GCPhysAddress;
    16581658
    16591659    /*
     
    16621662    rc = PDMDevHlpIOPortRegister(pPciDev->pDevIns,
    16631663                                 (RTIOPORT)GCPhysAddress + PORT_VMMDEV_REQUEST_OFFSET, 1,
    1664                                  (void*)pData, vmmdevRequestHandler,
     1664                                 (void*)pThis, vmmdevRequestHandler,
    16651665                                 NULL, NULL, NULL, "VMMDev Request Handler");
    16661666    AssertRC(rc);
     
    16791679static DECLCALLBACK(void *) vmmdevPortQueryInterface(PPDMIBASE pInterface, PDMINTERFACE enmInterface)
    16801680{
    1681     VMMDevState *pData = (VMMDevState*)((uintptr_t)pInterface - RT_OFFSETOF(VMMDevState, Base));
     1681    VMMDevState *pThis = (VMMDevState*)((uintptr_t)pInterface - RT_OFFSETOF(VMMDevState, Base));
    16821682    switch (enmInterface)
    16831683    {
    16841684        case PDMINTERFACE_BASE:
    1685             return &pData->Base;
     1685            return &pThis->Base;
    16861686        case PDMINTERFACE_VMMDEV_PORT:
    1687             return &pData->Port;
     1687            return &pThis->Port;
    16881688#ifdef VBOX_HGCM
    16891689        case PDMINTERFACE_HGCM_PORT:
    1690             return &pData->HGCMPort;
     1690            return &pThis->HGCMPort;
    16911691#endif
    16921692        case PDMINTERFACE_LED_PORTS:
    16931693            /* Currently only for shared folders */
    1694             return &pData->SharedFolders.ILeds;
     1694            return &pThis->SharedFolders.ILeds;
    16951695        default:
    16961696            return NULL;
     
    17081708static DECLCALLBACK(int) vmmdevQueryStatusLed(PPDMILEDPORTS pInterface, unsigned iLUN, PPDMLED *ppLed)
    17091709{
    1710     VMMDevState *pData = (VMMDevState *)( (uintptr_t)pInterface - RT_OFFSETOF(VMMDevState, SharedFolders.ILeds) );
     1710    VMMDevState *pThis = (VMMDevState *)( (uintptr_t)pInterface - RT_OFFSETOF(VMMDevState, SharedFolders.ILeds) );
    17111711    if (iLUN == 0) /* LUN 0 is shared folders */
    17121712    {
    1713         *ppLed = &pData->SharedFolders.Led;
     1713        *ppLed = &pThis->SharedFolders.Led;
    17141714        return VINF_SUCCESS;
    17151715    }
     
    17321732static DECLCALLBACK(int) vmmdevQueryAbsoluteMouse(PPDMIVMMDEVPORT pInterface, uint32_t *pAbsX, uint32_t *pAbsY)
    17331733{
    1734     VMMDevState *pData = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);
     1734    VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);
    17351735    if (pAbsX)
    1736         *pAbsX = pData->mouseXAbs;
     1736        *pAbsX = pThis->mouseXAbs;
    17371737    if (pAbsY)
    1738         *pAbsY = pData->mouseYAbs;
     1738        *pAbsY = pThis->mouseYAbs;
    17391739    return VINF_SUCCESS;
    17401740}
     
    17491749static DECLCALLBACK(int) vmmdevSetAbsoluteMouse(PPDMIVMMDEVPORT pInterface, uint32_t absX, uint32_t absY)
    17501750{
    1751     VMMDevState *pData = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);
     1751    VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);
    17521752    Log2(("vmmdevSetAbsoluteMouse: settings absolute position to x = %d, y = %d\n", absX, absY));
    1753     pData->mouseXAbs = absX;
    1754     pData->mouseYAbs = absY;
     1753    pThis->mouseXAbs = absX;
     1754    pThis->mouseYAbs = absY;
    17551755    return VINF_SUCCESS;
    17561756}
     
    17641764static DECLCALLBACK(int) vmmdevQueryMouseCapabilities(PPDMIVMMDEVPORT pInterface, uint32_t *pCapabilities)
    17651765{
    1766     VMMDevState *pData = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);
     1766    VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);
    17671767    if (!pCapabilities)
    17681768        return VERR_INVALID_PARAMETER;
    1769     *pCapabilities = pData->mouseCapabilities;
     1769    *pCapabilities = pThis->mouseCapabilities;
    17701770    return VINF_SUCCESS;
    17711771}
     
    17791779static DECLCALLBACK(int) vmmdevSetMouseCapabilities(PPDMIVMMDEVPORT pInterface, uint32_t capabilities)
    17801780{
    1781     VMMDevState *pData = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);
     1781    VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);
    17821782
    17831783    bool bCapsChanged = ((capabilities & VMMDEV_MOUSEHOSTWANTSABS)
    1784                          != (pData->mouseCapabilities & VMMDEV_MOUSEHOSTWANTSABS));
     1784                         != (pThis->mouseCapabilities & VMMDEV_MOUSEHOSTWANTSABS));
    17851785
    17861786    Log(("vmmdevSetMouseCapabilities: bCapsChanged %d\n", bCapsChanged));
    17871787
    17881788    if (capabilities & VMMDEV_MOUSEHOSTCANNOTHWPOINTER)
    1789         pData->mouseCapabilities |= VMMDEV_MOUSEHOSTCANNOTHWPOINTER;
     1789        pThis->mouseCapabilities |= VMMDEV_MOUSEHOSTCANNOTHWPOINTER;
    17901790    else
    1791         pData->mouseCapabilities &= ~VMMDEV_MOUSEHOSTCANNOTHWPOINTER;
     1791        pThis->mouseCapabilities &= ~VMMDEV_MOUSEHOSTCANNOTHWPOINTER;
    17921792
    17931793    if (capabilities & VMMDEV_MOUSEHOSTWANTSABS)
    1794         pData->mouseCapabilities |= VMMDEV_MOUSEHOSTWANTSABS;
     1794        pThis->mouseCapabilities |= VMMDEV_MOUSEHOSTWANTSABS;
    17951795    else
    1796         pData->mouseCapabilities &= ~VMMDEV_MOUSEHOSTWANTSABS;
     1796        pThis->mouseCapabilities &= ~VMMDEV_MOUSEHOSTWANTSABS;
    17971797
    17981798    if (bCapsChanged)
    1799         VMMDevNotifyGuest (pData, VMMDEV_EVENT_MOUSE_CAPABILITIES_CHANGED);
     1799        VMMDevNotifyGuest (pThis, VMMDEV_EVENT_MOUSE_CAPABILITIES_CHANGED);
    18001800
    18011801    return VINF_SUCCESS;
     
    18051805static DECLCALLBACK(int) vmmdevRequestDisplayChange(PPDMIVMMDEVPORT pInterface, uint32_t xres, uint32_t yres, uint32_t bpp, uint32_t display)
    18061806{
    1807     VMMDevState *pData = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);
     1807    VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);
    18081808
    18091809    /* Verify that the new resolution is different and that guest does not yet know about it. */
    1810     bool fSameResolution = (!xres || (pData->lastReadDisplayChangeRequest.xres == xres)) &&
    1811                            (!yres || (pData->lastReadDisplayChangeRequest.yres == yres)) &&
    1812                            (!bpp || (pData->lastReadDisplayChangeRequest.bpp == bpp)) &&
    1813                            pData->lastReadDisplayChangeRequest.display == display;
     1810    bool fSameResolution = (!xres || (pThis->lastReadDisplayChangeRequest.xres == xres)) &&
     1811                           (!yres || (pThis->lastReadDisplayChangeRequest.yres == yres)) &&
     1812                           (!bpp || (pThis->lastReadDisplayChangeRequest.bpp == bpp)) &&
     1813                           pThis->lastReadDisplayChangeRequest.display == display;
    18141814
    18151815    if (!xres && !yres && !bpp)
     
    18201820
    18211821    Log3(("vmmdevRequestDisplayChange: same=%d. new: xres=%d, yres=%d, bpp=%d, display=%d. old: xres=%d, yres=%d, bpp=%d, display=%d.\n",
    1822           fSameResolution, xres, yres, bpp, display, pData->lastReadDisplayChangeRequest.xres, pData->lastReadDisplayChangeRequest.yres, pData->lastReadDisplayChangeRequest.bpp, pData->lastReadDisplayChangeRequest.display));
     1822          fSameResolution, xres, yres, bpp, display, pThis->lastReadDisplayChangeRequest.xres, pThis->lastReadDisplayChangeRequest.yres, pThis->lastReadDisplayChangeRequest.bpp, pThis->lastReadDisplayChangeRequest.display));
    18231823
    18241824    if (!fSameResolution)
     
    18281828
    18291829        /* we could validate the information here but hey, the guest can do that as well! */
    1830         pData->displayChangeRequest.xres    = xres;
    1831         pData->displayChangeRequest.yres    = yres;
    1832         pData->displayChangeRequest.bpp     = bpp;
    1833         pData->displayChangeRequest.display = display;
     1830        pThis->displayChangeRequest.xres    = xres;
     1831        pThis->displayChangeRequest.yres    = yres;
     1832        pThis->displayChangeRequest.bpp     = bpp;
     1833        pThis->displayChangeRequest.display = display;
    18341834
    18351835        /* IRQ so the guest knows what's going on */
    1836         VMMDevNotifyGuest (pData, VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST);
     1836        VMMDevNotifyGuest (pThis, VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST);
    18371837    }
    18381838
     
    18421842static DECLCALLBACK(int) vmmdevRequestSeamlessChange(PPDMIVMMDEVPORT pInterface, bool fEnabled)
    18431843{
    1844     VMMDevState *pData = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);
     1844    VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);
    18451845
    18461846    /* Verify that the new resolution is different and that guest does not yet know about it. */
    1847     bool fSameMode = (pData->fLastSeamlessEnabled == fEnabled);
     1847    bool fSameMode = (pThis->fLastSeamlessEnabled == fEnabled);
    18481848
    18491849    Log(("vmmdevRequestSeamlessChange: same=%d. new=%d\n", fSameMode, fEnabled));
     
    18521852    {
    18531853        /* we could validate the information here but hey, the guest can do that as well! */
    1854         pData->fSeamlessEnabled = fEnabled;
     1854        pThis->fSeamlessEnabled = fEnabled;
    18551855
    18561856        /* IRQ so the guest knows what's going on */
    1857         VMMDevNotifyGuest (pData, VMMDEV_EVENT_SEAMLESS_MODE_CHANGE_REQUEST);
     1857        VMMDevNotifyGuest (pThis, VMMDEV_EVENT_SEAMLESS_MODE_CHANGE_REQUEST);
    18581858    }
    18591859
     
    18631863static DECLCALLBACK(int) vmmdevSetMemoryBalloon(PPDMIVMMDEVPORT pInterface, uint32_t ulBalloonSize)
    18641864{
    1865     VMMDevState *pData = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);
     1865    VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);
    18661866
    18671867    /* Verify that the new resolution is different and that guest does not yet know about it. */
    1868     bool fSame = (pData->u32LastMemoryBalloonSize == ulBalloonSize);
    1869 
    1870     Log(("vmmdevSetMemoryBalloon: old=%d. new=%d\n", pData->u32LastMemoryBalloonSize, ulBalloonSize));
     1868    bool fSame = (pThis->u32LastMemoryBalloonSize == ulBalloonSize);
     1869
     1870    Log(("vmmdevSetMemoryBalloon: old=%d. new=%d\n", pThis->u32LastMemoryBalloonSize, ulBalloonSize));
    18711871
    18721872    if (!fSame)
    18731873    {
    18741874        /* we could validate the information here but hey, the guest can do that as well! */
    1875         pData->u32MemoryBalloonSize = ulBalloonSize;
     1875        pThis->u32MemoryBalloonSize = ulBalloonSize;
    18761876
    18771877        /* IRQ so the guest knows what's going on */
    1878         VMMDevNotifyGuest (pData, VMMDEV_EVENT_BALLOON_CHANGE_REQUEST);
     1878        VMMDevNotifyGuest (pThis, VMMDEV_EVENT_BALLOON_CHANGE_REQUEST);
    18791879    }
    18801880
     
    18841884static DECLCALLBACK(int) vmmdevVRDPChange(PPDMIVMMDEVPORT pInterface, bool fVRDPEnabled, uint32_t u32VRDPExperienceLevel)
    18851885{
    1886     VMMDevState *pData = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);
    1887 
    1888     bool fSame = (pData->fVRDPEnabled == fVRDPEnabled);
    1889 
    1890     Log(("vmmdevVRDPChange: old=%d. new=%d\n", pData->fVRDPEnabled, fVRDPEnabled));
     1886    VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);
     1887
     1888    bool fSame = (pThis->fVRDPEnabled == fVRDPEnabled);
     1889
     1890    Log(("vmmdevVRDPChange: old=%d. new=%d\n", pThis->fVRDPEnabled, fVRDPEnabled));
    18911891
    18921892    if (!fSame)
    18931893    {
    1894         pData->fVRDPEnabled = fVRDPEnabled;
    1895         pData->u32VRDPExperienceLevel = u32VRDPExperienceLevel;
    1896 
    1897         VMMDevNotifyGuest (pData, VMMDEV_EVENT_VRDP);
     1894        pThis->fVRDPEnabled = fVRDPEnabled;
     1895        pThis->u32VRDPExperienceLevel = u32VRDPExperienceLevel;
     1896
     1897        VMMDevNotifyGuest (pThis, VMMDEV_EVENT_VRDP);
    18981898    }
    18991899
     
    19031903static DECLCALLBACK(int) vmmdevSetStatisticsInterval(PPDMIVMMDEVPORT pInterface, uint32_t ulStatInterval)
    19041904{
    1905     VMMDevState *pData = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);
     1905    VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);
    19061906
    19071907    /* Verify that the new resolution is different and that guest does not yet know about it. */
    1908     bool fSame = (pData->u32LastStatIntervalSize == ulStatInterval);
    1909 
    1910     Log(("vmmdevSetStatisticsInterval: old=%d. new=%d\n", pData->u32LastStatIntervalSize, ulStatInterval));
     1908    bool fSame = (pThis->u32LastStatIntervalSize == ulStatInterval);
     1909
     1910    Log(("vmmdevSetStatisticsInterval: old=%d. new=%d\n", pThis->u32LastStatIntervalSize, ulStatInterval));
    19111911
    19121912    if (!fSame)
    19131913    {
    19141914        /* we could validate the information here but hey, the guest can do that as well! */
    1915         pData->u32StatIntervalSize = ulStatInterval;
     1915        pThis->u32StatIntervalSize = ulStatInterval;
    19161916
    19171917        /* IRQ so the guest knows what's going on */
    1918         VMMDevNotifyGuest (pData, VMMDEV_EVENT_STATISTICS_INTERVAL_CHANGE_REQUEST);
     1918        VMMDevNotifyGuest (pThis, VMMDEV_EVENT_STATISTICS_INTERVAL_CHANGE_REQUEST);
    19191919    }
    19201920
     
    19271927                                              uint32_t u32Flags)
    19281928{
    1929     VMMDevState *pData = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);
     1929    VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);
    19301930
    19311931    /* logon mode? */
     
    19331933    {
    19341934        /* memorize the data */
    1935         strcpy(pData->credentialsLogon.szUserName, pszUsername);
    1936         strcpy(pData->credentialsLogon.szPassword, pszPassword);
    1937         strcpy(pData->credentialsLogon.szDomain,   pszDomain);
    1938         pData->credentialsLogon.fAllowInteractiveLogon = !(u32Flags & VMMDEV_SETCREDENTIALS_NOLOCALLOGON);
     1935        strcpy(pThis->credentialsLogon.szUserName, pszUsername);
     1936        strcpy(pThis->credentialsLogon.szPassword, pszPassword);
     1937        strcpy(pThis->credentialsLogon.szDomain,   pszDomain);
     1938        pThis->credentialsLogon.fAllowInteractiveLogon = !(u32Flags & VMMDEV_SETCREDENTIALS_NOLOCALLOGON);
    19391939    }
    19401940    /* credentials verification mode? */
     
    19421942    {
    19431943        /* memorize the data */
    1944         strcpy(pData->credentialsJudge.szUserName, pszUsername);
    1945         strcpy(pData->credentialsJudge.szPassword, pszPassword);
    1946         strcpy(pData->credentialsJudge.szDomain,   pszDomain);
    1947 
    1948         VMMDevNotifyGuest (pData, VMMDEV_EVENT_JUDGE_CREDENTIALS);
     1944        strcpy(pThis->credentialsJudge.szUserName, pszUsername);
     1945        strcpy(pThis->credentialsJudge.szPassword, pszPassword);
     1946        strcpy(pThis->credentialsJudge.szDomain,   pszDomain);
     1947
     1948        VMMDevNotifyGuest (pThis, VMMDEV_EVENT_JUDGE_CREDENTIALS);
    19491949    }
    19501950    else
     
    19621962static DECLCALLBACK(void) vmmdevVBVAChange(PPDMIVMMDEVPORT pInterface, bool fEnabled)
    19631963{
    1964     VMMDevState *pData = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);
     1964    VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);
    19651965
    19661966    Log(("vmmdevVBVAChange: fEnabled = %d\n", fEnabled));
    19671967
    1968     if (pData)
    1969     {
    1970         pData->u32VideoAccelEnabled = fEnabled;
     1968    if (pThis)
     1969    {
     1970        pThis->u32VideoAccelEnabled = fEnabled;
    19711971    }
    19721972
     
    19931993static DECLCALLBACK(int) vmmdevSaveState(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle)
    19941994{
    1995     VMMDevState *pData = PDMINS_2_DATA(pDevIns, VMMDevState*);
    1996     SSMR3PutU32(pSSMHandle, pData->hypervisorSize);
    1997     SSMR3PutU32(pSSMHandle, pData->mouseCapabilities);
    1998     SSMR3PutU32(pSSMHandle, pData->mouseXAbs);
    1999     SSMR3PutU32(pSSMHandle, pData->mouseYAbs);
    2000 
    2001     SSMR3PutBool(pSSMHandle, pData->fNewGuestFilterMask);
    2002     SSMR3PutU32(pSSMHandle, pData->u32NewGuestFilterMask);
    2003     SSMR3PutU32(pSSMHandle, pData->u32GuestFilterMask);
    2004     SSMR3PutU32(pSSMHandle, pData->u32HostEventFlags);
     1995    VMMDevState *pThis = PDMINS_2_DATA(pDevIns, VMMDevState*);
     1996    SSMR3PutU32(pSSMHandle, pThis->hypervisorSize);
     1997    SSMR3PutU32(pSSMHandle, pThis->mouseCapabilities);
     1998    SSMR3PutU32(pSSMHandle, pThis->mouseXAbs);
     1999    SSMR3PutU32(pSSMHandle, pThis->mouseYAbs);
     2000
     2001    SSMR3PutBool(pSSMHandle, pThis->fNewGuestFilterMask);
     2002    SSMR3PutU32(pSSMHandle, pThis->u32NewGuestFilterMask);
     2003    SSMR3PutU32(pSSMHandle, pThis->u32GuestFilterMask);
     2004    SSMR3PutU32(pSSMHandle, pThis->u32HostEventFlags);
    20052005    // here be dragons (probably)
    2006 //    SSMR3PutBool(pSSMHandle, pData->pVMMDevRAMHC->V.V1_04.fHaveEvents);
    2007     SSMR3PutMem(pSSMHandle, &pData->pVMMDevRAMHC->V, sizeof (pData->pVMMDevRAMHC->V));
    2008 
    2009     SSMR3PutMem(pSSMHandle, &pData->guestInfo, sizeof (pData->guestInfo));
    2010     SSMR3PutU32(pSSMHandle, pData->fu32AdditionsOk);
    2011     SSMR3PutU32(pSSMHandle, pData->u32VideoAccelEnabled);
    2012 
    2013     SSMR3PutU32(pSSMHandle, pData->guestCaps);
     2006//    SSMR3PutBool(pSSMHandle, pThis->pVMMDevRAMHC->V.V1_04.fHaveEvents);
     2007    SSMR3PutMem(pSSMHandle, &pThis->pVMMDevRAMHC->V, sizeof (pThis->pVMMDevRAMHC->V));
     2008
     2009    SSMR3PutMem(pSSMHandle, &pThis->guestInfo, sizeof (pThis->guestInfo));
     2010    SSMR3PutU32(pSSMHandle, pThis->fu32AdditionsOk);
     2011    SSMR3PutU32(pSSMHandle, pThis->u32VideoAccelEnabled);
     2012
     2013    SSMR3PutU32(pSSMHandle, pThis->guestCaps);
    20142014
    20152015#ifdef VBOX_HGCM
    2016     vmmdevHGCMSaveState (pData, pSSMHandle);
     2016    vmmdevHGCMSaveState (pThis, pSSMHandle);
    20172017#endif /* VBOX_HGCM */
    20182018
     
    20312031{
    20322032    /** @todo The code load code is assuming we're always loaded into a fresh VM. */
    2033     VMMDevState *pData = PDMINS_2_DATA(pDevIns, VMMDevState*);
     2033    VMMDevState *pThis = PDMINS_2_DATA(pDevIns, VMMDevState*);
    20342034    if (   SSM_VERSION_MAJOR_CHANGED(u32Version, VMMDEV_SSM_VERSION)
    20352035        || (SSM_VERSION_MINOR(u32Version) < 6))
    20362036        return VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION;
    20372037
    2038     SSMR3GetU32(pSSMHandle, &pData->hypervisorSize);
    2039     SSMR3GetU32(pSSMHandle, &pData->mouseCapabilities);
    2040     SSMR3GetU32(pSSMHandle, &pData->mouseXAbs);
    2041     SSMR3GetU32(pSSMHandle, &pData->mouseYAbs);
    2042 
    2043     SSMR3GetBool(pSSMHandle, &pData->fNewGuestFilterMask);
    2044     SSMR3GetU32(pSSMHandle, &pData->u32NewGuestFilterMask);
    2045     SSMR3GetU32(pSSMHandle, &pData->u32GuestFilterMask);
    2046     SSMR3GetU32(pSSMHandle, &pData->u32HostEventFlags);
    2047 //    SSMR3GetBool(pSSMHandle, &pData->pVMMDevRAMHC->fHaveEvents);
     2038    SSMR3GetU32(pSSMHandle, &pThis->hypervisorSize);
     2039    SSMR3GetU32(pSSMHandle, &pThis->mouseCapabilities);
     2040    SSMR3GetU32(pSSMHandle, &pThis->mouseXAbs);
     2041    SSMR3GetU32(pSSMHandle, &pThis->mouseYAbs);
     2042
     2043    SSMR3GetBool(pSSMHandle, &pThis->fNewGuestFilterMask);
     2044    SSMR3GetU32(pSSMHandle, &pThis->u32NewGuestFilterMask);
     2045    SSMR3GetU32(pSSMHandle, &pThis->u32GuestFilterMask);
     2046    SSMR3GetU32(pSSMHandle, &pThis->u32HostEventFlags);
     2047//    SSMR3GetBool(pSSMHandle, &pThis->pVMMDevRAMHC->fHaveEvents);
    20482048    // here be dragons (probably)
    2049     SSMR3GetMem(pSSMHandle, &pData->pVMMDevRAMHC->V, sizeof (pData->pVMMDevRAMHC->V));
    2050 
    2051     SSMR3GetMem(pSSMHandle, &pData->guestInfo, sizeof (pData->guestInfo));
    2052     SSMR3GetU32(pSSMHandle, &pData->fu32AdditionsOk);
    2053     SSMR3GetU32(pSSMHandle, &pData->u32VideoAccelEnabled);
    2054 
    2055     SSMR3GetU32(pSSMHandle, &pData->guestCaps);
     2049    SSMR3GetMem(pSSMHandle, &pThis->pVMMDevRAMHC->V, sizeof (pThis->pVMMDevRAMHC->V));
     2050
     2051    SSMR3GetMem(pSSMHandle, &pThis->guestInfo, sizeof (pThis->guestInfo));
     2052    SSMR3GetU32(pSSMHandle, &pThis->fu32AdditionsOk);
     2053    SSMR3GetU32(pSSMHandle, &pThis->u32VideoAccelEnabled);
     2054
     2055    SSMR3GetU32(pSSMHandle, &pThis->guestCaps);
    20562056
    20572057    /* Attributes which were temporarily introduced in r30072 */
     
    20652065
    20662066#ifdef VBOX_HGCM
    2067     vmmdevHGCMLoadState (pData, pSSMHandle);
     2067    vmmdevHGCMLoadState (pThis, pSSMHandle);
    20682068#endif /* VBOX_HGCM */
    20692069
     
    20722072     * that listeners can sync their state again
    20732073     */
    2074     Log(("vmmdevLoadState: capabilities changed (%x), informing connector\n", pData->mouseCapabilities));
    2075     if (pData->pDrv)
    2076         pData->pDrv->pfnUpdateMouseCapabilities(pData->pDrv, pData->mouseCapabilities);
     2074    Log(("vmmdevLoadState: capabilities changed (%x), informing connector\n", pThis->mouseCapabilities));
     2075    if (pThis->pDrv)
     2076        pThis->pDrv->pfnUpdateMouseCapabilities(pThis->pDrv, pThis->mouseCapabilities);
    20772077
    20782078    /* Reestablish the acceleration status. */
    2079     if (    pData->u32VideoAccelEnabled
    2080         &&  pData->pDrv)
    2081     {
    2082         pData->pDrv->pfnVideoAccelEnable (pData->pDrv, !!pData->u32VideoAccelEnabled, &pData->pVMMDevRAMHC->vbvaMemory);
    2083     }
    2084 
    2085     if (pData->fu32AdditionsOk)
     2079    if (    pThis->u32VideoAccelEnabled
     2080        &&  pThis->pDrv)
     2081    {
     2082        pThis->pDrv->pfnVideoAccelEnable (pThis->pDrv, !!pThis->u32VideoAccelEnabled, &pThis->pVMMDevRAMHC->vbvaMemory);
     2083    }
     2084
     2085    if (pThis->fu32AdditionsOk)
    20862086    {
    20872087        LogRel(("Guest Additions information report: additionsVersion = 0x%08X, osType = 0x%08X\n",
    2088                 pData->guestInfo.additionsVersion,
    2089                 pData->guestInfo.osType));
    2090         if (pData->pDrv)
    2091             pData->pDrv->pfnUpdateGuestVersion(pData->pDrv, &pData->guestInfo);
    2092     }
    2093     if (pData->pDrv)
    2094         pData->pDrv->pfnUpdateGuestCapabilities(pData->pDrv, pData->guestCaps);
     2088                pThis->guestInfo.additionsVersion,
     2089                pThis->guestInfo.osType));
     2090        if (pThis->pDrv)
     2091            pThis->pDrv->pfnUpdateGuestVersion(pThis->pDrv, &pThis->guestInfo);
     2092    }
     2093    if (pThis->pDrv)
     2094        pThis->pDrv->pfnUpdateGuestCapabilities(pThis->pDrv, pThis->guestCaps);
    20952095
    20962096    return VINF_SUCCESS;
     
    21062106static DECLCALLBACK(int) vmmdevLoadStateDone(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle)
    21072107{
    2108     VMMDevState *pData = PDMINS_2_DATA(pDevIns, VMMDevState*);
     2108    VMMDevState *pThis = PDMINS_2_DATA(pDevIns, VMMDevState*);
    21092109
    21102110#ifdef VBOX_HGCM
    2111     vmmdevHGCMLoadStateDone (pData, pSSMHandle);
     2111    vmmdevHGCMLoadStateDone (pThis, pSSMHandle);
    21122112#endif /* VBOX_HGCM */
    21132113
    2114     VMMDevNotifyGuest (pData, VMMDEV_EVENT_RESTORED);
     2114    VMMDevNotifyGuest (pThis, VMMDEV_EVENT_RESTORED);
    21152115
    21162116    return VINF_SUCCESS;
     
    21202120 * (Re-)initializes the MMIO2 data.
    21212121 *
    2122  * @param   pData           Pointer to the VMMDev instance data.
     2122 * @param   pThis           Pointer to the VMMDev instance data.
    21232123 */
    2124 static void vmmdevInitRam(VMMDevState *pData)
    2125 {
    2126     memset(pData->pVMMDevRAMHC, 0, sizeof(VMMDevMemory));
    2127     pData->pVMMDevRAMHC->u32Size = sizeof(VMMDevMemory);
    2128     pData->pVMMDevRAMHC->u32Version = VMMDEV_MEMORY_VERSION;
     2124static void vmmdevInitRam(VMMDevState *pThis)
     2125{
     2126    memset(pThis->pVMMDevRAMHC, 0, sizeof(VMMDevMemory));
     2127    pThis->pVMMDevRAMHC->u32Size = sizeof(VMMDevMemory);
     2128    pThis->pVMMDevRAMHC->u32Version = VMMDEV_MEMORY_VERSION;
    21292129}
    21302130
     
    21452145{
    21462146    int rc;
    2147     VMMDevState *pData = PDMINS_2_DATA(pDevIns, VMMDevState *);
     2147    VMMDevState *pThis = PDMINS_2_DATA(pDevIns, VMMDevState *);
    21482148
    21492149    Assert(iInstance == 0);
     
    21552155        return VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES;
    21562156
    2157     rc = CFGMR3QueryBool(pCfgHandle, "GetHostTimeDisabled", &pData->fGetHostTimeDisabled);
     2157    rc = CFGMR3QueryBool(pCfgHandle, "GetHostTimeDisabled", &pThis->fGetHostTimeDisabled);
    21582158    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    2159         pData->fGetHostTimeDisabled = false;
     2159        pThis->fGetHostTimeDisabled = false;
    21602160    else if (RT_FAILURE(rc))
    21612161        return PDMDEV_SET_ERROR(pDevIns, rc,
    21622162                                N_("Configuration error: Failed querying \"GetHostTimeDisabled\" as a boolean"));
    21632163
    2164     rc = CFGMR3QueryBool(pCfgHandle, "BackdoorLogDisabled", &pData->fBackdoorLogDisabled);
     2164    rc = CFGMR3QueryBool(pCfgHandle, "BackdoorLogDisabled", &pThis->fBackdoorLogDisabled);
    21652165    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    2166         pData->fBackdoorLogDisabled = false;
     2166        pThis->fBackdoorLogDisabled = false;
    21672167    else if (RT_FAILURE(rc))
    21682168        return PDMDEV_SET_ERROR(pDevIns, rc,
    21692169                                N_("Configuration error: Failed querying \"BackdoorLogDisabled\" as a boolean"));
    21702170
    2171     rc = CFGMR3QueryBool(pCfgHandle, "KeepCredentials", &pData->fKeepCredentials);
     2171    rc = CFGMR3QueryBool(pCfgHandle, "KeepCredentials", &pThis->fKeepCredentials);
    21722172    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    2173         pData->fKeepCredentials = false;
     2173        pThis->fKeepCredentials = false;
    21742174    else if (RT_FAILURE(rc))
    21752175        return PDMDEV_SET_ERROR(pDevIns, rc,
     
    21802180     */
    21812181    /* Save PDM device instance data for future reference. */
    2182     pData->pDevIns = pDevIns;
     2182    pThis->pDevIns = pDevIns;
    21832183
    21842184    /* PCI vendor, just a free bogus value */
    2185     pData->dev.config[0x00] = 0xee;
    2186     pData->dev.config[0x01] = 0x80;
     2185    pThis->dev.config[0x00] = 0xee;
     2186    pThis->dev.config[0x01] = 0x80;
    21872187    /* device ID */
    2188     pData->dev.config[0x02] = 0xfe;
    2189     pData->dev.config[0x03] = 0xca;
     2188    pThis->dev.config[0x02] = 0xfe;
     2189    pThis->dev.config[0x03] = 0xca;
    21902190    /* class sub code (other type of system peripheral) */
    2191     pData->dev.config[0x0a] = 0x80;
     2191    pThis->dev.config[0x0a] = 0x80;
    21922192    /* class base code (base system peripheral) */
    2193     pData->dev.config[0x0b] = 0x08;
     2193    pThis->dev.config[0x0b] = 0x08;
    21942194    /* header type */
    2195     pData->dev.config[0x0e] = 0x00;
     2195    pThis->dev.config[0x0e] = 0x00;
    21962196    /* interrupt on pin 0 */
    2197     pData->dev.config[0x3d] = 0x01;
     2197    pThis->dev.config[0x3d] = 0x01;
    21982198
    21992199    /*
     
    22012201     */
    22022202    /* Base */
    2203     pData->Base.pfnQueryInterface         = vmmdevPortQueryInterface;
     2203    pThis->Base.pfnQueryInterface         = vmmdevPortQueryInterface;
    22042204
    22052205    /* VMMDev port */
    2206     pData->Port.pfnQueryAbsoluteMouse     = vmmdevQueryAbsoluteMouse;
    2207     pData->Port.pfnSetAbsoluteMouse       = vmmdevSetAbsoluteMouse;
    2208     pData->Port.pfnQueryMouseCapabilities = vmmdevQueryMouseCapabilities;
    2209     pData->Port.pfnSetMouseCapabilities   = vmmdevSetMouseCapabilities;
    2210     pData->Port.pfnRequestDisplayChange   = vmmdevRequestDisplayChange;
    2211     pData->Port.pfnSetCredentials         = vmmdevSetCredentials;
    2212     pData->Port.pfnVBVAChange             = vmmdevVBVAChange;
    2213     pData->Port.pfnRequestSeamlessChange  = vmmdevRequestSeamlessChange;
    2214     pData->Port.pfnSetMemoryBalloon       = vmmdevSetMemoryBalloon;
    2215     pData->Port.pfnSetStatisticsInterval  = vmmdevSetStatisticsInterval;
    2216     pData->Port.pfnVRDPChange             = vmmdevVRDPChange;
     2206    pThis->Port.pfnQueryAbsoluteMouse     = vmmdevQueryAbsoluteMouse;
     2207    pThis->Port.pfnSetAbsoluteMouse       = vmmdevSetAbsoluteMouse;
     2208    pThis->Port.pfnQueryMouseCapabilities = vmmdevQueryMouseCapabilities;
     2209    pThis->Port.pfnSetMouseCapabilities   = vmmdevSetMouseCapabilities;
     2210    pThis->Port.pfnRequestDisplayChange   = vmmdevRequestDisplayChange;
     2211    pThis->Port.pfnSetCredentials         = vmmdevSetCredentials;
     2212    pThis->Port.pfnVBVAChange             = vmmdevVBVAChange;
     2213    pThis->Port.pfnRequestSeamlessChange  = vmmdevRequestSeamlessChange;
     2214    pThis->Port.pfnSetMemoryBalloon       = vmmdevSetMemoryBalloon;
     2215    pThis->Port.pfnSetStatisticsInterval  = vmmdevSetStatisticsInterval;
     2216    pThis->Port.pfnVRDPChange             = vmmdevVRDPChange;
    22172217
    22182218    /* Shared folder LED */
    2219     pData->SharedFolders.Led.u32Magic     = PDMLED_MAGIC;
    2220     pData->SharedFolders.ILeds.pfnQueryStatusLed = vmmdevQueryStatusLed;
     2219    pThis->SharedFolders.Led.u32Magic     = PDMLED_MAGIC;
     2220    pThis->SharedFolders.ILeds.pfnQueryStatusLed = vmmdevQueryStatusLed;
    22212221
    22222222#ifdef VBOX_HGCM
    22232223    /* HGCM port */
    2224     pData->HGCMPort.pfnCompleted          = hgcmCompleted;
     2224    pThis->HGCMPort.pfnCompleted          = hgcmCompleted;
    22252225#endif
    22262226
    22272227    /** @todo convert this into a config parameter like we do everywhere else.*/
    2228     pData->cbGuestRAM = MMR3PhysGetRamSize(PDMDevHlpGetVM(pDevIns));
     2228    pThis->cbGuestRAM = MMR3PhysGetRamSize(PDMDevHlpGetVM(pDevIns));
    22292229
    22302230    /*
     
    22452245     * Allocate and initialize the MMIO2 memory.
    22462246     */
    2247     rc = PDMDevHlpMMIO2Register(pDevIns, 1 /*iRegion*/, VMMDEV_RAM_SIZE, 0, (void **)&pData->pVMMDevRAMHC, "VMMDev");
     2247    rc = PDMDevHlpMMIO2Register(pDevIns, 1 /*iRegion*/, VMMDEV_RAM_SIZE, 0, (void **)&pThis->pVMMDevRAMHC, "VMMDev");
    22482248    if (RT_FAILURE(rc))
    22492249        return PDMDevHlpVMSetError(pDevIns, rc, RT_SRC_POS,
    22502250                                   N_("Failed to allocate %u bytes of memory for the VMM device"), VMMDEV_RAM_SIZE);
    2251     vmmdevInitRam(pData);
     2251    vmmdevInitRam(pThis);
    22522252
    22532253    /*
    22542254     * Register the PCI device.
    22552255     */
    2256     rc = PDMDevHlpPCIRegister(pDevIns, &pData->dev);
     2256    rc = PDMDevHlpPCIRegister(pDevIns, &pThis->dev);
    22572257    if (RT_FAILURE(rc))
    22582258        return rc;
    2259     if (pData->dev.devfn == 32 || iInstance != 0)
    2260         Log(("!!WARNING!!: pData->dev.devfn=%d (ignore if testcase or no started by Main)\n", pData->dev.devfn));
     2259    if (pThis->dev.devfn == 32 || iInstance != 0)
     2260        Log(("!!WARNING!!: pThis->dev.devfn=%d (ignore if testcase or no started by Main)\n", pThis->dev.devfn));
    22612261    rc = PDMDevHlpPCIIORegionRegister(pDevIns, 0, 0x20, PCI_ADDRESS_SPACE_IO, vmmdevIOPortRegionMap);
    22622262    if (RT_FAILURE(rc))
     
    22692269     * Get the corresponding connector interface
    22702270     */
    2271     rc = PDMDevHlpDriverAttach(pDevIns, 0, &pData->Base, &pData->pDrvBase, "VMM Driver Port");
     2271    rc = PDMDevHlpDriverAttach(pDevIns, 0, &pThis->Base, &pThis->pDrvBase, "VMM Driver Port");
    22722272    if (RT_SUCCESS(rc))
    22732273    {
    2274         pData->pDrv = (PPDMIVMMDEVCONNECTOR)pData->pDrvBase->pfnQueryInterface(pData->pDrvBase, PDMINTERFACE_VMMDEV_CONNECTOR);
    2275         if (!pData->pDrv)
     2274        pThis->pDrv = (PPDMIVMMDEVCONNECTOR)pThis->pDrvBase->pfnQueryInterface(pThis->pDrvBase, PDMINTERFACE_VMMDEV_CONNECTOR);
     2275        if (!pThis->pDrv)
    22762276            AssertMsgFailedReturn(("LUN #0 doesn't have a VMMDev connector interface!\n"), VERR_PDM_MISSING_INTERFACE);
    22772277#ifdef VBOX_HGCM
    2278         pData->pHGCMDrv = (PPDMIHGCMCONNECTOR)pData->pDrvBase->pfnQueryInterface(pData->pDrvBase, PDMINTERFACE_HGCM_CONNECTOR);
    2279         if (!pData->pHGCMDrv)
     2278        pThis->pHGCMDrv = (PPDMIHGCMCONNECTOR)pThis->pDrvBase->pfnQueryInterface(pThis->pDrvBase, PDMINTERFACE_HGCM_CONNECTOR);
     2279        if (!pThis->pHGCMDrv)
    22802280        {
    22812281            Log(("LUN #0 doesn't have a HGCM connector interface, HGCM is not supported. rc=%Vrc\n", rc));
     
    22962296     */
    22972297    PPDMIBASE pBase;
    2298     rc = PDMDevHlpDriverAttach(pDevIns, PDM_STATUS_LUN, &pData->Base, &pBase, "Status Port");
     2298    rc = PDMDevHlpDriverAttach(pDevIns, PDM_STATUS_LUN, &pThis->Base, &pBase, "Status Port");
    22992299    if (RT_SUCCESS(rc))
    2300         pData->SharedFolders.pLedsConnector = (PPDMILEDCONNECTORS)
     2300        pThis->SharedFolders.pLedsConnector = (PPDMILEDCONNECTORS)
    23012301            pBase->pfnQueryInterface(pBase, PDMINTERFACE_LED_CONNECTORS);
    23022302    else if (rc != VERR_PDM_NO_ATTACHED_DRIVER)
     
    23092309     * Register saved state and init the HGCM CmdList critsect.
    23102310     */
    2311     rc = PDMDevHlpSSMRegister(pDevIns, "VMMDev", iInstance, VMMDEV_SSM_VERSION, sizeof(*pData),
     2311    rc = PDMDevHlpSSMRegister(pDevIns, "VMMDev", iInstance, VMMDEV_SSM_VERSION, sizeof(*pThis),
    23122312                              NULL, vmmdevSaveState, NULL,
    23132313                              NULL, vmmdevLoadState, vmmdevLoadStateDone);
     
    23152315
    23162316#ifdef VBOX_HGCM
    2317     pData->pHGCMCmdList = NULL;
    2318     rc = RTCritSectInit(&pData->critsectHGCMCmdList);
     2317    pThis->pHGCMCmdList = NULL;
     2318    rc = RTCritSectInit(&pThis->critsectHGCMCmdList);
    23192319    AssertRCReturn(rc, rc);
    2320     pData->u32HGCMEnabled = 0;
     2320    pThis->u32HGCMEnabled = 0;
    23212321#endif /* VBOX_HGCM */
    23222322
     
    23322332static DECLCALLBACK(void) vmmdevReset(PPDMDEVINS pDevIns)
    23332333{
    2334     VMMDevState *pData = PDMINS_2_DATA(pDevIns, VMMDevState*);
     2334    VMMDevState *pThis = PDMINS_2_DATA(pDevIns, VMMDevState*);
    23352335
    23362336    /*
    23372337     * Reset the mouse integration feature bit
    23382338     */
    2339     if (pData->mouseCapabilities & (VMMDEV_MOUSEGUESTWANTSABS|VMMDEV_MOUSEGUESTNEEDSHOSTCUR))
    2340     {
    2341         pData->mouseCapabilities &= ~VMMDEV_MOUSEGUESTWANTSABS;
     2339    if (pThis->mouseCapabilities & (VMMDEV_MOUSEGUESTWANTSABS|VMMDEV_MOUSEGUESTNEEDSHOSTCUR))
     2340    {
     2341        pThis->mouseCapabilities &= ~VMMDEV_MOUSEGUESTWANTSABS;
    23422342        /* notify the connector */
    2343         Log(("vmmdevReset: capabilities changed (%x), informing connector\n", pData->mouseCapabilities));
    2344         pData->pDrv->pfnUpdateMouseCapabilities(pData->pDrv, pData->mouseCapabilities);
    2345     }
    2346 
    2347     pData->hypervisorSize = 0;
    2348 
    2349     pData->u32HostEventFlags = 0;
     2343        Log(("vmmdevReset: capabilities changed (%x), informing connector\n", pThis->mouseCapabilities));
     2344        pThis->pDrv->pfnUpdateMouseCapabilities(pThis->pDrv, pThis->mouseCapabilities);
     2345    }
     2346
     2347    pThis->hypervisorSize = 0;
     2348
     2349    pThis->u32HostEventFlags = 0;
    23502350
    23512351    /* re-initialize the VMMDev memory */
    2352     if (pData->pVMMDevRAMHC)
    2353         vmmdevInitRam(pData);
     2352    if (pThis->pVMMDevRAMHC)
     2353        vmmdevInitRam(pThis);
    23542354
    23552355    /* credentials have to go away (by default) */
    2356     if (!pData->fKeepCredentials)
    2357     {
    2358         memset(pData->credentialsLogon.szUserName, '\0', VMMDEV_CREDENTIALS_STRLEN);
    2359         memset(pData->credentialsLogon.szPassword, '\0', VMMDEV_CREDENTIALS_STRLEN);
    2360         memset(pData->credentialsLogon.szDomain, '\0', VMMDEV_CREDENTIALS_STRLEN);
    2361     }
    2362     memset(pData->credentialsJudge.szUserName, '\0', VMMDEV_CREDENTIALS_STRLEN);
    2363     memset(pData->credentialsJudge.szPassword, '\0', VMMDEV_CREDENTIALS_STRLEN);
    2364     memset(pData->credentialsJudge.szDomain, '\0', VMMDEV_CREDENTIALS_STRLEN);
     2356    if (!pThis->fKeepCredentials)
     2357    {
     2358        memset(pThis->credentialsLogon.szUserName, '\0', VMMDEV_CREDENTIALS_STRLEN);
     2359        memset(pThis->credentialsLogon.szPassword, '\0', VMMDEV_CREDENTIALS_STRLEN);
     2360        memset(pThis->credentialsLogon.szDomain, '\0', VMMDEV_CREDENTIALS_STRLEN);
     2361    }
     2362    memset(pThis->credentialsJudge.szUserName, '\0', VMMDEV_CREDENTIALS_STRLEN);
     2363    memset(pThis->credentialsJudge.szPassword, '\0', VMMDEV_CREDENTIALS_STRLEN);
     2364    memset(pThis->credentialsJudge.szDomain, '\0', VMMDEV_CREDENTIALS_STRLEN);
    23652365
    23662366    /* Reset means that additions will report again. */
    2367     const bool fVersionChanged = pData->fu32AdditionsOk
    2368                               || pData->guestInfo.additionsVersion
    2369                               || pData->guestInfo.osType != VBOXOSTYPE_Unknown;
     2367    const bool fVersionChanged = pThis->fu32AdditionsOk
     2368                              || pThis->guestInfo.additionsVersion
     2369                              || pThis->guestInfo.osType != VBOXOSTYPE_Unknown;
    23702370    if (fVersionChanged)
    23712371        Log(("vmmdevReset: fu32AdditionsOk=%d additionsVersion=%x osType=%#x\n",
    2372              pData->fu32AdditionsOk, pData->guestInfo.additionsVersion, pData->guestInfo.osType));
    2373     pData->fu32AdditionsOk = false;
    2374     memset (&pData->guestInfo, 0, sizeof (pData->guestInfo));
     2372             pThis->fu32AdditionsOk, pThis->guestInfo.additionsVersion, pThis->guestInfo.osType));
     2373    pThis->fu32AdditionsOk = false;
     2374    memset (&pThis->guestInfo, 0, sizeof (pThis->guestInfo));
    23752375
    23762376    /* clear pending display change request. */
    2377     memset (&pData->lastReadDisplayChangeRequest, 0, sizeof (pData->lastReadDisplayChangeRequest));
     2377    memset (&pThis->lastReadDisplayChangeRequest, 0, sizeof (pThis->lastReadDisplayChangeRequest));
    23782378
    23792379    /* disable seamless mode */
    2380     pData->fLastSeamlessEnabled = false;
     2380    pThis->fLastSeamlessEnabled = false;
    23812381
    23822382    /* disabled memory ballooning */
    2383     pData->u32LastMemoryBalloonSize = 0;
     2383    pThis->u32LastMemoryBalloonSize = 0;
    23842384
    23852385    /* disabled statistics updating */
    2386     pData->u32LastStatIntervalSize = 0;
     2386    pThis->u32LastStatIntervalSize = 0;
    23872387
    23882388    /*
    23892389     * Clear the event variables.
    23902390     *
    2391      *   Note: The pData->u32HostEventFlags is not cleared.
     2391     *   Note: The pThis->u32HostEventFlags is not cleared.
    23922392     *         It is designed that way so host events do not
    23932393     *         depend on guest resets.
    23942394     */
    2395     pData->u32GuestFilterMask    = 0;
    2396     pData->u32NewGuestFilterMask = 0;
    2397     pData->fNewGuestFilterMask   = 0;
     2395    pThis->u32GuestFilterMask    = 0;
     2396    pThis->u32NewGuestFilterMask = 0;
     2397    pThis->fNewGuestFilterMask   = 0;
    23982398
    23992399    /* This is the default, as Windows and OS/2 guests take this for granted. (Actually, neither does...) */
    24002400    /** @todo change this when we next bump the interface version */
    2401     const bool fCapsChanged = pData->guestCaps != VMMDEV_GUEST_SUPPORTS_GRAPHICS;
     2401    const bool fCapsChanged = pThis->guestCaps != VMMDEV_GUEST_SUPPORTS_GRAPHICS;
    24022402    if (fCapsChanged)
    2403         Log(("vmmdevReset: fCapsChanged=%#x -> %#x\n", pData->guestCaps, VMMDEV_GUEST_SUPPORTS_GRAPHICS));
    2404     pData->guestCaps = VMMDEV_GUEST_SUPPORTS_GRAPHICS; /** @todo r=bird: why? I cannot see this being done at construction?*/
     2403        Log(("vmmdevReset: fCapsChanged=%#x -> %#x\n", pThis->guestCaps, VMMDEV_GUEST_SUPPORTS_GRAPHICS));
     2404    pThis->guestCaps = VMMDEV_GUEST_SUPPORTS_GRAPHICS; /** @todo r=bird: why? I cannot see this being done at construction?*/
    24052405
    24062406    /*
     
    24082408     */
    24092409    if (fVersionChanged)
    2410         pData->pDrv->pfnUpdateGuestVersion(pData->pDrv, &pData->guestInfo);
     2410        pThis->pDrv->pfnUpdateGuestVersion(pThis->pDrv, &pThis->guestInfo);
    24112411    if (fCapsChanged)
    2412         pData->pDrv->pfnUpdateGuestCapabilities(pData->pDrv, pData->guestCaps);
     2412        pThis->pDrv->pfnUpdateGuestCapabilities(pThis->pDrv, pThis->guestCaps);
    24132413}
    24142414
Note: See TracChangeset for help on using the changeset viewer.

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