Changeset 47294 in vbox for trunk/src/VBox/Devices/VMMDev/VMMDev.cpp
- Timestamp:
- Jul 22, 2013 11:19:20 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/VMMDev/VMMDev.cpp
r46376 r47294 593 593 } 594 594 595 595 596 /** 596 597 * Handles VMMDevReq_ReportGuestStatus. … … 642 643 643 644 pEntry->TimeSpecTS = Now; 644 pEntry->uStatus = (uint16_t)pStatus->status; 645 pEntry->uStatus = (uint16_t)pStatus->status; /** @todo r=andy uint16_t vs. 32-bit enum. */ 645 646 pEntry->fFlags = pStatus->flags; 646 647 } … … 648 649 if (pThis->pDrv && pThis->pDrv->pfnUpdateGuestStatus) 649 650 pThis->pDrv->pfnUpdateGuestStatus(pThis->pDrv, pStatus->facility, pStatus->status, pStatus->flags, &Now); 651 652 return VINF_SUCCESS; 653 } 654 655 656 /** 657 * Handles VMMDevReq_ReportGuestUserState. 658 * 659 * @returns VBox status code that the guest should see. 660 * @param pThis The VMMDev instance data. 661 * @param pReqHdr The header of the request to handle. 662 */ 663 static int vmmdevReqHandler_ReportGuestUserState(PVMMDEV pThis, VMMDevRequestHeader *pReqHdr) 664 { 665 /* 666 * Validate input. 667 */ 668 AssertMsgReturn(pReqHdr->size >= sizeof(VMMDevReportGuestUserState), ("%u\n", pReqHdr->size), VERR_INVALID_PARAMETER); 669 VBoxGuestUserStatus *pStatus = &((VMMDevReportGuestUserState *)pReqHdr)->status; 670 671 if ( pThis->pDrv 672 && pThis->pDrv->pfnUpdateGuestUserState) 673 { 674 AssertPtr(pStatus); 675 676 if ( pReqHdr->size > _2K 677 || pStatus->cbUser > 256 678 || pStatus->cbDomain > 256 679 || pStatus->cbDetails > _1K) /* Play safe. */ 680 { 681 return VERR_INVALID_PARAMETER; 682 } 683 684 pThis->pDrv->pfnUpdateGuestUserState(pThis->pDrv, 685 /* User name */ 686 (const char *)pStatus->szUser, 687 /* Domain */ 688 pStatus->cbDomain 689 ? (const char *)pStatus->szUser[pStatus->cbUser] 690 : NULL, 691 /* State */ 692 (uint32_t)pStatus->state, 693 /* State details */ 694 pStatus->cbDetails 695 ? (uint8_t *)pStatus->szUser[pStatus->cbUser + pStatus->cbDomain] 696 : NULL, 697 pStatus->cbDetails); 698 } 650 699 651 700 return VINF_SUCCESS; … … 2217 2266 case VMMDevReq_ReportGuestStatus: 2218 2267 pReqHdr->rc = vmmdevReqHandler_ReportGuestStatus(pThis, pReqHdr); 2268 break; 2269 2270 case VMMDevReq_ReportGuestUserState: 2271 pReqHdr->rc = vmmdevReqHandler_ReportGuestUserState(pThis, pReqHdr); 2219 2272 break; 2220 2273
Note:
See TracChangeset
for help on using the changeset viewer.