Changeset 30758 in vbox
- Timestamp:
- Jul 9, 2010 12:30:12 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 63541
- Location:
- trunk
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/VBoxGuestLib.h
r30668 r30758 412 412 VBGLR3DECL(int) VbglR3SetGuestCaps(uint32_t fOr, uint32_t fNot); 413 413 VBGLR3DECL(int) VbglR3WaitEvent(uint32_t fMask, uint32_t cMillies, uint32_t *pfEvents); 414 415 VBGLR3DECL(int) VbglR3ReportAdditionsStatus(uint32_t u32Facility, uint32_t u32Status, uint32_t u32Flags); 414 416 VBGLR3DECL(int) VbglR3GetAdditionsVersion(char **ppszVer, char **ppszRev); 415 417 VBGLR3DECL(int) VbglR3GetAdditionsInstallationPath(char **ppszPath); -
trunk/include/VBox/VMMDev.h
r30668 r30758 138 138 VMMDevReq_ReportGuestInfo = 50, 139 139 VMMDevReq_ReportGuestInfo2 = 58, /* since version 3.2.0 */ 140 VMMDevReq_ReportGuestStatus = 59, /* since version 3.2.8 */ 140 141 VMMDevReq_GetDisplayChangeRequest = 51, 141 142 VMMDevReq_VideoModeSupported = 52, … … 434 435 AssertCompileSize(VMMDevReqGuestCapabilities2, 24+8); 435 436 436 /** @name Guest capability bits 437 /** @name Guest capability bits. 437 438 * Used by VMMDevReq_ReportGuestCapabilities and VMMDevReq_SetGuestCapabilities. 438 439 * @{ */ … … 645 646 } VMMDevReportGuestInfo2; 646 647 AssertCompileSize(VMMDevReportGuestInfo2, 24+144); 648 649 650 /** 651 * Guest status facility. 652 */ 653 typedef enum 654 { 655 VBoxGuestStatusFacility_Unknown = 0, 656 VBoxGuestStatusFacility_VBoxGuestDriver = 20, 657 VBoxGuestStatusFacility_VBoxService = 100, 658 VBoxGuestStatusFacility_VBoxTray = 101, 659 VBoxGuestStatusFacility_All = 999, 660 VBoxGuestStatusFacility_SizeHack = 0x7fffffff 661 } VBoxGuestStatusFacility; 662 AssertCompileSize(VBoxGuestStatusFacility, 4); 663 664 /** 665 * The current guest status of a facility. 666 */ 667 typedef enum 668 { 669 VBoxGuestStatusCurrent_Disabled = 0, 670 VBoxGuestStatusCurrent_Inactive = 1, 671 VBoxGuestStatusCurrent_PreInit = 20, 672 VBoxGuestStatusCurrent_Init = 30, 673 VBoxGuestStatusCurrent_Active = 50, 674 VBoxGuestStatusCurrent_Terminating = 100, 675 VBoxGuestStatusCurrent_Terminated = 101, 676 VBoxGuestStatusCurrent_SizeHack = 0x7fffffff 677 } VBoxGuestStatusCurrent; 678 AssertCompileSize(VBoxGuestStatusCurrent, 4); 679 680 /** 681 * Guest status structure. 682 * 683 * Used by VMMDevReqGuestStatus. 684 */ 685 typedef struct VBoxGuestStatus 686 { 687 /** Facility the status is indicated for. */ 688 uint32_t facility; 689 /** Current guest status. */ 690 uint32_t status; 691 /** Flags, not used. */ 692 uint32_t flags; 693 } VBoxGuestStatus; 694 AssertCompileSize(VBoxGuestStatus, 12); 695 696 /** 697 * Guest Additions status structure. 698 * 699 * Used by VMMDevReq_ReportGuestStatus. 700 */ 701 typedef struct 702 { 703 /** Header. */ 704 VMMDevRequestHeader header; 705 /** Guest information. */ 706 VBoxGuestStatus guestStatus; 707 } VMMDevReportGuestStatus; 708 AssertCompileSize(VMMDevReportGuestStatus, 24+12); 647 709 648 710 … … 1665 1727 case VMMDevReq_ReportGuestInfo2: 1666 1728 return sizeof(VMMDevReportGuestInfo2); 1729 case VMMDevReq_ReportGuestStatus: 1730 return sizeof(VMMDevReportGuestStatus); 1667 1731 case VMMDevReq_GetDisplayChangeRequest: 1668 1732 return sizeof(VMMDevDisplayChangeRequest); -
trunk/include/VBox/pdmifs.h
r30467 r30758 2090 2090 { 2091 2091 /** 2092 * Report guest OS version. 2093 * Called whenever the Additions issue a guest version report request. 2092 * Reports the guest status. 2093 * Called whenever the Additions issue a guest status report request. 2094 * 2095 * @param pInterface Pointer to this interface. 2096 * @param pGuestStatus Pointer to guest information structure 2097 * @thread The emulation thread. 2098 */ 2099 DECLR3CALLBACKMEMBER(void, pfnUpdateGuestStatus,(PPDMIVMMDEVCONNECTOR pInterface, const struct VBoxGuestStatus *pGuestStatus)); 2100 2101 /** 2102 * Reports the guest API and OS version. 2103 * Called whenever the Additions issue a guest info report request. 2094 2104 * 2095 2105 * @param pInterface Pointer to this interface. … … 2097 2107 * @thread The emulation thread. 2098 2108 */ 2099 DECLR3CALLBACKMEMBER(void, pfnUpdateGuest Version,(PPDMIVMMDEVCONNECTOR pInterface,struct VBoxGuestInfo *pGuestInfo));2109 DECLR3CALLBACKMEMBER(void, pfnUpdateGuestInfo,(PPDMIVMMDEVCONNECTOR pInterface, const struct VBoxGuestInfo *pGuestInfo)); 2100 2110 2101 2111 /** -
trunk/src/VBox/Additions/WINNT/VBoxGuest/Helper.cpp
r29619 r30758 191 191 } 192 192 193 /** @todo maybe we should drop this routine entirely later because we detecting 194 * the running OS via VBoxService in ring 3 using guest properties since a while. */ 193 /** @todo Maybe we should drop this routine entirely later because we detecting 194 * the running OS via VBoxService in ring 3 using guest properties since a while. 195 * 196 * @todo Consider of using vboxGuestInitReportGuestInfo in the ..\common\Helper.cpp 197 * module to have a common base and less redundant code. 198 */ 195 199 NTSTATUS hlpVBoxReportGuestInfo (PVBOXGUESTDEVEXT pDevExt) 196 200 { … … 234 238 if (RT_FAILURE(rc)) 235 239 { 236 dprintf(("VBoxGuest::hlpVBoxReportGuestInfo: error reporting guest info to VMMDev. "240 dprintf(("VBoxGuest::hlpVBoxReportGuestInfo: Error reporting guest info to VMMDev. " 237 241 "rc = %Rrc\n", rc)); 238 242 } … … 258 262 if (RT_FAILURE(rc)) 259 263 { 260 dprintf(("VBoxGuest::hlpVBoxReportGuestInfo: error reporting guest info to VMMDev. "264 dprintf(("VBoxGuest::hlpVBoxReportGuestInfo: Error reporting guest info to VMMDev. " 261 265 "rc = %Rrc\n", rc)); 262 266 } 263 if (rc == VERR_NOT_IMPLEMENTED) 267 if (rc == VERR_NOT_IMPLEMENTED) /* Compatibility with older hosts. */ 264 268 rc = VINF_SUCCESS; 265 266 269 VbglGRFree (&pReq2->header); 267 270 } 268 271 272 /* 273 * Report guest status to host. Because the host set the "Guest Additions active" flag as soon 274 * as he received the VMMDevReportGuestInfo above to make sure all is compatible with older Guest 275 * Additions we now have to disable that flag again here (too early, VBoxService and friends need 276 * to start up first). 277 */ 278 VMMDevReportGuestStatus *pReq3; 279 rc = VbglGRAlloc((VMMDevRequestHeader **)&pReq3, sizeof(*pReq3), VMMDevReq_ReportGuestStatus); 280 if (RT_SUCCESS(rc)) 281 { 282 pReq3->guestStatus.facility = VBoxGuestStatusFacility_VBoxGuestDriver; 283 pReq3->guestStatus.status = VBoxGuestStatusCurrent_Active; /** @todo Are we actually *really* active at this point? */ 284 pReq3->guestStatus.flags = 0; 285 rc = VbglGRPerform(&pReq3->header); 286 if (RT_FAILURE(rc)) 287 dprintf(("VBoxGuest::hlpVBoxReportGuestInfo: Reporting guest status failed with rc=%Rrc\n", rc)); 288 if (rc == VERR_NOT_IMPLEMENTED) /* Compatibility with older hosts. */ 289 rc = VINF_SUCCESS; 290 VbglGRFree(&pReq3->header); 291 } 292 269 293 return RT_FAILURE(rc) ? STATUS_UNSUCCESSFUL : STATUS_SUCCESS; 270 294 } -
trunk/src/VBox/Additions/WINNT/VBoxGuest/VBoxGuest.cpp
r30569 r30758 833 833 NTSTATUS VBoxGuestDeviceControl(PDEVICE_OBJECT pDevObj, PIRP pIrp) 834 834 { 835 dprintf(("VBoxGuest::VBoxGuestDeviceControl\n"));835 //dprintf(("VBoxGuest::VBoxGuestDeviceControl\n")); 836 836 837 837 NTSTATUS Status = STATUS_SUCCESS; … … 873 873 * time a wait event is arrived. 874 874 */ 875 dprintf(("VBoxGuest::VBoxGuestDeviceControl: VBOXGUEST_IOCTL_WAITEVENT\n"));875 //dprintf(("VBoxGuest::VBoxGuestDeviceControl: VBOXGUEST_IOCTL_WAITEVENT\n")); 876 876 877 877 if (pStack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(VBoxGuestWaitEventInfo)) … … 927 927 rc = KeWaitForSingleObject (&pDevExt->keventNotification, Executive /** @todo UserRequest? */, 928 928 KernelMode, TRUE, &timeout); 929 dprintf(("VBOXGUEST_IOCTL_WAITEVENT: Wait returned %d -> event %x\n", rc, eventInfo->u32EventFlagsOut));929 //dprintf(("VBOXGUEST_IOCTL_WAITEVENT: Wait returned %d -> event %x\n", rc, eventInfo->u32EventFlagsOut)); 930 930 931 931 if (!fTimeout && rc == STATUS_TIMEOUT) … … 1430 1430 IoCompleteRequest(pIrp, IO_NO_INCREMENT); 1431 1431 1432 dprintf(("VBoxGuest::VBoxGuestDeviceControl: returned cbOut=%d rc=%#x\n", cbOut, Status)); 1433 1432 //dprintf(("VBoxGuest::VBoxGuestDeviceControl: returned cbOut=%d rc=%#x\n", cbOut, Status)); 1434 1433 return Status; 1435 1434 } -
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp
r29625 r30758 263 263 static int vboxGuestInitReportGuestInfo(PVBOXGUESTDEVEXT pDevExt, VBOXOSTYPE enmOSType) 264 264 { 265 /* 266 * Report general info + capabilities to host. 267 */ 265 268 VMMDevReportGuestInfo *pReq; 266 269 int rc = VbglGRAlloc((VMMDevRequestHeader **)&pReq, sizeof(*pReq), VMMDevReq_ReportGuestInfo); … … 271 274 rc = VbglGRPerform(&pReq->header); 272 275 if (RT_FAILURE(rc)) 273 LogRel((" vboxGuestInitReportGuestInfo: 1st partfailed with rc=%Rrc\n", rc));276 LogRel(("Guest Additions: Reporting guest info 1 failed with rc=%Rrc\n", rc)); 274 277 VbglGRFree(&pReq->header); 275 278 } … … 286 289 RTStrCopy(pReq2->guestInfo.szName, sizeof(pReq2->guestInfo.szName), VBOX_VERSION_STRING); 287 290 rc = VbglGRPerform(&pReq2->header); 288 if (rc == VERR_NOT_IMPLEMENTED) /* compatibility with older hosts*/291 if (rc == VERR_NOT_IMPLEMENTED) /* Compatibility with older hosts. */ 289 292 rc = VINF_SUCCESS; 290 293 if (RT_FAILURE(rc)) 291 LogRel((" vboxGuestInitReportGuestInfo: 2nd partfailed with rc=%Rrc\n", rc));294 LogRel(("Guest Additions: Reporting guest info 2 failed with rc=%Rrc\n", rc)); 292 295 VbglGRFree(&pReq2->header); 296 } 297 298 /* 299 * Report guest status to host. Because the host set the "Guest Additions active" flag as soon 300 * as he received the VMMDevReportGuestInfo above to make sure all is compatible with older Guest 301 * Additions we now have to disable that flag again here (too early, VBoxService and friends need 302 * to start up first). 303 */ 304 VMMDevReportGuestStatus *pReq3; 305 int rc = VbglGRAlloc((VMMDevRequestHeader **)&pReq3, sizeof(*pReq3), VMMDevReq_ReportGuestStatus); 306 if (RT_SUCCESS(rc)) 307 { 308 pReq3->guestStatus.facility = VBoxGuestStatusFacility_VBoxGuestDriver; 309 pReq3->guestStatus.status = VBoxGuestStatusCurrent_Active; /** @todo Are we actually *really* active at this point? */ 310 pReq3->guestStatus.flags = 0; 311 rc = VbglGRPerform(&pReq3->header); 312 if (rc == VERR_NOT_IMPLEMENTED) /* Compatibility with older hosts. */ 313 rc = VINF_SUCCESS; 314 if (RT_FAILURE(rc)) 315 LogRel(("Guest Additions: Reporting guest status failed with rc=%Rrc\n", rc)); 316 VbglGRFree(&pReq3->header); 293 317 } 294 318 return rc; -
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibAdditions.cpp
r28800 r30758 140 140 141 141 /** 142 * Reports the Guest Additions status of a certain facility to the host. 143 * 144 * @returns IPRT status value 145 * @param uFacility 146 * @param uStatus 147 * @param uFlags 148 */ 149 VBGLR3DECL(int) VbglR3ReportAdditionsStatus(uint32_t uFacility, uint32_t uStatus, uint32_t uFlags) 150 { 151 VMMDevReportGuestStatus Report; 152 RT_ZERO(Report); 153 int rc = vmmdevInitRequest((VMMDevRequestHeader*)&Report, VMMDevReq_ReportGuestStatus); 154 if (RT_SUCCESS(rc)) 155 { 156 157 Report.guestStatus.facility = uFacility; 158 Report.guestStatus.status = uStatus; 159 Report.guestStatus.flags = uFlags; 160 161 rc = vbglR3GRPerform(&Report.header); 162 } 163 return rc; 164 } 165 166 /** 142 167 * Retrieves the installed Guest Additions version and/or revision. 143 168 * -
trunk/src/VBox/Additions/common/VBoxService/VBoxService.cpp
r30561 r30758 437 437 { 438 438 int rc; 439 440 /* Report the host that we're up and running! */ 441 rc = VbglR3ReportAdditionsStatus(VBoxGuestStatusFacility_VBoxService, 442 VBoxGuestStatusCurrent_Active, 443 0); /* Flags; not used. */ 444 if (RT_FAILURE(rc)) 445 VBoxServiceError("Failed to report Guest Additions status to the host! rc=%Rrc\n", rc); 439 446 440 447 #ifdef RT_OS_WINDOWS -
trunk/src/VBox/Devices/VMMDev/VMMDev.cpp
r30724 r30758 472 472 case VMMDevReq_ReportGuestInfo: 473 473 { 474 if (pRequestHeader->size <sizeof(VMMDevReportGuestInfo))474 if (pRequestHeader->size != sizeof(VMMDevReportGuestInfo)) 475 475 { 476 476 AssertMsgFailed(("VMMDev guest information structure has an invalid size!\n")); … … 492 492 pThis->guestInfo.additionsVersion, 493 493 pThis->guestInfo.osType)); 494 pThis->pDrv->pfnUpdateGuest Version(pThis->pDrv, &pThis->guestInfo);494 pThis->pDrv->pfnUpdateGuestInfo(pThis->pDrv, &pThis->guestInfo); 495 495 } 496 496 … … 509 509 case VMMDevReq_ReportGuestInfo2: 510 510 { 511 if (pRequestHeader->size <sizeof(VMMDevReportGuestInfo2))511 if (pRequestHeader->size != sizeof(VMMDevReportGuestInfo2)) 512 512 { 513 513 AssertMsgFailed(("VMMDev guest information 2 structure has an invalid size!\n")); … … 520 520 guestInfo2->additionsMajor, guestInfo2->additionsMinor, guestInfo2->additionsBuild, 521 521 guestInfo2->additionsRevision, sizeof(guestInfo2->szName), guestInfo2->szName)); 522 pRequestHeader->rc = VINF_SUCCESS; 523 } 524 break; 525 } 526 527 case VMMDevReq_ReportGuestStatus: 528 { 529 if (pRequestHeader->size != sizeof(VMMDevReportGuestStatus)) 530 { 531 AssertMsgFailed(("VMMDev guest status structure has an invalid size!\n")); 532 pRequestHeader->rc = VERR_INVALID_PARAMETER; 533 } 534 else 535 { 536 VBoxGuestStatus *guestStatus = &((VMMDevReportGuestStatus*)pRequestHeader)->guestStatus; 537 pThis->pDrv->pfnUpdateGuestStatus(pThis->pDrv, guestStatus); 538 522 539 pRequestHeader->rc = VINF_SUCCESS; 523 540 } … … 2589 2606 pThis->guestInfo.osType)); 2590 2607 if (pThis->pDrv) 2591 pThis->pDrv->pfnUpdateGuest Version(pThis->pDrv, &pThis->guestInfo);2608 pThis->pDrv->pfnUpdateGuestInfo(pThis->pDrv, &pThis->guestInfo); 2592 2609 } 2593 2610 if (pThis->pDrv) … … 2726 2743 */ 2727 2744 if (fVersionChanged) 2728 pThis->pDrv->pfnUpdateGuest Version(pThis->pDrv, &pThis->guestInfo);2745 pThis->pDrv->pfnUpdateGuestInfo(pThis->pDrv, &pThis->guestInfo); 2729 2746 if (fCapsChanged) 2730 2747 pThis->pDrv->pfnUpdateGuestCapabilities(pThis->pDrv, pThis->guestCaps); -
trunk/src/VBox/Devices/VMMDev/VMMDevState.h
r30724 r30758 127 127 VBoxGuestInfo guestInfo; 128 128 129 /** Information reported by guest via VMMDevReportGuestCapabilities 130 */ 129 /** Information reported by guest via VMMDevReportGuestCapabilities. */ 131 130 uint32_t guestCaps; 132 131 -
trunk/src/VBox/Frontends/VBoxBFE/VMMDev.h
r30594 r30758 44 44 45 45 private: 46 static DECLCALLBACK(void) UpdateGuest Version(PPDMIVMMDEVCONNECTOR pInterface,VBoxGuestInfo *guestInfo);46 static DECLCALLBACK(void) UpdateGuestInfo(PPDMIVMMDEVCONNECTOR pInterface, const VBoxGuestInfo *guestInfo); 47 47 static DECLCALLBACK(void) UpdateGuestCapabilities(PPDMIVMMDEVCONNECTOR pInterface, uint32_t newCapabilities); 48 48 static DECLCALLBACK(void) UpdateMouseCapabilities(PPDMIVMMDEVCONNECTOR pInterface, uint32_t newCapabilities); -
trunk/src/VBox/Frontends/VBoxBFE/VMMDevInterface.cpp
r30594 r30758 108 108 109 109 /** 110 * Report guest OS version.110 * Report guest information. 111 111 * Called whenever the Additions issue a guest version report request. 112 112 * … … 115 115 * @thread The emulation thread. 116 116 */ 117 DECLCALLBACK(void) VMMDev::UpdateGuest Version(PPDMIVMMDEVCONNECTOR pInterface,VBoxGuestInfo *guestInfo)117 DECLCALLBACK(void) VMMDev::UpdateGuestInfo(PPDMIVMMDEVCONNECTOR pInterface, const VBoxGuestInfo *guestInfo) 118 118 { 119 119 return; … … 385 385 pDrvIns->IBase.pfnQueryInterface = VMMDev::drvQueryInterface; 386 386 387 pData->Connector.pfnUpdateGuest Version = VMMDev::UpdateGuestVersion;387 pData->Connector.pfnUpdateGuestInfo = VMMDev::UpdateGuestInfo; 388 388 pData->Connector.pfnUpdateGuestCapabilities = VMMDev::UpdateGuestCapabilities; 389 389 pData->Connector.pfnUpdateMouseCapabilities = VMMDev::UpdateMouseCapabilities; -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp
r30740 r30758 1943 1943 { 1944 1944 if (details == VMINFO_MACHINEREADABLE) 1945 RTPrintf("GuestAdditions APIVersion=\"%lS\"\n", guestString.raw());1946 else 1947 RTPrintf("Additions API version:%lS\n\n", guestString.raw());1945 RTPrintf("GuestAdditionsVersion=\"%lS\"\n", guestString.raw()); 1946 else 1947 RTPrintf("Additions version: %lS\n\n", guestString.raw()); 1948 1948 } 1949 1949 } -
trunk/src/VBox/Main/GuestImpl.cpp
r30714 r30758 106 106 107 107 /** 108 * 109 * 108 * Uninitializes the instance and sets the ready flag to FALSE. 109 * Called either from FinalRelease() or by the parent when it gets destroyed. 110 110 */ 111 111 void Guest::uninit() … … 383 383 } 384 384 385 HRESULT Guest:: SetStatistic(ULONG aCpuId, GUESTSTATTYPE enmType, ULONG aVal)385 HRESULT Guest::setStatistic(ULONG aCpuId, GUESTSTATTYPE enmType, ULONG aVal) 386 386 { 387 387 AutoCaller autoCaller(this); … … 1416 1416 ///////////////////////////////////////////////////////////////////////////// 1417 1417 1418 void Guest::setAdditionsVersion(Bstr aVersion, VBOXOSTYPE aOsType) 1418 /** 1419 * Sets the general Guest Additions information like 1420 * API version and OS type. 1421 * 1422 * @param aVersion 1423 * @param aOsType 1424 */ 1425 void Guest::setAdditionsInfo(Bstr aVersion, VBOXOSTYPE aOsType) 1419 1426 { 1420 1427 AutoCaller autoCaller(this); … … 1423 1430 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1424 1431 1432 /* 1433 * Set the Guest Additions API (interface) version. 1434 * Note that this is *not* the actual Guest Additions version and may differ! 1435 */ 1425 1436 mData.mAdditionsVersion = aVersion; 1437 /* 1438 * Older Additions rely on the Additions API version whether they 1439 * are assumed to be active or not. Newer additions will disable 1440 * this immediately. 1441 */ 1426 1442 mData.mAdditionsActive = !aVersion.isEmpty(); 1427 /* Older Additions didn't have this finer grained capability bit, 1443 /* 1444 * Older Additions didn't have this finer grained capability bit, 1428 1445 * so enable it by default. Newer Additions will disable it immediately 1429 * if relevant. */ 1446 * if relevant. 1447 */ 1430 1448 mData.mSupportsGraphics = mData.mAdditionsActive; 1431 1449 1450 /* 1451 * Note! There is a race going on between setting mAdditionsActive and 1452 * mSupportsGraphics here and disabling/enabling it later according to 1453 * its real status when using new(er) Guest Additions. 1454 */ 1455 1432 1456 mData.mOSTypeId = Global::OSTypeId (aOsType); 1433 1457 } 1434 1458 1435 void Guest::setSupportsSeamless (BOOL aSupportsSeamless) 1459 /** 1460 * Sets the status of a certain Guest Additions facility. 1461 * 1462 * @param ulFacility 1463 * @param ulStatus 1464 * @param ulFlags 1465 */ 1466 void Guest::setAdditionsStatus (ULONG ulFacility, ULONG ulStatus, ULONG ulFlags) 1436 1467 { 1437 1468 AutoCaller autoCaller(this); … … 1440 1471 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1441 1472 1442 mData.mSupportsSeamless = aSupportsSeamless; 1443 } 1444 1445 void Guest::setSupportsGraphics (BOOL aSupportsGraphics) 1473 /* 1474 * Only mark Guest Additions as active when VBoxService started up. 1475 */ 1476 mData.mAdditionsActive = ( ulFacility == VBoxGuestStatusFacility_VBoxService 1477 && ulStatus == VBoxGuestStatusCurrent_Active) ? TRUE : FALSE; 1478 } 1479 1480 /** 1481 * Sets the supported features (and whether they are active or not). 1482 * 1483 * @param ulCaps 1484 * @param ulActive 1485 */ 1486 void Guest::setSupportedFeatures (ULONG64 ulCaps, ULONG64 ulActive) 1446 1487 { 1447 1488 AutoCaller autoCaller(this); … … 1450 1491 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1451 1492 1452 mData.mSupportsGraphics = aSupportsGraphics; 1493 mData.mSupportsSeamless = (ulCaps & VMMDEV_GUEST_SUPPORTS_SEAMLESS); 1494 /** @todo Add VMMDEV_GUEST_SUPPORTS_GUEST_HOST_WINDOW_MAPPING */ 1495 mData.mSupportsGraphics = (ulCaps & VMMDEV_GUEST_SUPPORTS_GRAPHICS); 1453 1496 } 1454 1497 /* vi: set tabstop=4 shiftwidth=4 expandtab: */ 1498 -
trunk/src/VBox/Main/VMMDevInterface.cpp
r29589 r30758 158 158 159 159 /** 160 * Report guest OS version.161 * Called whenever the Additions issue a guest versionreport request or the VM is reset.160 * Reports Guest Additions status. 161 * Called whenever the Additions issue a guest status report request or the VM is reset. 162 162 * 163 163 * @param pInterface Pointer to this interface. … … 165 165 * @thread The emulation thread. 166 166 */ 167 DECLCALLBACK(void) vmmdevUpdateGuestVersion(PPDMIVMMDEVCONNECTOR pInterface, VBoxGuestInfo *guestInfo) 167 DECLCALLBACK(void) vmmdevUpdateGuestStatus(PPDMIVMMDEVCONNECTOR pInterface, const VBoxGuestStatus *guestStatus) 168 { 169 PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface); 170 171 Assert(guestStatus); 172 if (!guestStatus) 173 return; 174 175 /* Store that information in IGuest */ 176 Guest* guest = pDrv->pVMMDev->getParent()->getGuest(); 177 Assert(guest); 178 if (!guest) 179 return; 180 181 guest->setAdditionsStatus(guestStatus->facility, 182 guestStatus->status, 183 guestStatus->flags); 184 pDrv->pVMMDev->getParent()->onAdditionsStateChange(); 185 } 186 187 188 /** 189 * Reports Guest Additions API and OS version. 190 * Called whenever the Additions issue a guest version report request or the VM is reset. 191 * 192 * @param pInterface Pointer to this interface. 193 * @param guestInfo Pointer to guest information structure 194 * @thread The emulation thread. 195 */ 196 DECLCALLBACK(void) vmmdevUpdateGuestInfo(PPDMIVMMDEVCONNECTOR pInterface, const VBoxGuestInfo *guestInfo) 168 197 { 169 198 PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface); … … 172 201 if (!guestInfo) 173 202 return; 203 204 /* Store that information in IGuest */ 205 Guest* guest = pDrv->pVMMDev->getParent()->getGuest(); 206 Assert(guest); 207 if (!guest) 208 return; 209 210 if (guestInfo->additionsVersion != 0) 211 { 212 char version[20]; 213 RTStrPrintf(version, sizeof(version), "%d", guestInfo->additionsVersion); 214 guest->setAdditionsInfo(Bstr(version), guestInfo->osType); 215 216 /* 217 * Tell the console interface about the event 218 * so that it can notify its consumers. 219 */ 220 pDrv->pVMMDev->getParent()->onAdditionsStateChange(); 221 222 if (guestInfo->additionsVersion < VMMDEV_VERSION) 223 pDrv->pVMMDev->getParent()->onAdditionsOutdated(); 224 } 225 else 226 { 227 /* 228 * The guest additions was disabled because of a reset 229 * or driver unload. 230 */ 231 guest->setAdditionsInfo(Bstr(), guestInfo->osType); 232 guest->setAdditionsStatus(0, /* Facility; 0 = Global GA status. May be changed 233 * later to VBoxService' own facility. */ 234 0, /* Status; 0 = Not active */ 235 0); /* Flags; not used. */ 236 pDrv->pVMMDev->getParent()->onAdditionsStateChange(); 237 } 238 } 239 240 /** 241 * Update the guest additions capabilities. 242 * This is called when the guest additions capabilities change. The new capabilities 243 * are given and the connector should update its internal state. 244 * 245 * @param pInterface Pointer to this interface. 246 * @param newCapabilities New capabilities. 247 * @thread The emulation thread. 248 */ 249 DECLCALLBACK(void) vmmdevUpdateGuestCapabilities(PPDMIVMMDEVCONNECTOR pInterface, uint32_t newCapabilities) 250 { 251 PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface); 174 252 175 253 /* store that information in IGuest */ … … 179 257 return; 180 258 181 if (guestInfo->additionsVersion != 0) 182 { 183 char version[20]; 184 RTStrPrintf(version, sizeof(version), "%d", guestInfo->additionsVersion); 185 guest->setAdditionsVersion(Bstr(version), guestInfo->osType); 186 187 /* 188 * Tell the console interface about the event 189 * so that it can notify its consumers. 190 */ 191 pDrv->pVMMDev->getParent()->onAdditionsStateChange(); 192 193 if (guestInfo->additionsVersion < VMMDEV_VERSION) 194 pDrv->pVMMDev->getParent()->onAdditionsOutdated(); 195 } 196 else 197 { 198 /* 199 * The guest additions was disabled because of a reset 200 * or driver unload. 201 */ 202 guest->setAdditionsVersion (Bstr(), guestInfo->osType); 203 pDrv->pVMMDev->getParent()->onAdditionsStateChange(); 204 } 205 } 206 207 /** 208 * Update the guest additions capabilities. 209 * This is called when the guest additions capabilities change. The new capabilities 210 * are given and the connector should update its internal state. 211 * 212 * @param pInterface Pointer to this interface. 213 * @param newCapabilities New capabilities. 214 * @thread The emulation thread. 215 */ 216 DECLCALLBACK(void) vmmdevUpdateGuestCapabilities(PPDMIVMMDEVCONNECTOR pInterface, uint32_t newCapabilities) 217 { 218 PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface); 219 220 /* store that information in IGuest */ 221 Guest* guest = pDrv->pVMMDev->getParent()->getGuest(); 222 Assert(guest); 223 if (!guest) 224 return; 225 226 guest->setSupportsSeamless(BOOL (newCapabilities & VMMDEV_GUEST_SUPPORTS_SEAMLESS)); 227 guest->setSupportsGraphics(BOOL (newCapabilities & VMMDEV_GUEST_SUPPORTS_GRAPHICS)); 259 /* 260 * Report our current capabilites (and assume none is active yet). 261 */ 262 guest->setSupportedFeatures((ULONG64)newCapabilities, 0 /* Active capabilities, not used here. */); 228 263 229 264 /* … … 543 578 544 579 if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_CPU_LOAD_IDLE) 545 guest-> SetStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_CPUIDLE, pGuestStats->u32CpuLoad_Idle);580 guest->setStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_CPUIDLE, pGuestStats->u32CpuLoad_Idle); 546 581 547 582 if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_CPU_LOAD_KERNEL) 548 guest-> SetStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_CPUKERNEL, pGuestStats->u32CpuLoad_Kernel);583 guest->setStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_CPUKERNEL, pGuestStats->u32CpuLoad_Kernel); 549 584 550 585 if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_CPU_LOAD_USER) 551 guest-> SetStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_CPUUSER, pGuestStats->u32CpuLoad_User);586 guest->setStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_CPUUSER, pGuestStats->u32CpuLoad_User); 552 587 553 588 … … 556 591 * preCollect(). I might be wrong ofc, this is convoluted code... */ 557 592 if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_PHYS_MEM_TOTAL) 558 guest-> SetStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_MEMTOTAL, pGuestStats->u32PhysMemTotal);593 guest->setStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_MEMTOTAL, pGuestStats->u32PhysMemTotal); 559 594 560 595 if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_PHYS_MEM_AVAIL) 561 guest-> SetStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_MEMFREE, pGuestStats->u32PhysMemAvail);596 guest->setStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_MEMFREE, pGuestStats->u32PhysMemAvail); 562 597 563 598 if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_PHYS_MEM_BALLOON) 564 guest-> SetStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_MEMBALLOON, pGuestStats->u32PhysMemBalloon);599 guest->setStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_MEMBALLOON, pGuestStats->u32PhysMemBalloon); 565 600 566 601 if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_MEM_SYSTEM_CACHE) 567 guest-> SetStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_MEMCACHE, pGuestStats->u32MemSystemCache);602 guest->setStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_MEMCACHE, pGuestStats->u32MemSystemCache); 568 603 569 604 if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_PAGE_FILE_SIZE) 570 guest-> SetStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_PAGETOTAL, pGuestStats->u32PageFileSize);605 guest->setStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_PAGETOTAL, pGuestStats->u32PageFileSize); 571 606 572 607 return VINF_SUCCESS; … … 762 797 pDrvIns->IBase.pfnQueryInterface = VMMDev::drvQueryInterface; 763 798 764 pData->Connector.pfnUpdateGuestVersion = vmmdevUpdateGuestVersion; 799 pData->Connector.pfnUpdateGuestStatus = vmmdevUpdateGuestStatus; 800 pData->Connector.pfnUpdateGuestInfo = vmmdevUpdateGuestInfo; 765 801 pData->Connector.pfnUpdateGuestCapabilities = vmmdevUpdateGuestCapabilities; 766 802 pData->Connector.pfnUpdateMouseCapabilities = vmmdevUpdateMouseCapabilities; -
trunk/src/VBox/Main/include/GuestImpl.h
r30739 r30758 5 5 6 6 /* 7 * Copyright (C) 2006-20 07Oracle Corporation7 * Copyright (C) 2006-2010 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 69 69 void FinalRelease(); 70 70 71 // public initializer/uninitializer for internal purposes only71 // Public initializer/uninitializer for internal purposes only 72 72 HRESULT init (Console *aParent); 73 73 void uninit(); … … 75 75 // IGuest properties 76 76 STDMETHOD(COMGETTER(OSTypeId)) (BSTR *aOSTypeId); 77 #if 0 78 /** @todo Will replace old AdditionsActive call. */ 79 STDMETHOD(COMGETTER(AdditionsActive)) (ULONG aLevel, BOOL *aAdditionsActive); 80 #endif 77 81 STDMETHOD(COMGETTER(AdditionsActive)) (BOOL *aAdditionsActive); 82 #if 0 83 /** @todo Will replace AdditionsVersion to be more clear. */ 84 STDMETHOD(COMGETTER(AdditionsAPIVersion)) (BSTR *aAdditionsVersion); 85 #endif 78 86 STDMETHOD(COMGETTER(AdditionsVersion)) (BSTR *aAdditionsVersion); 87 /** @todo Remove */ 79 88 STDMETHOD(COMGETTER(SupportsSeamless)) (BOOL *aSupportsSeamless); 80 89 STDMETHOD(COMGETTER(SupportsGraphics)) (BOOL *aSupportsGraphics); 90 #if 0 91 /** @todo Will replace SupportsSeamless, SupportsGraphics, ... */ 92 STDMETHOD(COMGETTER(AdditionsFeatureAvailable)) (ULONG64 aFeature, BOOL *aActive, BOOL *aAvailable); 93 #endif 81 94 STDMETHOD(COMGETTER(MemoryBalloonSize)) (ULONG *aMemoryBalloonSize); 82 95 STDMETHOD(COMSETTER(MemoryBalloonSize)) (ULONG aMemoryBalloonSize); … … 99 112 ULONG *aPageTotal, ULONG *aMemAllocTotal, ULONG *aMemFreeTotal, ULONG *aMemBalloonTotal, ULONG *aMemSharedTotal); 100 113 101 // public methods that are not in IDL 102 void setAdditionsVersion (Bstr aVersion, VBOXOSTYPE aOsType); 103 104 void setSupportsSeamless (BOOL aSupportsSeamless); 105 106 void setSupportsGraphics (BOOL aSupportsGraphics); 107 108 HRESULT SetStatistic(ULONG aCpuId, GUESTSTATTYPE enmType, ULONG aVal); 114 // Public methods that are not in IDL (only called internally). 115 void setAdditionsInfo(Bstr aVersion, VBOXOSTYPE aOsType); 116 void setAdditionsStatus(ULONG ulFacility, ULONG ulStatus, ULONG ulFlags); 117 void setSupportedFeatures(ULONG64 ulCaps, ULONG64 ulActive); 118 HRESULT setStatistic(ULONG aCpuId, GUESTSTATTYPE enmType, ULONG aVal); 109 119 110 120 # ifdef VBOX_WITH_GUEST_CONTROL
Note:
See TracChangeset
for help on using the changeset viewer.