Changeset 11269 in vbox for trunk/src/VBox/Devices/VMMDev/VBoxDev.cpp
- Timestamp:
- Aug 8, 2008 4:24:48 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/VMMDev/VBoxDev.cpp
r11267 r11269 284 284 static DECLCALLBACK(int) vmmdevBackdoorLog(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb) 285 285 { 286 VMMDevState *p Data= PDMINS_2_DATA(pDevIns, VMMDevState *);287 288 if (!p Data->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) 289 289 { 290 290 … … 301 301 if (u32 == '\n' || u32 == '\r') 302 302 { 303 p Data->szMsg[pData->iMsg] = '\0';304 if (p Data->iMsg)305 LogRel(("Guest Log: %s\n", p Data->szMsg));306 p Data->iMsg = 0;303 pThis->szMsg[pThis->iMsg] = '\0'; 304 if (pThis->iMsg) 305 LogRel(("Guest Log: %s\n", pThis->szMsg)); 306 pThis->iMsg = 0; 307 307 } 308 308 else 309 309 { 310 if (p Data->iMsg >= sizeof(pData->szMsg)-1)311 { 312 p Data->szMsg[pData->iMsg] = '\0';313 LogRel(("Guest Log: %s\n", p Data->szMsg));314 p Data->iMsg = 0;315 } 316 p Data->szMsg[pData->iMsg] = (char )u32;317 p Data->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'; 318 318 } 319 319 } … … 340 340 if (cb == 4) 341 341 { 342 VMMDevState *p Data= PDMINS_2_DATA(pDevIns, VMMDevState *);342 VMMDevState *pThis = PDMINS_2_DATA(pDevIns, VMMDevState *); 343 343 switch (u32) 344 344 { 345 345 case 0: 346 p Data->fTimesyncBackdoorLo = false;346 pThis->fTimesyncBackdoorLo = false; 347 347 break; 348 348 case 1: 349 p Data->fTimesyncBackdoorLo = true;349 pThis->fTimesyncBackdoorLo = true; 350 350 } 351 351 return VINF_SUCCESS; … … 372 372 if (cb == 4) 373 373 { 374 VMMDevState *p Data= PDMINS_2_DATA(pDevIns, VMMDevState *);374 VMMDevState *pThis = PDMINS_2_DATA(pDevIns, VMMDevState *); 375 375 RTTIMESPEC now; 376 376 377 if (p Data->fTimesyncBackdoorLo)378 { 379 *pu32 = (uint32_t)(p Data->hostTime & (uint64_t)0xFFFFFFFF);377 if (pThis->fTimesyncBackdoorLo) 378 { 379 *pu32 = (uint32_t)(pThis->hostTime & (uint64_t)0xFFFFFFFF); 380 380 } 381 381 else 382 382 { 383 p Data->hostTime = RTTimeSpecGetMilli(PDMDevHlpUTCNow(pDevIns, &now));384 *pu32 = (uint32_t)(p Data->hostTime >> 32);383 pThis->hostTime = RTTimeSpecGetMilli(PDMDevHlpUTCNow(pDevIns, &now)); 384 *pu32 = (uint32_t)(pThis->hostTime >> 32); 385 385 } 386 386 rc = VINF_SUCCESS; … … 398 398 static DECLCALLBACK(int) vmmdevRequestHandler(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb) 399 399 { 400 VMMDevState *p Data= (VMMDevState*)pvUser;400 VMMDevState *pThis = (VMMDevState*)pvUser; 401 401 int rcRet = VINF_SUCCESS; 402 402 … … 429 429 430 430 if ( requestHeader.requestType != VMMDevReq_ReportGuestInfo 431 && !p Data->fu32AdditionsOk)431 && !pThis->fu32AdditionsOk) 432 432 { 433 433 Log(("VMMDev: guest has not yet reported to us. Refusing operation.\n")); … … 484 484 VMMDevReportGuestInfo *guestInfo = (VMMDevReportGuestInfo*)pRequestHeader; 485 485 486 if (memcmp (&p Data->guestInfo, &guestInfo->guestInfo, sizeof (guestInfo->guestInfo)) != 0)486 if (memcmp (&pThis->guestInfo, &guestInfo->guestInfo, sizeof (guestInfo->guestInfo)) != 0) 487 487 { 488 488 /* make a copy of supplied information */ 489 p Data->guestInfo = guestInfo->guestInfo;489 pThis->guestInfo = guestInfo->guestInfo; 490 490 491 491 /* Check additions version */ 492 p Data->fu32AdditionsOk = VBOX_GUEST_ADDITIONS_VERSION_OK(pData->guestInfo.additionsVersion);492 pThis->fu32AdditionsOk = VBOX_GUEST_ADDITIONS_VERSION_OK(pThis->guestInfo.additionsVersion); 493 493 494 494 LogRel(("Guest Additions information report: additionsVersion = 0x%08X osType = 0x%08X\n", 495 p Data->guestInfo.additionsVersion,496 p Data->guestInfo.osType));497 p Data->pDrv->pfnUpdateGuestVersion(pData->pDrv, &pData->guestInfo);498 } 499 500 if (p Data->fu32AdditionsOk)495 pThis->guestInfo.additionsVersion, 496 pThis->guestInfo.osType)); 497 pThis->pDrv->pfnUpdateGuestVersion(pThis->pDrv, &pThis->guestInfo); 498 } 499 500 if (pThis->fu32AdditionsOk) 501 501 { 502 502 pRequestHeader->rc = VINF_SUCCESS; … … 526 526 /** @todo change this when we next bump the interface version */ 527 527 guestCaps->caps |= VMMDEV_GUEST_SUPPORTS_GRAPHICS; 528 if (p Data->guestCaps != guestCaps->caps)528 if (pThis->guestCaps != guestCaps->caps) 529 529 { 530 530 /* make a copy of supplied information */ 531 p Data->guestCaps = guestCaps->caps;531 pThis->guestCaps = guestCaps->caps; 532 532 533 533 LogRel(("Guest Additions capability report: (0x%x) " … … 540 540 guestCaps->caps & VMMDEV_GUEST_SUPPORTS_GRAPHICS ? "yes" : "no")); 541 541 542 p Data->pDrv->pfnUpdateGuestCapabilities(pData->pDrv, guestCaps->caps);542 pThis->pDrv->pfnUpdateGuestCapabilities(pThis->pDrv, guestCaps->caps); 543 543 } 544 544 pRequestHeader->rc = VINF_SUCCESS; … … 559 559 VMMDevReqGuestCapabilities2 *guestCaps = (VMMDevReqGuestCapabilities2*)pRequestHeader; 560 560 561 p Data->guestCaps |= guestCaps->u32OrMask;562 p Data->guestCaps &= ~guestCaps->u32NotMask;561 pThis->guestCaps |= guestCaps->u32OrMask; 562 pThis->guestCaps &= ~guestCaps->u32NotMask; 563 563 564 564 LogRel(("Guest Additions capability report: (0x%x) " … … 566 566 "hostWindowMapping: %s, " 567 567 "graphics: %s\n", 568 p Data->guestCaps,569 p Data->guestCaps & VMMDEV_GUEST_SUPPORTS_SEAMLESS ? "yes" : "no",570 p Data->guestCaps & VMMDEV_GUEST_SUPPORTS_GUEST_HOST_WINDOW_MAPPING ? "yes" : "no",571 p Data->guestCaps & VMMDEV_GUEST_SUPPORTS_GRAPHICS ? "yes" : "no"));572 573 p Data->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); 574 574 pRequestHeader->rc = VINF_SUCCESS; 575 575 } … … 591 591 VMMDevReqMouseStatus *mouseStatus = (VMMDevReqMouseStatus*)pRequestHeader; 592 592 mouseStatus->mouseFeatures = 0; 593 if (p Data->mouseCapabilities & VMMDEV_MOUSEHOSTWANTSABS)593 if (pThis->mouseCapabilities & VMMDEV_MOUSEHOSTWANTSABS) 594 594 { 595 595 mouseStatus->mouseFeatures |= VBOXGUEST_MOUSE_HOST_CAN_ABSOLUTE; 596 596 } 597 if (p Data->mouseCapabilities & VMMDEV_MOUSEGUESTWANTSABS)597 if (pThis->mouseCapabilities & VMMDEV_MOUSEGUESTWANTSABS) 598 598 { 599 599 mouseStatus->mouseFeatures |= VBOXGUEST_MOUSE_GUEST_CAN_ABSOLUTE; 600 600 } 601 if (p Data->mouseCapabilities & VMMDEV_MOUSEHOSTCANNOTHWPOINTER)601 if (pThis->mouseCapabilities & VMMDEV_MOUSEHOSTCANNOTHWPOINTER) 602 602 { 603 603 mouseStatus->mouseFeatures |= VBOXGUEST_MOUSE_HOST_CANNOT_HWPOINTER; 604 604 } 605 mouseStatus->pointerXPos = p Data->mouseXAbs;606 mouseStatus->pointerYPos = p Data->mouseYAbs;605 mouseStatus->pointerXPos = pThis->mouseXAbs; 606 mouseStatus->pointerYPos = pThis->mouseYAbs; 607 607 Log2(("returning mouse status: features = %d, absX = %d, absY = %d\n", mouseStatus->mouseFeatures, 608 608 mouseStatus->pointerXPos, mouseStatus->pointerYPos)); … … 633 633 { 634 634 /* set the capability flag and the changed flag if it's actually a change */ 635 if (!(p Data->mouseCapabilities & VMMDEV_MOUSEGUESTWANTSABS))635 if (!(pThis->mouseCapabilities & VMMDEV_MOUSEGUESTWANTSABS)) 636 636 { 637 p Data->mouseCapabilities |= VMMDEV_MOUSEGUESTWANTSABS;637 pThis->mouseCapabilities |= VMMDEV_MOUSEGUESTWANTSABS; 638 638 bCapsChanged = true; 639 639 LogRel(("Guest requests mouse pointer integration\n")); … … 641 641 } else 642 642 { 643 if (p Data->mouseCapabilities & VMMDEV_MOUSEGUESTWANTSABS)643 if (pThis->mouseCapabilities & VMMDEV_MOUSEGUESTWANTSABS) 644 644 { 645 p Data->mouseCapabilities &= ~VMMDEV_MOUSEGUESTWANTSABS;645 pThis->mouseCapabilities &= ~VMMDEV_MOUSEGUESTWANTSABS; 646 646 bCapsChanged = true; 647 647 LogRel(("Guest disables mouse pointer integration\n")); … … 649 649 } 650 650 if (mouseStatus->mouseFeatures & VBOXGUEST_MOUSE_GUEST_NEEDS_HOST_CURSOR) 651 p Data->mouseCapabilities |= VMMDEV_MOUSEGUESTNEEDSHOSTCUR;651 pThis->mouseCapabilities |= VMMDEV_MOUSEGUESTNEEDSHOSTCUR; 652 652 else 653 p Data->mouseCapabilities &= ~VMMDEV_MOUSEGUESTNEEDSHOSTCUR;653 pThis->mouseCapabilities &= ~VMMDEV_MOUSEGUESTNEEDSHOSTCUR; 654 654 655 655 /* … … 658 658 if (bCapsChanged) 659 659 { 660 Log(("VMMDevReq_SetMouseStatus: capabilities changed (%x), informing connector\n", p Data->mouseCapabilities));661 p Data->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); 662 662 } 663 663 pRequestHeader->rc = VINF_SUCCESS; … … 699 699 if (fShape) 700 700 { 701 p Data->pDrv->pfnUpdatePointerShape(pData->pDrv,701 pThis->pDrv->pfnUpdatePointerShape(pThis->pDrv, 702 702 fVisible, 703 703 fAlpha, … … 708 708 else 709 709 { 710 p Data->pDrv->pfnUpdatePointerShape(pData->pDrv,710 pThis->pDrv->pfnUpdatePointerShape(pThis->pDrv, 711 711 fVisible, 712 712 0, … … 730 730 pRequestHeader->rc = VERR_INVALID_PARAMETER; 731 731 } 732 else if (RT_UNLIKELY(p Data->fGetHostTimeDisabled))732 else if (RT_UNLIKELY(pThis->fGetHostTimeDisabled)) 733 733 pRequestHeader->rc = VERR_NOT_SUPPORTED; 734 734 else … … 863 863 { 864 864 /* Remember which resolution the client has queried, subsequent reads will return the same values. */ 865 p Data->lastReadDisplayChangeRequest = pData->displayChangeRequest;865 pThis->lastReadDisplayChangeRequest = pThis->displayChangeRequest; 866 866 } 867 867 868 868 /* just pass on the information */ 869 869 Log(("VMMDev: returning display change request xres = %d, yres = %d, bpp = %d\n", 870 p Data->displayChangeRequest.xres, pData->displayChangeRequest.yres, pData->displayChangeRequest.bpp));871 displayChangeRequest->xres = p Data->lastReadDisplayChangeRequest.xres;872 displayChangeRequest->yres = p Data->lastReadDisplayChangeRequest.yres;873 displayChangeRequest->bpp = p Data->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; 874 874 875 875 pRequestHeader->rc = VINF_SUCCESS; … … 891 891 { 892 892 /* Remember which resolution the client has queried, subsequent reads will return the same values. */ 893 p Data->lastReadDisplayChangeRequest = pData->displayChangeRequest;893 pThis->lastReadDisplayChangeRequest = pThis->displayChangeRequest; 894 894 } 895 895 896 896 /* just pass on the information */ 897 897 Log(("VMMDev: returning display change request xres = %d, yres = %d, bpp = %d at %d\n", 898 p Data->displayChangeRequest.xres, pData->displayChangeRequest.yres, pData->displayChangeRequest.bpp, pData->displayChangeRequest.display));899 displayChangeRequest->xres = p Data->lastReadDisplayChangeRequest.xres;900 displayChangeRequest->yres = p Data->lastReadDisplayChangeRequest.yres;901 displayChangeRequest->bpp = p Data->lastReadDisplayChangeRequest.bpp;902 displayChangeRequest->display = p Data->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; 903 903 904 904 pRequestHeader->rc = VINF_SUCCESS; … … 921 921 VMMDevVideoModeSupportedRequest *videoModeSupportedRequest = (VMMDevVideoModeSupportedRequest*)pRequestHeader; 922 922 /* forward the call */ 923 pRequestHeader->rc = p Data->pDrv->pfnVideoModeSupported(pData->pDrv,923 pRequestHeader->rc = pThis->pDrv->pfnVideoModeSupported(pThis->pDrv, 924 924 videoModeSupportedRequest->width, 925 925 videoModeSupportedRequest->height, … … 944 944 VMMDevGetHeightReductionRequest *heightReductionRequest = (VMMDevGetHeightReductionRequest*)pRequestHeader; 945 945 /* forward the call */ 946 pRequestHeader->rc = p Data->pDrv->pfnGetHeightReduction(pData->pDrv,946 pRequestHeader->rc = pThis->pDrv->pfnGetHeightReduction(pThis->pDrv, 947 947 &heightReductionRequest->heightReduction); 948 948 } … … 962 962 else 963 963 { 964 if (VBOX_GUEST_ADDITIONS_VERSION_1_03 (p Data))965 { 966 vmmdevSetIRQ_Legacy_EMT (p Data);964 if (VBOX_GUEST_ADDITIONS_VERSION_1_03 (pThis)) 965 { 966 vmmdevSetIRQ_Legacy_EMT (pThis); 967 967 } 968 968 else … … 970 970 VMMDevEvents *pAckRequest; 971 971 972 if (p Data->fNewGuestFilterMask)972 if (pThis->fNewGuestFilterMask) 973 973 { 974 p Data->fNewGuestFilterMask = false;975 p Data->u32GuestFilterMask = pData->u32NewGuestFilterMask;974 pThis->fNewGuestFilterMask = false; 975 pThis->u32GuestFilterMask = pThis->u32NewGuestFilterMask; 976 976 } 977 977 978 978 pAckRequest = (VMMDevEvents *)pRequestHeader; 979 979 pAckRequest->events = 980 p Data->u32HostEventFlags & pData->u32GuestFilterMask;981 982 p Data->u32HostEventFlags &= ~pData->u32GuestFilterMask;983 p Data->pVMMDevRAMHC->V.V1_04.fHaveEvents = false;984 PDMDevHlpPCISetIrqNoWait (p Data->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); 985 985 } 986 986 pRequestHeader->rc = VINF_SUCCESS; … … 1007 1007 * HGCM command is issued. The guest then can not disable these events. 1008 1008 */ 1009 vmmdevCtlGuestFilterMask_EMT (p Data,1009 vmmdevCtlGuestFilterMask_EMT (pThis, 1010 1010 pCtlMaskRequest->u32OrMask, 1011 1011 pCtlMaskRequest->u32NotMask & ~VMMDEV_EVENT_HGCM); … … 1027 1027 pRequestHeader->rc = VERR_INVALID_PARAMETER; 1028 1028 } 1029 else if (!p Data->pHGCMDrv)1029 else if (!pThis->pHGCMDrv) 1030 1030 { 1031 1031 Log(("VMMDevReq_HGCMConnect HGCM Connector is NULL!\n")); … … 1038 1038 Log(("VMMDevReq_HGCMConnect\n")); 1039 1039 1040 pRequestHeader->rc = vmmdevHGCMConnect (p Data, pHGCMConnect, (RTGCPHYS)u32);1040 pRequestHeader->rc = vmmdevHGCMConnect (pThis, pHGCMConnect, (RTGCPHYS)u32); 1041 1041 } 1042 1042 break; … … 1050 1050 pRequestHeader->rc = VERR_INVALID_PARAMETER; 1051 1051 } 1052 else if (!p Data->pHGCMDrv)1052 else if (!pThis->pHGCMDrv) 1053 1053 { 1054 1054 Log(("VMMDevReq_HGCMDisconnect HGCM Connector is NULL!\n")); … … 1060 1060 1061 1061 Log(("VMMDevReq_VMMDevHGCMDisconnect\n")); 1062 pRequestHeader->rc = vmmdevHGCMDisconnect (p Data, pHGCMDisconnect, (RTGCPHYS)u32);1062 pRequestHeader->rc = vmmdevHGCMDisconnect (pThis, pHGCMDisconnect, (RTGCPHYS)u32); 1063 1063 } 1064 1064 break; … … 1077 1077 pRequestHeader->rc = VERR_INVALID_PARAMETER; 1078 1078 } 1079 else if (!p Data->pHGCMDrv)1079 else if (!pThis->pHGCMDrv) 1080 1080 { 1081 1081 Log(("VMMDevReq_HGCMCall HGCM Connector is NULL!\n")); … … 1095 1095 #endif /* VBOX_WITH_64_BITS_GUESTS */ 1096 1096 1097 pRequestHeader->rc = vmmdevHGCMCall (p Data, pHGCMCall, (RTGCPHYS)u32, f64Bits);1097 pRequestHeader->rc = vmmdevHGCMCall (pThis, pHGCMCall, (RTGCPHYS)u32, f64Bits); 1098 1098 } 1099 1099 break; … … 1108 1108 pRequestHeader->rc = VERR_INVALID_PARAMETER; 1109 1109 } 1110 else if (!p Data->pHGCMDrv)1110 else if (!pThis->pHGCMDrv) 1111 1111 { 1112 1112 Log(("VMMDevReq_HGCMCancel HGCM Connector is NULL!\n")); … … 1118 1118 1119 1119 Log(("VMMDevReq_VMMDevHGCMCancel\n")); 1120 pRequestHeader->rc = vmmdevHGCMCancel (p Data, pHGCMCancel, (RTGCPHYS)u32);1120 pRequestHeader->rc = vmmdevHGCMCancel (pThis, pHGCMCancel, (RTGCPHYS)u32); 1121 1121 } 1122 1122 break; … … 1130 1130 pRequestHeader->rc = VERR_INVALID_PARAMETER; 1131 1131 } 1132 else if (!p Data->pDrv)1132 else if (!pThis->pDrv) 1133 1133 { 1134 1134 Log(("VMMDevReq_VideoAccelEnable Connector is NULL!!!\n")); … … 1153 1153 1154 1154 pRequestHeader->rc = ptr->u32Enable? 1155 p Data->pDrv->pfnVideoAccelEnable (pData->pDrv, true, &pData->pVMMDevRAMHC->vbvaMemory):1156 p Data->pDrv->pfnVideoAccelEnable (pData->pDrv, false, NULL);1155 pThis->pDrv->pfnVideoAccelEnable (pThis->pDrv, true, &pThis->pVMMDevRAMHC->vbvaMemory): 1156 pThis->pDrv->pfnVideoAccelEnable (pThis->pDrv, false, NULL); 1157 1157 1158 1158 if ( ptr->u32Enable … … 1164 1164 * We need to reestablish it on restoring the VM from saved state. 1165 1165 */ 1166 p Data->u32VideoAccelEnabled = 1;1166 pThis->u32VideoAccelEnabled = 1; 1167 1167 } 1168 1168 else 1169 1169 { 1170 1170 /* The acceleration was not enabled. Remember that. */ 1171 p Data->u32VideoAccelEnabled = 0;1171 pThis->u32VideoAccelEnabled = 0; 1172 1172 } 1173 1173 } … … 1183 1183 pRequestHeader->rc = VERR_INVALID_PARAMETER; 1184 1184 } 1185 else if (!p Data->pDrv)1185 else if (!pThis->pDrv) 1186 1186 { 1187 1187 Log(("VMMDevReq_VideoAccelFlush Connector is NULL!\n")); … … 1190 1190 else 1191 1191 { 1192 p Data->pDrv->pfnVideoAccelFlush (pData->pDrv);1192 pThis->pDrv->pfnVideoAccelFlush (pThis->pDrv); 1193 1193 1194 1194 pRequestHeader->rc = VINF_SUCCESS; … … 1204 1204 pRequestHeader->rc = VERR_INVALID_PARAMETER; 1205 1205 } 1206 else if (!p Data->pDrv)1206 else if (!pThis->pDrv) 1207 1207 { 1208 1208 Log(("VMMDevReq_VideoSetVisibleRegion Connector is NULL!!!\n")); … … 1228 1228 Log(("VMMDevReq_VideoSetVisibleRegion %d rectangles\n", ptr->cRect)); 1229 1229 /* forward the call */ 1230 pRequestHeader->rc = p Data->pDrv->pfnSetVisibleRegion(pData->pDrv, ptr->cRect, &ptr->Rect);1230 pRequestHeader->rc = pThis->pDrv->pfnSetVisibleRegion(pThis->pDrv, ptr->cRect, &ptr->Rect); 1231 1231 } 1232 1232 } … … 1244 1244 VMMDevSeamlessChangeRequest *seamlessChangeRequest = (VMMDevSeamlessChangeRequest*)pRequestHeader; 1245 1245 /* just pass on the information */ 1246 Log(("VMMDev: returning seamless change request mode=%d\n", p Data->fSeamlessEnabled));1247 if (p Data->fSeamlessEnabled)1246 Log(("VMMDev: returning seamless change request mode=%d\n", pThis->fSeamlessEnabled)); 1247 if (pThis->fSeamlessEnabled) 1248 1248 seamlessChangeRequest->mode = VMMDev_Seamless_Visible_Region; 1249 1249 else … … 1253 1253 { 1254 1254 /* Remember which mode the client has queried. */ 1255 p Data->fLastSeamlessEnabled = pData->fSeamlessEnabled;1255 pThis->fLastSeamlessEnabled = pThis->fSeamlessEnabled; 1256 1256 } 1257 1257 … … 1271 1271 VMMDevVRDPChangeRequest *vrdpChangeRequest = (VMMDevVRDPChangeRequest*)pRequestHeader; 1272 1272 /* just pass on the information */ 1273 Log(("VMMDev: returning VRDP status %d level %d\n", p Data->fVRDPEnabled, pData->u32VRDPExperienceLevel));1274 1275 vrdpChangeRequest->u8VRDPActive = p Data->fVRDPEnabled;1276 vrdpChangeRequest->u32VRDPExperienceLevel = p Data->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; 1277 1277 1278 1278 pRequestHeader->rc = VINF_SUCCESS; … … 1293 1293 VMMDevGetMemBalloonChangeRequest *memBalloonChangeRequest = (VMMDevGetMemBalloonChangeRequest*)pRequestHeader; 1294 1294 /* just pass on the information */ 1295 Log(("VMMDev: returning memory balloon size =%d\n", p Data->u32MemoryBalloonSize));1296 memBalloonChangeRequest->u32BalloonSize = p Data->u32MemoryBalloonSize;1297 memBalloonChangeRequest->u32PhysMemSize = p Data->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; 1298 1298 1299 1299 if (memBalloonChangeRequest->eventAck == VMMDEV_EVENT_BALLOON_CHANGE_REQUEST) 1300 1300 { 1301 1301 /* Remember which mode the client has queried. */ 1302 p Data->u32LastMemoryBalloonSize = pData->u32MemoryBalloonSize;1302 pThis->u32LastMemoryBalloonSize = pThis->u32MemoryBalloonSize; 1303 1303 } 1304 1304 … … 1322 1322 else 1323 1323 { 1324 pRequestHeader->rc = p Data->pDrv->pfnChangeMemoryBalloon(pData->pDrv, !!memBalloonChange->fInflate, memBalloonChange->cPages, memBalloonChange->aPhysPage);1324 pRequestHeader->rc = pThis->pDrv->pfnChangeMemoryBalloon(pThis->pDrv, !!memBalloonChange->fInflate, memBalloonChange->cPages, memBalloonChange->aPhysPage); 1325 1325 } 1326 1326 break; … … 1339 1339 VMMDevGetStatisticsChangeRequest *statIntervalChangeRequest = (VMMDevGetStatisticsChangeRequest*)pRequestHeader; 1340 1340 /* just pass on the information */ 1341 Log(("VMMDev: returning statistics interval %d seconds\n", p Data->u32StatIntervalSize));1342 statIntervalChangeRequest->u32StatInterval = p Data->u32StatIntervalSize;1341 Log(("VMMDev: returning statistics interval %d seconds\n", pThis->u32StatIntervalSize)); 1342 statIntervalChangeRequest->u32StatInterval = pThis->u32StatIntervalSize; 1343 1343 1344 1344 if (statIntervalChangeRequest->eventAck == VMMDEV_EVENT_STATISTICS_INTERVAL_CHANGE_REQUEST) 1345 1345 { 1346 1346 /* Remember which mode the client has queried. */ 1347 p Data->u32LastStatIntervalSize= pData->u32StatIntervalSize;1347 pThis->u32LastStatIntervalSize= pThis->u32StatIntervalSize; 1348 1348 } 1349 1349 … … 1424 1424 1425 1425 /* forward the call */ 1426 pRequestHeader->rc = p Data->pDrv->pfnReportStatistics(pData->pDrv, &stats->guestStats);1426 pRequestHeader->rc = pThis->pDrv->pfnReportStatistics(pThis->pDrv, &stats->guestStats); 1427 1427 } 1428 1428 break; … … 1448 1448 if (credentials->u32Flags & VMMDEV_CREDENTIALS_QUERYPRESENCE) 1449 1449 { 1450 if ( p Data->credentialsLogon.szUserName[0]1451 || p Data->credentialsLogon.szPassword[0]1452 || p Data->credentialsLogon.szDomain[0])1450 if ( pThis->credentialsLogon.szUserName[0] 1451 || pThis->credentialsLogon.szPassword[0] 1452 || pThis->credentialsLogon.szDomain[0]) 1453 1453 { 1454 1454 credentials->u32Flags |= VMMDEV_CREDENTIALS_PRESENT; … … 1463 1463 if (credentials->u32Flags & VMMDEV_CREDENTIALS_READ) 1464 1464 { 1465 if (p Data->credentialsLogon.szUserName[0])1466 strcpy(credentials->szUserName, p Data->credentialsLogon.szUserName);1467 if (p Data->credentialsLogon.szPassword[0])1468 strcpy(credentials->szPassword, p Data->credentialsLogon.szPassword);1469 if (p Data->credentialsLogon.szDomain[0])1470 strcpy(credentials->szDomain, p Data->credentialsLogon.szDomain);1471 if (!p Data->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) 1472 1472 credentials->u32Flags |= VMMDEV_CREDENTIALS_NOLOCALLOGON; 1473 1473 else … … 1475 1475 } 1476 1476 1477 if (!p Data->fKeepCredentials)1477 if (!pThis->fKeepCredentials) 1478 1478 { 1479 1479 /* does the caller want us to destroy the logon credentials? */ 1480 1480 if (credentials->u32Flags & VMMDEV_CREDENTIALS_CLEAR) 1481 1481 { 1482 memset(p Data->credentialsLogon.szUserName, '\0', VMMDEV_CREDENTIALS_STRLEN);1483 memset(p Data->credentialsLogon.szPassword, '\0', VMMDEV_CREDENTIALS_STRLEN);1484 memset(p Data->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); 1485 1485 } 1486 1486 } … … 1489 1489 if (credentials->u32Flags & VMMDEV_CREDENTIALS_READJUDGE) 1490 1490 { 1491 if (p Data->credentialsJudge.szUserName[0])1492 strcpy(credentials->szUserName, p Data->credentialsJudge.szUserName);1493 if (p Data->credentialsJudge.szPassword[0])1494 strcpy(credentials->szPassword, p Data->credentialsJudge.szPassword);1495 if (p Data->credentialsJudge.szDomain[0])1496 strcpy(credentials->szDomain, p Data->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); 1497 1497 } 1498 1498 … … 1500 1500 if (credentials->u32Flags & VMMDEV_CREDENTIALS_CLEARJUDGE) 1501 1501 { 1502 memset(p Data->credentialsJudge.szUserName, '\0', VMMDEV_CREDENTIALS_STRLEN);1503 memset(p Data->credentialsJudge.szPassword, '\0', VMMDEV_CREDENTIALS_STRLEN);1504 memset(p Data->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); 1505 1505 } 1506 1506 … … 1524 1524 if (credentials->u32Flags & VMMDEV_CREDENTIALS_JUDGE_DENY) 1525 1525 { 1526 p Data->pDrv->pfnSetCredentialsJudgementResult(pData->pDrv, VMMDEV_CREDENTIALS_JUDGE_DENY);1526 pThis->pDrv->pfnSetCredentialsJudgementResult(pThis->pDrv, VMMDEV_CREDENTIALS_JUDGE_DENY); 1527 1527 } 1528 1528 else if (credentials->u32Flags & VMMDEV_CREDENTIALS_JUDGE_NOJUDGEMENT) 1529 1529 { 1530 p Data->pDrv->pfnSetCredentialsJudgementResult(pData->pDrv, VMMDEV_CREDENTIALS_JUDGE_NOJUDGEMENT);1530 pThis->pDrv->pfnSetCredentialsJudgementResult(pThis->pDrv, VMMDEV_CREDENTIALS_JUDGE_NOJUDGEMENT); 1531 1531 } 1532 1532 else if (credentials->u32Flags & VMMDEV_CREDENTIALS_JUDGE_OK) 1533 1533 { 1534 p Data->pDrv->pfnSetCredentialsJudgementResult(pData->pDrv, VMMDEV_CREDENTIALS_JUDGE_OK);1534 pThis->pDrv->pfnSetCredentialsJudgementResult(pThis->pDrv, VMMDEV_CREDENTIALS_JUDGE_OK); 1535 1535 } 1536 1536 else … … 1604 1604 { 1605 1605 LogFlow(("vmmdevR3IORAMRegionMap: iRegion=%d GCPhysAddress=%VGp cb=%#x enmType=%d\n", iRegion, GCPhysAddress, cb, enmType)); 1606 VMMDevState *p Data= PCIDEV_2_VMMDEVSTATE(pPciDev);1606 VMMDevState *pThis = PCIDEV_2_VMMDEVSTATE(pPciDev); 1607 1607 int rc; 1608 1608 1609 1609 AssertReturn(iRegion == 1 && enmType == PCI_ADDRESS_SPACE_MEM, VERR_INTERNAL_ERROR); 1610 Assert(p Data->pVMMDevRAMHC != NULL);1610 Assert(pThis->pVMMDevRAMHC != NULL); 1611 1611 1612 1612 if (GCPhysAddress != NIL_RTGCPHYS) … … 1615 1615 * Map the MMIO2 memory. 1616 1616 */ 1617 p Data->GCPhysVMMDevRAM = GCPhysAddress;1618 Assert(p Data->GCPhysVMMDevRAM == GCPhysAddress);1617 pThis->GCPhysVMMDevRAM = GCPhysAddress; 1618 Assert(pThis->GCPhysVMMDevRAM == GCPhysAddress); 1619 1619 rc = PDMDevHlpMMIO2Map(pPciDev->pDevIns, iRegion, GCPhysAddress); 1620 1620 } … … 1624 1624 * It is about to be unmapped, just clean up. 1625 1625 */ 1626 p Data->GCPhysVMMDevRAM = NIL_RTGCPHYS32;1626 pThis->GCPhysVMMDevRAM = NIL_RTGCPHYS32; 1627 1627 rc = VINF_SUCCESS; 1628 1628 } … … 1645 1645 static DECLCALLBACK(int) vmmdevIOPortRegionMap(PPCIDEVICE pPciDev, /*unsigned*/ int iRegion, RTGCPHYS GCPhysAddress, uint32_t cb, PCIADDRESSSPACE enmType) 1646 1646 { 1647 VMMDevState *p Data= PCIDEV_2_VMMDEVSTATE(pPciDev);1647 VMMDevState *pThis = PCIDEV_2_VMMDEVSTATE(pPciDev); 1648 1648 int rc = VINF_SUCCESS; 1649 1649 … … 1655 1655 * Save the base port address to simplify Port offset calculations. 1656 1656 */ 1657 p Data->PortBase = (RTIOPORT)GCPhysAddress;1657 pThis->PortBase = (RTIOPORT)GCPhysAddress; 1658 1658 1659 1659 /* … … 1662 1662 rc = PDMDevHlpIOPortRegister(pPciDev->pDevIns, 1663 1663 (RTIOPORT)GCPhysAddress + PORT_VMMDEV_REQUEST_OFFSET, 1, 1664 (void*)p Data, vmmdevRequestHandler,1664 (void*)pThis, vmmdevRequestHandler, 1665 1665 NULL, NULL, NULL, "VMMDev Request Handler"); 1666 1666 AssertRC(rc); … … 1679 1679 static DECLCALLBACK(void *) vmmdevPortQueryInterface(PPDMIBASE pInterface, PDMINTERFACE enmInterface) 1680 1680 { 1681 VMMDevState *p Data= (VMMDevState*)((uintptr_t)pInterface - RT_OFFSETOF(VMMDevState, Base));1681 VMMDevState *pThis = (VMMDevState*)((uintptr_t)pInterface - RT_OFFSETOF(VMMDevState, Base)); 1682 1682 switch (enmInterface) 1683 1683 { 1684 1684 case PDMINTERFACE_BASE: 1685 return &p Data->Base;1685 return &pThis->Base; 1686 1686 case PDMINTERFACE_VMMDEV_PORT: 1687 return &p Data->Port;1687 return &pThis->Port; 1688 1688 #ifdef VBOX_HGCM 1689 1689 case PDMINTERFACE_HGCM_PORT: 1690 return &p Data->HGCMPort;1690 return &pThis->HGCMPort; 1691 1691 #endif 1692 1692 case PDMINTERFACE_LED_PORTS: 1693 1693 /* Currently only for shared folders */ 1694 return &p Data->SharedFolders.ILeds;1694 return &pThis->SharedFolders.ILeds; 1695 1695 default: 1696 1696 return NULL; … … 1708 1708 static DECLCALLBACK(int) vmmdevQueryStatusLed(PPDMILEDPORTS pInterface, unsigned iLUN, PPDMLED *ppLed) 1709 1709 { 1710 VMMDevState *p Data= (VMMDevState *)( (uintptr_t)pInterface - RT_OFFSETOF(VMMDevState, SharedFolders.ILeds) );1710 VMMDevState *pThis = (VMMDevState *)( (uintptr_t)pInterface - RT_OFFSETOF(VMMDevState, SharedFolders.ILeds) ); 1711 1711 if (iLUN == 0) /* LUN 0 is shared folders */ 1712 1712 { 1713 *ppLed = &p Data->SharedFolders.Led;1713 *ppLed = &pThis->SharedFolders.Led; 1714 1714 return VINF_SUCCESS; 1715 1715 } … … 1732 1732 static DECLCALLBACK(int) vmmdevQueryAbsoluteMouse(PPDMIVMMDEVPORT pInterface, uint32_t *pAbsX, uint32_t *pAbsY) 1733 1733 { 1734 VMMDevState *p Data= IVMMDEVPORT_2_VMMDEVSTATE(pInterface);1734 VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface); 1735 1735 if (pAbsX) 1736 *pAbsX = p Data->mouseXAbs;1736 *pAbsX = pThis->mouseXAbs; 1737 1737 if (pAbsY) 1738 *pAbsY = p Data->mouseYAbs;1738 *pAbsY = pThis->mouseYAbs; 1739 1739 return VINF_SUCCESS; 1740 1740 } … … 1749 1749 static DECLCALLBACK(int) vmmdevSetAbsoluteMouse(PPDMIVMMDEVPORT pInterface, uint32_t absX, uint32_t absY) 1750 1750 { 1751 VMMDevState *p Data= IVMMDEVPORT_2_VMMDEVSTATE(pInterface);1751 VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface); 1752 1752 Log2(("vmmdevSetAbsoluteMouse: settings absolute position to x = %d, y = %d\n", absX, absY)); 1753 p Data->mouseXAbs = absX;1754 p Data->mouseYAbs = absY;1753 pThis->mouseXAbs = absX; 1754 pThis->mouseYAbs = absY; 1755 1755 return VINF_SUCCESS; 1756 1756 } … … 1764 1764 static DECLCALLBACK(int) vmmdevQueryMouseCapabilities(PPDMIVMMDEVPORT pInterface, uint32_t *pCapabilities) 1765 1765 { 1766 VMMDevState *p Data= IVMMDEVPORT_2_VMMDEVSTATE(pInterface);1766 VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface); 1767 1767 if (!pCapabilities) 1768 1768 return VERR_INVALID_PARAMETER; 1769 *pCapabilities = p Data->mouseCapabilities;1769 *pCapabilities = pThis->mouseCapabilities; 1770 1770 return VINF_SUCCESS; 1771 1771 } … … 1779 1779 static DECLCALLBACK(int) vmmdevSetMouseCapabilities(PPDMIVMMDEVPORT pInterface, uint32_t capabilities) 1780 1780 { 1781 VMMDevState *p Data= IVMMDEVPORT_2_VMMDEVSTATE(pInterface);1781 VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface); 1782 1782 1783 1783 bool bCapsChanged = ((capabilities & VMMDEV_MOUSEHOSTWANTSABS) 1784 != (p Data->mouseCapabilities & VMMDEV_MOUSEHOSTWANTSABS));1784 != (pThis->mouseCapabilities & VMMDEV_MOUSEHOSTWANTSABS)); 1785 1785 1786 1786 Log(("vmmdevSetMouseCapabilities: bCapsChanged %d\n", bCapsChanged)); 1787 1787 1788 1788 if (capabilities & VMMDEV_MOUSEHOSTCANNOTHWPOINTER) 1789 p Data->mouseCapabilities |= VMMDEV_MOUSEHOSTCANNOTHWPOINTER;1789 pThis->mouseCapabilities |= VMMDEV_MOUSEHOSTCANNOTHWPOINTER; 1790 1790 else 1791 p Data->mouseCapabilities &= ~VMMDEV_MOUSEHOSTCANNOTHWPOINTER;1791 pThis->mouseCapabilities &= ~VMMDEV_MOUSEHOSTCANNOTHWPOINTER; 1792 1792 1793 1793 if (capabilities & VMMDEV_MOUSEHOSTWANTSABS) 1794 p Data->mouseCapabilities |= VMMDEV_MOUSEHOSTWANTSABS;1794 pThis->mouseCapabilities |= VMMDEV_MOUSEHOSTWANTSABS; 1795 1795 else 1796 p Data->mouseCapabilities &= ~VMMDEV_MOUSEHOSTWANTSABS;1796 pThis->mouseCapabilities &= ~VMMDEV_MOUSEHOSTWANTSABS; 1797 1797 1798 1798 if (bCapsChanged) 1799 VMMDevNotifyGuest (p Data, VMMDEV_EVENT_MOUSE_CAPABILITIES_CHANGED);1799 VMMDevNotifyGuest (pThis, VMMDEV_EVENT_MOUSE_CAPABILITIES_CHANGED); 1800 1800 1801 1801 return VINF_SUCCESS; … … 1805 1805 static DECLCALLBACK(int) vmmdevRequestDisplayChange(PPDMIVMMDEVPORT pInterface, uint32_t xres, uint32_t yres, uint32_t bpp, uint32_t display) 1806 1806 { 1807 VMMDevState *p Data= IVMMDEVPORT_2_VMMDEVSTATE(pInterface);1807 VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface); 1808 1808 1809 1809 /* Verify that the new resolution is different and that guest does not yet know about it. */ 1810 bool fSameResolution = (!xres || (p Data->lastReadDisplayChangeRequest.xres == xres)) &&1811 (!yres || (p Data->lastReadDisplayChangeRequest.yres == yres)) &&1812 (!bpp || (p Data->lastReadDisplayChangeRequest.bpp == bpp)) &&1813 p Data->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; 1814 1814 1815 1815 if (!xres && !yres && !bpp) … … 1820 1820 1821 1821 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, p Data->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)); 1823 1823 1824 1824 if (!fSameResolution) … … 1828 1828 1829 1829 /* we could validate the information here but hey, the guest can do that as well! */ 1830 p Data->displayChangeRequest.xres = xres;1831 p Data->displayChangeRequest.yres = yres;1832 p Data->displayChangeRequest.bpp = bpp;1833 p Data->displayChangeRequest.display = display;1830 pThis->displayChangeRequest.xres = xres; 1831 pThis->displayChangeRequest.yres = yres; 1832 pThis->displayChangeRequest.bpp = bpp; 1833 pThis->displayChangeRequest.display = display; 1834 1834 1835 1835 /* IRQ so the guest knows what's going on */ 1836 VMMDevNotifyGuest (p Data, VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST);1836 VMMDevNotifyGuest (pThis, VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST); 1837 1837 } 1838 1838 … … 1842 1842 static DECLCALLBACK(int) vmmdevRequestSeamlessChange(PPDMIVMMDEVPORT pInterface, bool fEnabled) 1843 1843 { 1844 VMMDevState *p Data= IVMMDEVPORT_2_VMMDEVSTATE(pInterface);1844 VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface); 1845 1845 1846 1846 /* Verify that the new resolution is different and that guest does not yet know about it. */ 1847 bool fSameMode = (p Data->fLastSeamlessEnabled == fEnabled);1847 bool fSameMode = (pThis->fLastSeamlessEnabled == fEnabled); 1848 1848 1849 1849 Log(("vmmdevRequestSeamlessChange: same=%d. new=%d\n", fSameMode, fEnabled)); … … 1852 1852 { 1853 1853 /* we could validate the information here but hey, the guest can do that as well! */ 1854 p Data->fSeamlessEnabled = fEnabled;1854 pThis->fSeamlessEnabled = fEnabled; 1855 1855 1856 1856 /* IRQ so the guest knows what's going on */ 1857 VMMDevNotifyGuest (p Data, VMMDEV_EVENT_SEAMLESS_MODE_CHANGE_REQUEST);1857 VMMDevNotifyGuest (pThis, VMMDEV_EVENT_SEAMLESS_MODE_CHANGE_REQUEST); 1858 1858 } 1859 1859 … … 1863 1863 static DECLCALLBACK(int) vmmdevSetMemoryBalloon(PPDMIVMMDEVPORT pInterface, uint32_t ulBalloonSize) 1864 1864 { 1865 VMMDevState *p Data= IVMMDEVPORT_2_VMMDEVSTATE(pInterface);1865 VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface); 1866 1866 1867 1867 /* Verify that the new resolution is different and that guest does not yet know about it. */ 1868 bool fSame = (p Data->u32LastMemoryBalloonSize == ulBalloonSize);1869 1870 Log(("vmmdevSetMemoryBalloon: old=%d. new=%d\n", p Data->u32LastMemoryBalloonSize, ulBalloonSize));1868 bool fSame = (pThis->u32LastMemoryBalloonSize == ulBalloonSize); 1869 1870 Log(("vmmdevSetMemoryBalloon: old=%d. new=%d\n", pThis->u32LastMemoryBalloonSize, ulBalloonSize)); 1871 1871 1872 1872 if (!fSame) 1873 1873 { 1874 1874 /* we could validate the information here but hey, the guest can do that as well! */ 1875 p Data->u32MemoryBalloonSize = ulBalloonSize;1875 pThis->u32MemoryBalloonSize = ulBalloonSize; 1876 1876 1877 1877 /* IRQ so the guest knows what's going on */ 1878 VMMDevNotifyGuest (p Data, VMMDEV_EVENT_BALLOON_CHANGE_REQUEST);1878 VMMDevNotifyGuest (pThis, VMMDEV_EVENT_BALLOON_CHANGE_REQUEST); 1879 1879 } 1880 1880 … … 1884 1884 static DECLCALLBACK(int) vmmdevVRDPChange(PPDMIVMMDEVPORT pInterface, bool fVRDPEnabled, uint32_t u32VRDPExperienceLevel) 1885 1885 { 1886 VMMDevState *p Data= IVMMDEVPORT_2_VMMDEVSTATE(pInterface);1887 1888 bool fSame = (p Data->fVRDPEnabled == fVRDPEnabled);1889 1890 Log(("vmmdevVRDPChange: old=%d. new=%d\n", p Data->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)); 1891 1891 1892 1892 if (!fSame) 1893 1893 { 1894 p Data->fVRDPEnabled = fVRDPEnabled;1895 p Data->u32VRDPExperienceLevel = u32VRDPExperienceLevel;1896 1897 VMMDevNotifyGuest (p Data, VMMDEV_EVENT_VRDP);1894 pThis->fVRDPEnabled = fVRDPEnabled; 1895 pThis->u32VRDPExperienceLevel = u32VRDPExperienceLevel; 1896 1897 VMMDevNotifyGuest (pThis, VMMDEV_EVENT_VRDP); 1898 1898 } 1899 1899 … … 1903 1903 static DECLCALLBACK(int) vmmdevSetStatisticsInterval(PPDMIVMMDEVPORT pInterface, uint32_t ulStatInterval) 1904 1904 { 1905 VMMDevState *p Data= IVMMDEVPORT_2_VMMDEVSTATE(pInterface);1905 VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface); 1906 1906 1907 1907 /* Verify that the new resolution is different and that guest does not yet know about it. */ 1908 bool fSame = (p Data->u32LastStatIntervalSize == ulStatInterval);1909 1910 Log(("vmmdevSetStatisticsInterval: old=%d. new=%d\n", p Data->u32LastStatIntervalSize, ulStatInterval));1908 bool fSame = (pThis->u32LastStatIntervalSize == ulStatInterval); 1909 1910 Log(("vmmdevSetStatisticsInterval: old=%d. new=%d\n", pThis->u32LastStatIntervalSize, ulStatInterval)); 1911 1911 1912 1912 if (!fSame) 1913 1913 { 1914 1914 /* we could validate the information here but hey, the guest can do that as well! */ 1915 p Data->u32StatIntervalSize = ulStatInterval;1915 pThis->u32StatIntervalSize = ulStatInterval; 1916 1916 1917 1917 /* IRQ so the guest knows what's going on */ 1918 VMMDevNotifyGuest (p Data, VMMDEV_EVENT_STATISTICS_INTERVAL_CHANGE_REQUEST);1918 VMMDevNotifyGuest (pThis, VMMDEV_EVENT_STATISTICS_INTERVAL_CHANGE_REQUEST); 1919 1919 } 1920 1920 … … 1927 1927 uint32_t u32Flags) 1928 1928 { 1929 VMMDevState *p Data= IVMMDEVPORT_2_VMMDEVSTATE(pInterface);1929 VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface); 1930 1930 1931 1931 /* logon mode? */ … … 1933 1933 { 1934 1934 /* memorize the data */ 1935 strcpy(p Data->credentialsLogon.szUserName, pszUsername);1936 strcpy(p Data->credentialsLogon.szPassword, pszPassword);1937 strcpy(p Data->credentialsLogon.szDomain, pszDomain);1938 p Data->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); 1939 1939 } 1940 1940 /* credentials verification mode? */ … … 1942 1942 { 1943 1943 /* memorize the data */ 1944 strcpy(p Data->credentialsJudge.szUserName, pszUsername);1945 strcpy(p Data->credentialsJudge.szPassword, pszPassword);1946 strcpy(p Data->credentialsJudge.szDomain, pszDomain);1947 1948 VMMDevNotifyGuest (p Data, 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); 1949 1949 } 1950 1950 else … … 1962 1962 static DECLCALLBACK(void) vmmdevVBVAChange(PPDMIVMMDEVPORT pInterface, bool fEnabled) 1963 1963 { 1964 VMMDevState *p Data= IVMMDEVPORT_2_VMMDEVSTATE(pInterface);1964 VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface); 1965 1965 1966 1966 Log(("vmmdevVBVAChange: fEnabled = %d\n", fEnabled)); 1967 1967 1968 if (p Data)1969 { 1970 p Data->u32VideoAccelEnabled = fEnabled;1968 if (pThis) 1969 { 1970 pThis->u32VideoAccelEnabled = fEnabled; 1971 1971 } 1972 1972 … … 1993 1993 static DECLCALLBACK(int) vmmdevSaveState(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle) 1994 1994 { 1995 VMMDevState *p Data= PDMINS_2_DATA(pDevIns, VMMDevState*);1996 SSMR3PutU32(pSSMHandle, p Data->hypervisorSize);1997 SSMR3PutU32(pSSMHandle, p Data->mouseCapabilities);1998 SSMR3PutU32(pSSMHandle, p Data->mouseXAbs);1999 SSMR3PutU32(pSSMHandle, p Data->mouseYAbs);2000 2001 SSMR3PutBool(pSSMHandle, p Data->fNewGuestFilterMask);2002 SSMR3PutU32(pSSMHandle, p Data->u32NewGuestFilterMask);2003 SSMR3PutU32(pSSMHandle, p Data->u32GuestFilterMask);2004 SSMR3PutU32(pSSMHandle, p Data->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); 2005 2005 // here be dragons (probably) 2006 // SSMR3PutBool(pSSMHandle, p Data->pVMMDevRAMHC->V.V1_04.fHaveEvents);2007 SSMR3PutMem(pSSMHandle, &p Data->pVMMDevRAMHC->V, sizeof (pData->pVMMDevRAMHC->V));2008 2009 SSMR3PutMem(pSSMHandle, &p Data->guestInfo, sizeof (pData->guestInfo));2010 SSMR3PutU32(pSSMHandle, p Data->fu32AdditionsOk);2011 SSMR3PutU32(pSSMHandle, p Data->u32VideoAccelEnabled);2012 2013 SSMR3PutU32(pSSMHandle, p Data->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); 2014 2014 2015 2015 #ifdef VBOX_HGCM 2016 vmmdevHGCMSaveState (p Data, pSSMHandle);2016 vmmdevHGCMSaveState (pThis, pSSMHandle); 2017 2017 #endif /* VBOX_HGCM */ 2018 2018 … … 2031 2031 { 2032 2032 /** @todo The code load code is assuming we're always loaded into a fresh VM. */ 2033 VMMDevState *p Data= PDMINS_2_DATA(pDevIns, VMMDevState*);2033 VMMDevState *pThis = PDMINS_2_DATA(pDevIns, VMMDevState*); 2034 2034 if ( SSM_VERSION_MAJOR_CHANGED(u32Version, VMMDEV_SSM_VERSION) 2035 2035 || (SSM_VERSION_MINOR(u32Version) < 6)) 2036 2036 return VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION; 2037 2037 2038 SSMR3GetU32(pSSMHandle, &p Data->hypervisorSize);2039 SSMR3GetU32(pSSMHandle, &p Data->mouseCapabilities);2040 SSMR3GetU32(pSSMHandle, &p Data->mouseXAbs);2041 SSMR3GetU32(pSSMHandle, &p Data->mouseYAbs);2042 2043 SSMR3GetBool(pSSMHandle, &p Data->fNewGuestFilterMask);2044 SSMR3GetU32(pSSMHandle, &p Data->u32NewGuestFilterMask);2045 SSMR3GetU32(pSSMHandle, &p Data->u32GuestFilterMask);2046 SSMR3GetU32(pSSMHandle, &p Data->u32HostEventFlags);2047 // SSMR3GetBool(pSSMHandle, &p Data->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); 2048 2048 // here be dragons (probably) 2049 SSMR3GetMem(pSSMHandle, &p Data->pVMMDevRAMHC->V, sizeof (pData->pVMMDevRAMHC->V));2050 2051 SSMR3GetMem(pSSMHandle, &p Data->guestInfo, sizeof (pData->guestInfo));2052 SSMR3GetU32(pSSMHandle, &p Data->fu32AdditionsOk);2053 SSMR3GetU32(pSSMHandle, &p Data->u32VideoAccelEnabled);2054 2055 SSMR3GetU32(pSSMHandle, &p Data->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); 2056 2056 2057 2057 /* Attributes which were temporarily introduced in r30072 */ … … 2065 2065 2066 2066 #ifdef VBOX_HGCM 2067 vmmdevHGCMLoadState (p Data, pSSMHandle);2067 vmmdevHGCMLoadState (pThis, pSSMHandle); 2068 2068 #endif /* VBOX_HGCM */ 2069 2069 … … 2072 2072 * that listeners can sync their state again 2073 2073 */ 2074 Log(("vmmdevLoadState: capabilities changed (%x), informing connector\n", p Data->mouseCapabilities));2075 if (p Data->pDrv)2076 p Data->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); 2077 2077 2078 2078 /* Reestablish the acceleration status. */ 2079 if ( p Data->u32VideoAccelEnabled2080 && p Data->pDrv)2081 { 2082 p Data->pDrv->pfnVideoAccelEnable (pData->pDrv, !!pData->u32VideoAccelEnabled, &pData->pVMMDevRAMHC->vbvaMemory);2083 } 2084 2085 if (p Data->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) 2086 2086 { 2087 2087 LogRel(("Guest Additions information report: additionsVersion = 0x%08X, osType = 0x%08X\n", 2088 p Data->guestInfo.additionsVersion,2089 p Data->guestInfo.osType));2090 if (p Data->pDrv)2091 p Data->pDrv->pfnUpdateGuestVersion(pData->pDrv, &pData->guestInfo);2092 } 2093 if (p Data->pDrv)2094 p Data->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); 2095 2095 2096 2096 return VINF_SUCCESS; … … 2106 2106 static DECLCALLBACK(int) vmmdevLoadStateDone(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle) 2107 2107 { 2108 VMMDevState *p Data= PDMINS_2_DATA(pDevIns, VMMDevState*);2108 VMMDevState *pThis = PDMINS_2_DATA(pDevIns, VMMDevState*); 2109 2109 2110 2110 #ifdef VBOX_HGCM 2111 vmmdevHGCMLoadStateDone (p Data, pSSMHandle);2111 vmmdevHGCMLoadStateDone (pThis, pSSMHandle); 2112 2112 #endif /* VBOX_HGCM */ 2113 2113 2114 VMMDevNotifyGuest (p Data, VMMDEV_EVENT_RESTORED);2114 VMMDevNotifyGuest (pThis, VMMDEV_EVENT_RESTORED); 2115 2115 2116 2116 return VINF_SUCCESS; … … 2120 2120 * (Re-)initializes the MMIO2 data. 2121 2121 * 2122 * @param p DataPointer to the VMMDev instance data.2122 * @param pThis Pointer to the VMMDev instance data. 2123 2123 */ 2124 static void vmmdevInitRam(VMMDevState *p Data)2125 { 2126 memset(p Data->pVMMDevRAMHC, 0, sizeof(VMMDevMemory));2127 p Data->pVMMDevRAMHC->u32Size = sizeof(VMMDevMemory);2128 p Data->pVMMDevRAMHC->u32Version = VMMDEV_MEMORY_VERSION;2124 static 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; 2129 2129 } 2130 2130 … … 2145 2145 { 2146 2146 int rc; 2147 VMMDevState *p Data= PDMINS_2_DATA(pDevIns, VMMDevState *);2147 VMMDevState *pThis = PDMINS_2_DATA(pDevIns, VMMDevState *); 2148 2148 2149 2149 Assert(iInstance == 0); … … 2155 2155 return VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES; 2156 2156 2157 rc = CFGMR3QueryBool(pCfgHandle, "GetHostTimeDisabled", &p Data->fGetHostTimeDisabled);2157 rc = CFGMR3QueryBool(pCfgHandle, "GetHostTimeDisabled", &pThis->fGetHostTimeDisabled); 2158 2158 if (rc == VERR_CFGM_VALUE_NOT_FOUND) 2159 p Data->fGetHostTimeDisabled = false;2159 pThis->fGetHostTimeDisabled = false; 2160 2160 else if (RT_FAILURE(rc)) 2161 2161 return PDMDEV_SET_ERROR(pDevIns, rc, 2162 2162 N_("Configuration error: Failed querying \"GetHostTimeDisabled\" as a boolean")); 2163 2163 2164 rc = CFGMR3QueryBool(pCfgHandle, "BackdoorLogDisabled", &p Data->fBackdoorLogDisabled);2164 rc = CFGMR3QueryBool(pCfgHandle, "BackdoorLogDisabled", &pThis->fBackdoorLogDisabled); 2165 2165 if (rc == VERR_CFGM_VALUE_NOT_FOUND) 2166 p Data->fBackdoorLogDisabled = false;2166 pThis->fBackdoorLogDisabled = false; 2167 2167 else if (RT_FAILURE(rc)) 2168 2168 return PDMDEV_SET_ERROR(pDevIns, rc, 2169 2169 N_("Configuration error: Failed querying \"BackdoorLogDisabled\" as a boolean")); 2170 2170 2171 rc = CFGMR3QueryBool(pCfgHandle, "KeepCredentials", &p Data->fKeepCredentials);2171 rc = CFGMR3QueryBool(pCfgHandle, "KeepCredentials", &pThis->fKeepCredentials); 2172 2172 if (rc == VERR_CFGM_VALUE_NOT_FOUND) 2173 p Data->fKeepCredentials = false;2173 pThis->fKeepCredentials = false; 2174 2174 else if (RT_FAILURE(rc)) 2175 2175 return PDMDEV_SET_ERROR(pDevIns, rc, … … 2180 2180 */ 2181 2181 /* Save PDM device instance data for future reference. */ 2182 p Data->pDevIns = pDevIns;2182 pThis->pDevIns = pDevIns; 2183 2183 2184 2184 /* PCI vendor, just a free bogus value */ 2185 p Data->dev.config[0x00] = 0xee;2186 p Data->dev.config[0x01] = 0x80;2185 pThis->dev.config[0x00] = 0xee; 2186 pThis->dev.config[0x01] = 0x80; 2187 2187 /* device ID */ 2188 p Data->dev.config[0x02] = 0xfe;2189 p Data->dev.config[0x03] = 0xca;2188 pThis->dev.config[0x02] = 0xfe; 2189 pThis->dev.config[0x03] = 0xca; 2190 2190 /* class sub code (other type of system peripheral) */ 2191 p Data->dev.config[0x0a] = 0x80;2191 pThis->dev.config[0x0a] = 0x80; 2192 2192 /* class base code (base system peripheral) */ 2193 p Data->dev.config[0x0b] = 0x08;2193 pThis->dev.config[0x0b] = 0x08; 2194 2194 /* header type */ 2195 p Data->dev.config[0x0e] = 0x00;2195 pThis->dev.config[0x0e] = 0x00; 2196 2196 /* interrupt on pin 0 */ 2197 p Data->dev.config[0x3d] = 0x01;2197 pThis->dev.config[0x3d] = 0x01; 2198 2198 2199 2199 /* … … 2201 2201 */ 2202 2202 /* Base */ 2203 p Data->Base.pfnQueryInterface = vmmdevPortQueryInterface;2203 pThis->Base.pfnQueryInterface = vmmdevPortQueryInterface; 2204 2204 2205 2205 /* VMMDev port */ 2206 p Data->Port.pfnQueryAbsoluteMouse = vmmdevQueryAbsoluteMouse;2207 p Data->Port.pfnSetAbsoluteMouse = vmmdevSetAbsoluteMouse;2208 p Data->Port.pfnQueryMouseCapabilities = vmmdevQueryMouseCapabilities;2209 p Data->Port.pfnSetMouseCapabilities = vmmdevSetMouseCapabilities;2210 p Data->Port.pfnRequestDisplayChange = vmmdevRequestDisplayChange;2211 p Data->Port.pfnSetCredentials = vmmdevSetCredentials;2212 p Data->Port.pfnVBVAChange = vmmdevVBVAChange;2213 p Data->Port.pfnRequestSeamlessChange = vmmdevRequestSeamlessChange;2214 p Data->Port.pfnSetMemoryBalloon = vmmdevSetMemoryBalloon;2215 p Data->Port.pfnSetStatisticsInterval = vmmdevSetStatisticsInterval;2216 p Data->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; 2217 2217 2218 2218 /* Shared folder LED */ 2219 p Data->SharedFolders.Led.u32Magic = PDMLED_MAGIC;2220 p Data->SharedFolders.ILeds.pfnQueryStatusLed = vmmdevQueryStatusLed;2219 pThis->SharedFolders.Led.u32Magic = PDMLED_MAGIC; 2220 pThis->SharedFolders.ILeds.pfnQueryStatusLed = vmmdevQueryStatusLed; 2221 2221 2222 2222 #ifdef VBOX_HGCM 2223 2223 /* HGCM port */ 2224 p Data->HGCMPort.pfnCompleted = hgcmCompleted;2224 pThis->HGCMPort.pfnCompleted = hgcmCompleted; 2225 2225 #endif 2226 2226 2227 2227 /** @todo convert this into a config parameter like we do everywhere else.*/ 2228 p Data->cbGuestRAM = MMR3PhysGetRamSize(PDMDevHlpGetVM(pDevIns));2228 pThis->cbGuestRAM = MMR3PhysGetRamSize(PDMDevHlpGetVM(pDevIns)); 2229 2229 2230 2230 /* … … 2245 2245 * Allocate and initialize the MMIO2 memory. 2246 2246 */ 2247 rc = PDMDevHlpMMIO2Register(pDevIns, 1 /*iRegion*/, VMMDEV_RAM_SIZE, 0, (void **)&p Data->pVMMDevRAMHC, "VMMDev");2247 rc = PDMDevHlpMMIO2Register(pDevIns, 1 /*iRegion*/, VMMDEV_RAM_SIZE, 0, (void **)&pThis->pVMMDevRAMHC, "VMMDev"); 2248 2248 if (RT_FAILURE(rc)) 2249 2249 return PDMDevHlpVMSetError(pDevIns, rc, RT_SRC_POS, 2250 2250 N_("Failed to allocate %u bytes of memory for the VMM device"), VMMDEV_RAM_SIZE); 2251 vmmdevInitRam(p Data);2251 vmmdevInitRam(pThis); 2252 2252 2253 2253 /* 2254 2254 * Register the PCI device. 2255 2255 */ 2256 rc = PDMDevHlpPCIRegister(pDevIns, &p Data->dev);2256 rc = PDMDevHlpPCIRegister(pDevIns, &pThis->dev); 2257 2257 if (RT_FAILURE(rc)) 2258 2258 return rc; 2259 if (p Data->dev.devfn == 32 || iInstance != 0)2260 Log(("!!WARNING!!: p Data->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)); 2261 2261 rc = PDMDevHlpPCIIORegionRegister(pDevIns, 0, 0x20, PCI_ADDRESS_SPACE_IO, vmmdevIOPortRegionMap); 2262 2262 if (RT_FAILURE(rc)) … … 2269 2269 * Get the corresponding connector interface 2270 2270 */ 2271 rc = PDMDevHlpDriverAttach(pDevIns, 0, &p Data->Base, &pData->pDrvBase, "VMM Driver Port");2271 rc = PDMDevHlpDriverAttach(pDevIns, 0, &pThis->Base, &pThis->pDrvBase, "VMM Driver Port"); 2272 2272 if (RT_SUCCESS(rc)) 2273 2273 { 2274 p Data->pDrv = (PPDMIVMMDEVCONNECTOR)pData->pDrvBase->pfnQueryInterface(pData->pDrvBase, PDMINTERFACE_VMMDEV_CONNECTOR);2275 if (!p Data->pDrv)2274 pThis->pDrv = (PPDMIVMMDEVCONNECTOR)pThis->pDrvBase->pfnQueryInterface(pThis->pDrvBase, PDMINTERFACE_VMMDEV_CONNECTOR); 2275 if (!pThis->pDrv) 2276 2276 AssertMsgFailedReturn(("LUN #0 doesn't have a VMMDev connector interface!\n"), VERR_PDM_MISSING_INTERFACE); 2277 2277 #ifdef VBOX_HGCM 2278 p Data->pHGCMDrv = (PPDMIHGCMCONNECTOR)pData->pDrvBase->pfnQueryInterface(pData->pDrvBase, PDMINTERFACE_HGCM_CONNECTOR);2279 if (!p Data->pHGCMDrv)2278 pThis->pHGCMDrv = (PPDMIHGCMCONNECTOR)pThis->pDrvBase->pfnQueryInterface(pThis->pDrvBase, PDMINTERFACE_HGCM_CONNECTOR); 2279 if (!pThis->pHGCMDrv) 2280 2280 { 2281 2281 Log(("LUN #0 doesn't have a HGCM connector interface, HGCM is not supported. rc=%Vrc\n", rc)); … … 2296 2296 */ 2297 2297 PPDMIBASE pBase; 2298 rc = PDMDevHlpDriverAttach(pDevIns, PDM_STATUS_LUN, &p Data->Base, &pBase, "Status Port");2298 rc = PDMDevHlpDriverAttach(pDevIns, PDM_STATUS_LUN, &pThis->Base, &pBase, "Status Port"); 2299 2299 if (RT_SUCCESS(rc)) 2300 p Data->SharedFolders.pLedsConnector = (PPDMILEDCONNECTORS)2300 pThis->SharedFolders.pLedsConnector = (PPDMILEDCONNECTORS) 2301 2301 pBase->pfnQueryInterface(pBase, PDMINTERFACE_LED_CONNECTORS); 2302 2302 else if (rc != VERR_PDM_NO_ATTACHED_DRIVER) … … 2309 2309 * Register saved state and init the HGCM CmdList critsect. 2310 2310 */ 2311 rc = PDMDevHlpSSMRegister(pDevIns, "VMMDev", iInstance, VMMDEV_SSM_VERSION, sizeof(*p Data),2311 rc = PDMDevHlpSSMRegister(pDevIns, "VMMDev", iInstance, VMMDEV_SSM_VERSION, sizeof(*pThis), 2312 2312 NULL, vmmdevSaveState, NULL, 2313 2313 NULL, vmmdevLoadState, vmmdevLoadStateDone); … … 2315 2315 2316 2316 #ifdef VBOX_HGCM 2317 p Data->pHGCMCmdList = NULL;2318 rc = RTCritSectInit(&p Data->critsectHGCMCmdList);2317 pThis->pHGCMCmdList = NULL; 2318 rc = RTCritSectInit(&pThis->critsectHGCMCmdList); 2319 2319 AssertRCReturn(rc, rc); 2320 p Data->u32HGCMEnabled = 0;2320 pThis->u32HGCMEnabled = 0; 2321 2321 #endif /* VBOX_HGCM */ 2322 2322 … … 2332 2332 static DECLCALLBACK(void) vmmdevReset(PPDMDEVINS pDevIns) 2333 2333 { 2334 VMMDevState *p Data= PDMINS_2_DATA(pDevIns, VMMDevState*);2334 VMMDevState *pThis = PDMINS_2_DATA(pDevIns, VMMDevState*); 2335 2335 2336 2336 /* 2337 2337 * Reset the mouse integration feature bit 2338 2338 */ 2339 if (p Data->mouseCapabilities & (VMMDEV_MOUSEGUESTWANTSABS|VMMDEV_MOUSEGUESTNEEDSHOSTCUR))2340 { 2341 p Data->mouseCapabilities &= ~VMMDEV_MOUSEGUESTWANTSABS;2339 if (pThis->mouseCapabilities & (VMMDEV_MOUSEGUESTWANTSABS|VMMDEV_MOUSEGUESTNEEDSHOSTCUR)) 2340 { 2341 pThis->mouseCapabilities &= ~VMMDEV_MOUSEGUESTWANTSABS; 2342 2342 /* notify the connector */ 2343 Log(("vmmdevReset: capabilities changed (%x), informing connector\n", p Data->mouseCapabilities));2344 p Data->pDrv->pfnUpdateMouseCapabilities(pData->pDrv, pData->mouseCapabilities);2345 } 2346 2347 p Data->hypervisorSize = 0;2348 2349 p Data->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; 2350 2350 2351 2351 /* re-initialize the VMMDev memory */ 2352 if (p Data->pVMMDevRAMHC)2353 vmmdevInitRam(p Data);2352 if (pThis->pVMMDevRAMHC) 2353 vmmdevInitRam(pThis); 2354 2354 2355 2355 /* credentials have to go away (by default) */ 2356 if (!p Data->fKeepCredentials)2357 { 2358 memset(p Data->credentialsLogon.szUserName, '\0', VMMDEV_CREDENTIALS_STRLEN);2359 memset(p Data->credentialsLogon.szPassword, '\0', VMMDEV_CREDENTIALS_STRLEN);2360 memset(p Data->credentialsLogon.szDomain, '\0', VMMDEV_CREDENTIALS_STRLEN);2361 } 2362 memset(p Data->credentialsJudge.szUserName, '\0', VMMDEV_CREDENTIALS_STRLEN);2363 memset(p Data->credentialsJudge.szPassword, '\0', VMMDEV_CREDENTIALS_STRLEN);2364 memset(p Data->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); 2365 2365 2366 2366 /* Reset means that additions will report again. */ 2367 const bool fVersionChanged = p Data->fu32AdditionsOk2368 || p Data->guestInfo.additionsVersion2369 || p Data->guestInfo.osType != VBOXOSTYPE_Unknown;2367 const bool fVersionChanged = pThis->fu32AdditionsOk 2368 || pThis->guestInfo.additionsVersion 2369 || pThis->guestInfo.osType != VBOXOSTYPE_Unknown; 2370 2370 if (fVersionChanged) 2371 2371 Log(("vmmdevReset: fu32AdditionsOk=%d additionsVersion=%x osType=%#x\n", 2372 p Data->fu32AdditionsOk, pData->guestInfo.additionsVersion, pData->guestInfo.osType));2373 p Data->fu32AdditionsOk = false;2374 memset (&p Data->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)); 2375 2375 2376 2376 /* clear pending display change request. */ 2377 memset (&p Data->lastReadDisplayChangeRequest, 0, sizeof (pData->lastReadDisplayChangeRequest));2377 memset (&pThis->lastReadDisplayChangeRequest, 0, sizeof (pThis->lastReadDisplayChangeRequest)); 2378 2378 2379 2379 /* disable seamless mode */ 2380 p Data->fLastSeamlessEnabled = false;2380 pThis->fLastSeamlessEnabled = false; 2381 2381 2382 2382 /* disabled memory ballooning */ 2383 p Data->u32LastMemoryBalloonSize = 0;2383 pThis->u32LastMemoryBalloonSize = 0; 2384 2384 2385 2385 /* disabled statistics updating */ 2386 p Data->u32LastStatIntervalSize = 0;2386 pThis->u32LastStatIntervalSize = 0; 2387 2387 2388 2388 /* 2389 2389 * Clear the event variables. 2390 2390 * 2391 * Note: The p Data->u32HostEventFlags is not cleared.2391 * Note: The pThis->u32HostEventFlags is not cleared. 2392 2392 * It is designed that way so host events do not 2393 2393 * depend on guest resets. 2394 2394 */ 2395 p Data->u32GuestFilterMask = 0;2396 p Data->u32NewGuestFilterMask = 0;2397 p Data->fNewGuestFilterMask = 0;2395 pThis->u32GuestFilterMask = 0; 2396 pThis->u32NewGuestFilterMask = 0; 2397 pThis->fNewGuestFilterMask = 0; 2398 2398 2399 2399 /* This is the default, as Windows and OS/2 guests take this for granted. (Actually, neither does...) */ 2400 2400 /** @todo change this when we next bump the interface version */ 2401 const bool fCapsChanged = p Data->guestCaps != VMMDEV_GUEST_SUPPORTS_GRAPHICS;2401 const bool fCapsChanged = pThis->guestCaps != VMMDEV_GUEST_SUPPORTS_GRAPHICS; 2402 2402 if (fCapsChanged) 2403 Log(("vmmdevReset: fCapsChanged=%#x -> %#x\n", p Data->guestCaps, VMMDEV_GUEST_SUPPORTS_GRAPHICS));2404 p Data->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?*/ 2405 2405 2406 2406 /* … … 2408 2408 */ 2409 2409 if (fVersionChanged) 2410 p Data->pDrv->pfnUpdateGuestVersion(pData->pDrv, &pData->guestInfo);2410 pThis->pDrv->pfnUpdateGuestVersion(pThis->pDrv, &pThis->guestInfo); 2411 2411 if (fCapsChanged) 2412 p Data->pDrv->pfnUpdateGuestCapabilities(pData->pDrv, pData->guestCaps);2412 pThis->pDrv->pfnUpdateGuestCapabilities(pThis->pDrv, pThis->guestCaps); 2413 2413 } 2414 2414
Note:
See TracChangeset
for help on using the changeset viewer.