Changeset 75737 in vbox for trunk/src/VBox/HostServices
- Timestamp:
- Nov 26, 2018 3:44:41 PM (6 years ago)
- Location:
- trunk/src/VBox/HostServices
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/DragAndDrop/service.cpp
r74439 r75737 457 457 { 458 458 uint32_t fFlags = 0; 459 int rc2 = paParms[2].getUInt32(&fFlags);459 int rc2 = HGCMSvcGetU32(&paParms[2], &fFlags); 460 460 if ( RT_SUCCESS(rc2) 461 461 && fFlags) /* Blocking flag set? */ … … 484 484 data.hdr.uMagic = CB_MAGIC_DND_CONNECT; 485 485 if (cParms >= 3) 486 rc = paParms[0].getUInt32(&data.hdr.uContextID);486 rc = HGCMSvcGetU32(&paParms[0], &data.hdr.uContextID); 487 487 else /* Older protocols don't have a context ID. */ 488 488 rc = VINF_SUCCESS; 489 489 if (RT_SUCCESS(rc)) 490 rc = paParms[idxProto].getUInt32(&data.uProtocol);491 if (RT_SUCCESS(rc)) 492 rc = paParms[idxProto + 1].getUInt32(&data.uFlags);490 rc = HGCMSvcGetU32(&paParms[idxProto], &data.uProtocol); 491 if (RT_SUCCESS(rc)) 492 rc = HGCMSvcGetU32(&paParms[idxProto + 1], &data.uFlags); 493 493 if (RT_SUCCESS(rc)) 494 494 pClient->SetProtocolVer(data.uProtocol); … … 515 515 if (cParms == 2) 516 516 { 517 rc = paParms[0].getUInt32(&data.hdr.uContextID);518 if (RT_SUCCESS(rc)) 519 rc = paParms[1].getUInt32(&data.uAction); /* Get drop action. */517 rc = HGCMSvcGetU32(&paParms[0], &data.hdr.uContextID); 518 if (RT_SUCCESS(rc)) 519 rc = HGCMSvcGetU32(&paParms[1], &data.uAction); /* Get drop action. */ 520 520 } 521 521 break; … … 526 526 { 527 527 if (cParms == 1) 528 rc = paParms[0].getUInt32(&data.uAction); /* Get drop action. */528 rc = HGCMSvcGetU32(&paParms[0], &data.uAction); /* Get drop action. */ 529 529 break; 530 530 } … … 548 548 if (cParms == 3) 549 549 { 550 rc = paParms[0].getUInt32(&data.hdr.uContextID);551 if (RT_SUCCESS(rc)) 552 rc = paParms[1].getPointer((void **)&data.pszFormat, &data.cbFormat);553 if (RT_SUCCESS(rc)) 554 rc = paParms[2].getUInt32(&data.cbFormat);550 rc = HGCMSvcGetU32(&paParms[0], &data.hdr.uContextID); 551 if (RT_SUCCESS(rc)) 552 rc = HGCMSvcGetPv(&paParms[1], (void **)&data.pszFormat, &data.cbFormat); 553 if (RT_SUCCESS(rc)) 554 rc = HGCMSvcGetU32(&paParms[2], &data.cbFormat); 555 555 } 556 556 break; … … 561 561 { 562 562 if (cParms == 1) 563 rc = paParms[0].getPointer((void**)&data.pszFormat, &data.cbFormat);563 rc = HGCMSvcGetPv(&paParms[0], (void**)&data.pszFormat, &data.cbFormat); 564 564 break; 565 565 } … … 583 583 if (cParms == 4) 584 584 { 585 rc = paParms[0].getUInt32(&data.uStatus);586 if (RT_SUCCESS(rc)) 587 rc = paParms[1].getUInt32(&data.uStatus);588 if (RT_SUCCESS(rc)) 589 rc = paParms[2].getUInt32(&data.uPercentage);590 if (RT_SUCCESS(rc)) 591 rc = paParms[3].getUInt32(&data.rc);585 rc = HGCMSvcGetU32(&paParms[0], &data.uStatus); 586 if (RT_SUCCESS(rc)) 587 rc = HGCMSvcGetU32(&paParms[1], &data.uStatus); 588 if (RT_SUCCESS(rc)) 589 rc = HGCMSvcGetU32(&paParms[2], &data.uPercentage); 590 if (RT_SUCCESS(rc)) 591 rc = HGCMSvcGetU32(&paParms[3], &data.rc); 592 592 } 593 593 break; … … 599 599 if (cParms == 3) 600 600 { 601 rc = paParms[0].getUInt32(&data.uStatus);602 if (RT_SUCCESS(rc)) 603 rc = paParms[1].getUInt32(&data.uPercentage);604 if (RT_SUCCESS(rc)) 605 rc = paParms[2].getUInt32(&data.rc);601 rc = HGCMSvcGetU32(&paParms[0], &data.uStatus); 602 if (RT_SUCCESS(rc)) 603 rc = HGCMSvcGetU32(&paParms[1], &data.uPercentage); 604 if (RT_SUCCESS(rc)) 605 rc = HGCMSvcGetU32(&paParms[2], &data.rc); 606 606 } 607 607 break; … … 627 627 if (cParms == 5) 628 628 { 629 rc = paParms[0].getUInt32(&data.hdr.uContextID);630 if (RT_SUCCESS(rc)) 631 rc = paParms[1].getUInt32(&data.uDefAction);632 if (RT_SUCCESS(rc)) 633 rc = paParms[2].getUInt32(&data.uAllActions);634 if (RT_SUCCESS(rc)) 635 rc = paParms[3].getPointer((void**)&data.pszFormat, &data.cbFormat);636 if (RT_SUCCESS(rc)) 637 rc = paParms[4].getUInt32(&data.cbFormat);629 rc = HGCMSvcGetU32(&paParms[0], &data.hdr.uContextID); 630 if (RT_SUCCESS(rc)) 631 rc = HGCMSvcGetU32(&paParms[1], &data.uDefAction); 632 if (RT_SUCCESS(rc)) 633 rc = HGCMSvcGetU32(&paParms[2], &data.uAllActions); 634 if (RT_SUCCESS(rc)) 635 rc = HGCMSvcGetPv(&paParms[3], (void**)&data.pszFormat, &data.cbFormat); 636 if (RT_SUCCESS(rc)) 637 rc = HGCMSvcGetU32(&paParms[4], &data.cbFormat); 638 638 } 639 639 break; … … 645 645 if (cParms == 3) 646 646 { 647 rc = paParms[0].getUInt32(&data.uDefAction);648 if (RT_SUCCESS(rc)) 649 rc = paParms[1].getUInt32(&data.uAllActions);650 if (RT_SUCCESS(rc)) 651 rc = paParms[2].getPointer((void**)&data.pszFormat, &data.cbFormat);647 rc = HGCMSvcGetU32(&paParms[0], &data.uDefAction); 648 if (RT_SUCCESS(rc)) 649 rc = HGCMSvcGetU32(&paParms[1], &data.uAllActions); 650 if (RT_SUCCESS(rc)) 651 rc = HGCMSvcGetPv(&paParms[2], (void**)&data.pszFormat, &data.cbFormat); 652 652 } 653 653 break; … … 667 667 RT_ZERO(data); 668 668 data.hdr.uMagic = CB_MAGIC_DND_GH_SND_DATA_HDR; 669 rc = paParms[0].getUInt32(&data.hdr.uContextID);670 if (RT_SUCCESS(rc)) 671 rc = paParms[1].getUInt32(&data.data.uFlags);672 if (RT_SUCCESS(rc)) 673 rc = paParms[2].getUInt32(&data.data.uScreenId);674 if (RT_SUCCESS(rc)) 675 rc = paParms[3].getUInt64(&data.data.cbTotal);676 if (RT_SUCCESS(rc)) 677 rc = paParms[4].getUInt32(&data.data.cbMeta);678 if (RT_SUCCESS(rc)) 679 rc = paParms[5].getPointer(&data.data.pvMetaFmt, &data.data.cbMetaFmt);680 if (RT_SUCCESS(rc)) 681 rc = paParms[6].getUInt32(&data.data.cbMetaFmt);682 if (RT_SUCCESS(rc)) 683 rc = paParms[7].getUInt64(&data.data.cObjects);684 if (RT_SUCCESS(rc)) 685 rc = paParms[8].getUInt32(&data.data.enmCompression);686 if (RT_SUCCESS(rc)) 687 rc = paParms[9].getUInt32((uint32_t *)&data.data.enmChecksumType);688 if (RT_SUCCESS(rc)) 689 rc = paParms[10].getPointer(&data.data.pvChecksum, &data.data.cbChecksum);690 if (RT_SUCCESS(rc)) 691 rc = paParms[11].getUInt32(&data.data.cbChecksum);669 rc = HGCMSvcGetU32(&paParms[0], &data.hdr.uContextID); 670 if (RT_SUCCESS(rc)) 671 rc = HGCMSvcGetU32(&paParms[1], &data.data.uFlags); 672 if (RT_SUCCESS(rc)) 673 rc = HGCMSvcGetU32(&paParms[2], &data.data.uScreenId); 674 if (RT_SUCCESS(rc)) 675 rc = HGCMSvcGetU64(&paParms[3], &data.data.cbTotal); 676 if (RT_SUCCESS(rc)) 677 rc = HGCMSvcGetU32(&paParms[4], &data.data.cbMeta); 678 if (RT_SUCCESS(rc)) 679 rc = HGCMSvcGetPv(&paParms[5], &data.data.pvMetaFmt, &data.data.cbMetaFmt); 680 if (RT_SUCCESS(rc)) 681 rc = HGCMSvcGetU32(&paParms[6], &data.data.cbMetaFmt); 682 if (RT_SUCCESS(rc)) 683 rc = HGCMSvcGetU64(&paParms[7], &data.data.cObjects); 684 if (RT_SUCCESS(rc)) 685 rc = HGCMSvcGetU32(&paParms[8], &data.data.enmCompression); 686 if (RT_SUCCESS(rc)) 687 rc = HGCMSvcGetU32(&paParms[9], (uint32_t *)&data.data.enmChecksumType); 688 if (RT_SUCCESS(rc)) 689 rc = HGCMSvcGetPv(&paParms[10], &data.data.pvChecksum, &data.data.cbChecksum); 690 if (RT_SUCCESS(rc)) 691 rc = HGCMSvcGetU32(&paParms[11], &data.data.cbChecksum); 692 692 693 693 LogFlowFunc(("fFlags=0x%x, cbTotalSize=%RU64, cObj=%RU64\n", … … 709 709 RT_ZERO(data); 710 710 data.hdr.uMagic = CB_MAGIC_DND_GH_SND_DATA; 711 rc = paParms[0].getUInt32(&data.hdr.uContextID);712 if (RT_SUCCESS(rc)) 713 rc = paParms[1].getPointer((void**)&data.data.u.v3.pvData, &data.data.u.v3.cbData);714 if (RT_SUCCESS(rc)) 715 rc = paParms[2].getUInt32(&data.data.u.v3.cbData);716 if (RT_SUCCESS(rc)) 717 rc = paParms[3].getPointer((void**)&data.data.u.v3.pvChecksum, &data.data.u.v3.cbChecksum);718 if (RT_SUCCESS(rc)) 719 rc = paParms[4].getUInt32(&data.data.u.v3.cbChecksum);711 rc = HGCMSvcGetU32(&paParms[0], &data.hdr.uContextID); 712 if (RT_SUCCESS(rc)) 713 rc = HGCMSvcGetPv(&paParms[1], (void**)&data.data.u.v3.pvData, &data.data.u.v3.cbData); 714 if (RT_SUCCESS(rc)) 715 rc = HGCMSvcGetU32(&paParms[2], &data.data.u.v3.cbData); 716 if (RT_SUCCESS(rc)) 717 rc = HGCMSvcGetPv(&paParms[3], (void**)&data.data.u.v3.pvChecksum, &data.data.u.v3.cbChecksum); 718 if (RT_SUCCESS(rc)) 719 rc = HGCMSvcGetU32(&paParms[4], &data.data.u.v3.cbChecksum); 720 720 DO_HOST_CALLBACK(); 721 721 } … … 731 731 RT_ZERO(data); 732 732 data.hdr.uMagic = CB_MAGIC_DND_GH_SND_DATA; 733 rc = paParms[0].getPointer((void**)&data.data.u.v1.pvData, &data.data.u.v1.cbData);734 if (RT_SUCCESS(rc)) 735 rc = paParms[1].getUInt32(&data.data.u.v1.cbTotalSize);733 rc = HGCMSvcGetPv(&paParms[0], (void**)&data.data.u.v1.pvData, &data.data.u.v1.cbData); 734 if (RT_SUCCESS(rc)) 735 rc = HGCMSvcGetU32(&paParms[1], &data.data.u.v1.cbTotalSize); 736 736 DO_HOST_CALLBACK(); 737 737 } … … 755 755 if (cParms == 4) 756 756 { 757 rc = paParms[0].getUInt32(&data.hdr.uContextID);758 if (RT_SUCCESS(rc)) 759 rc = paParms[1].getPointer((void**)&data.pszPath, &data.cbPath);760 if (RT_SUCCESS(rc)) 761 rc = paParms[2].getUInt32(&data.cbPath);762 if (RT_SUCCESS(rc)) 763 rc = paParms[3].getUInt32(&data.fMode);757 rc = HGCMSvcGetU32(&paParms[0], &data.hdr.uContextID); 758 if (RT_SUCCESS(rc)) 759 rc = HGCMSvcGetPv(&paParms[1], (void**)&data.pszPath, &data.cbPath); 760 if (RT_SUCCESS(rc)) 761 rc = HGCMSvcGetU32(&paParms[2], &data.cbPath); 762 if (RT_SUCCESS(rc)) 763 rc = HGCMSvcGetU32(&paParms[3], &data.fMode); 764 764 } 765 765 break; … … 771 771 if (cParms == 3) 772 772 { 773 rc = paParms[0].getPointer((void**)&data.pszPath, &data.cbPath);774 if (RT_SUCCESS(rc)) 775 rc = paParms[1].getUInt32(&data.cbPath);776 if (RT_SUCCESS(rc)) 777 rc = paParms[2].getUInt32(&data.fMode);773 rc = HGCMSvcGetPv(&paParms[0], (void**)&data.pszPath, &data.cbPath); 774 if (RT_SUCCESS(rc)) 775 rc = HGCMSvcGetU32(&paParms[1], &data.cbPath); 776 if (RT_SUCCESS(rc)) 777 rc = HGCMSvcGetU32(&paParms[2], &data.fMode); 778 778 } 779 779 break; … … 794 794 data.hdr.uMagic = CB_MAGIC_DND_GH_SND_FILE_HDR; 795 795 796 rc = paParms[0].getUInt32(&data.hdr.uContextID);797 if (RT_SUCCESS(rc)) 798 rc = paParms[1].getPointer((void**)&data.pszFilePath, &data.cbFilePath);799 if (RT_SUCCESS(rc)) 800 rc = paParms[2].getUInt32(&data.cbFilePath);801 if (RT_SUCCESS(rc)) 802 rc = paParms[3].getUInt32(&data.fFlags);803 if (RT_SUCCESS(rc)) 804 rc = paParms[4].getUInt32(&data.fMode);805 if (RT_SUCCESS(rc)) 806 rc = paParms[5].getUInt64(&data.cbSize);796 rc = HGCMSvcGetU32(&paParms[0], &data.hdr.uContextID); 797 if (RT_SUCCESS(rc)) 798 rc = HGCMSvcGetPv(&paParms[1], (void**)&data.pszFilePath, &data.cbFilePath); 799 if (RT_SUCCESS(rc)) 800 rc = HGCMSvcGetU32(&paParms[2], &data.cbFilePath); 801 if (RT_SUCCESS(rc)) 802 rc = HGCMSvcGetU32(&paParms[3], &data.fFlags); 803 if (RT_SUCCESS(rc)) 804 rc = HGCMSvcGetU32(&paParms[4], &data.fMode); 805 if (RT_SUCCESS(rc)) 806 rc = HGCMSvcGetU64(&paParms[5], &data.cbSize); 807 807 808 808 LogFlowFunc(("pszPath=%s, cbPath=%RU32, fMode=0x%x, cbSize=%RU64\n", … … 827 827 data.hdr.uMagic = CB_MAGIC_DND_GH_SND_FILE_DATA; 828 828 829 rc = paParms[0].getUInt32(&data.hdr.uContextID);830 if (RT_SUCCESS(rc)) 831 rc = paParms[1].getPointer((void**)&data.pvData, &data.cbData);832 if (RT_SUCCESS(rc)) 833 rc = paParms[2].getUInt32(&data.cbData);834 if (RT_SUCCESS(rc)) 835 rc = paParms[3].getPointer((void**)&data.u.v3.pvChecksum, &data.u.v3.cbChecksum);836 if (RT_SUCCESS(rc)) 837 rc = paParms[4].getUInt32(&data.u.v3.cbChecksum);829 rc = HGCMSvcGetU32(&paParms[0], &data.hdr.uContextID); 830 if (RT_SUCCESS(rc)) 831 rc = HGCMSvcGetPv(&paParms[1], (void**)&data.pvData, &data.cbData); 832 if (RT_SUCCESS(rc)) 833 rc = HGCMSvcGetU32(&paParms[2], &data.cbData); 834 if (RT_SUCCESS(rc)) 835 rc = HGCMSvcGetPv(&paParms[3], (void**)&data.u.v3.pvChecksum, &data.u.v3.cbChecksum); 836 if (RT_SUCCESS(rc)) 837 rc = HGCMSvcGetU32(&paParms[4], &data.u.v3.cbChecksum); 838 838 839 839 LogFlowFunc(("pvData=0x%p, cbData=%RU32\n", data.pvData, data.cbData)); … … 850 850 RT_ZERO(data); 851 851 data.hdr.uMagic = CB_MAGIC_DND_GH_SND_FILE_DATA; 852 rc = paParms[0].getUInt32(&data.hdr.uContextID);853 if (RT_SUCCESS(rc)) 854 rc = paParms[1].getPointer((void**)&data.pvData, &data.cbData);855 if (RT_SUCCESS(rc)) 856 rc = paParms[2].getUInt32(&data.cbData);852 rc = HGCMSvcGetU32(&paParms[0], &data.hdr.uContextID); 853 if (RT_SUCCESS(rc)) 854 rc = HGCMSvcGetPv(&paParms[1], (void**)&data.pvData, &data.cbData); 855 if (RT_SUCCESS(rc)) 856 rc = HGCMSvcGetU32(&paParms[2], &data.cbData); 857 857 858 858 LogFlowFunc(("cbData=%RU32, pvData=0x%p\n", data.cbData, data.pvData)); … … 870 870 data.hdr.uMagic = CB_MAGIC_DND_GH_SND_FILE_DATA; 871 871 uint32_t cTmp; 872 rc = paParms[0].getPointer((void**)&data.u.v1.pszFilePath, &cTmp);873 if (RT_SUCCESS(rc)) 874 rc = paParms[1].getUInt32(&data.u.v1.cbFilePath);875 if (RT_SUCCESS(rc)) 876 rc = paParms[2].getPointer((void**)&data.pvData, &cTmp);877 if (RT_SUCCESS(rc)) 878 rc = paParms[3].getUInt32(&data.cbData);879 if (RT_SUCCESS(rc)) 880 rc = paParms[4].getUInt32(&data.u.v1.fMode);872 rc = HGCMSvcGetPv(&paParms[0], (void**)&data.u.v1.pszFilePath, &cTmp); 873 if (RT_SUCCESS(rc)) 874 rc = HGCMSvcGetU32(&paParms[1], &data.u.v1.cbFilePath); 875 if (RT_SUCCESS(rc)) 876 rc = HGCMSvcGetPv(&paParms[2], (void**)&data.pvData, &cTmp); 877 if (RT_SUCCESS(rc)) 878 rc = HGCMSvcGetU32(&paParms[3], &data.cbData); 879 if (RT_SUCCESS(rc)) 880 rc = HGCMSvcGetU32(&paParms[4], &data.u.v1.fMode); 881 881 882 882 LogFlowFunc(("pszFilePath=%s, cbData=%RU32, pvData=0x%p, fMode=0x%x\n", … … 903 903 if (cParms == 2) 904 904 { 905 rc = paParms[0].getUInt32(&data.hdr.uContextID);905 rc = HGCMSvcGetU32(&paParms[0], &data.hdr.uContextID); 906 906 if (RT_SUCCESS(rc)) 907 907 { 908 908 uint32_t rcOp; 909 rc = paParms[1].getUInt32(&rcOp);909 rc = HGCMSvcGetU32(&paParms[1], &rcOp); 910 910 if (RT_SUCCESS(rc)) 911 911 data.rc = rcOp; … … 921 921 { 922 922 uint32_t rcOp; 923 rc = paParms[0].getUInt32(&rcOp);923 rc = HGCMSvcGetU32(&paParms[0], &rcOp); 924 924 if (RT_SUCCESS(rc)) 925 925 data.rc = (int32_t)rcOp; … … 953 953 /* Protocol v3+ at least requires the context ID. */ 954 954 if (cParms == 1) 955 rc = paParms[0].getUInt32(&data.hdr.uContextID);955 rc = HGCMSvcGetU32(&paParms[0], &data.hdr.uContextID); 956 956 957 957 break; -
trunk/src/VBox/HostServices/GuestControl/service.cpp
r75500 r75737 224 224 * assign the context ID to the command. 225 225 */ 226 rc = mpParms[0].getUInt32(&mContextID);226 rc = HGCMSvcGetU32(&mpParms[0], &mContextID); 227 227 228 228 /* Set timestamp so that clients can distinguish between already … … 418 418 if (pConnection->mNumParms >= 2) 419 419 { 420 pConnection->mParms[0].setUInt32(mMsgType); /* Message ID */421 pConnection->mParms[1].setUInt32(mParmCount); /* Required parameters for message */420 HGCMSvcSetU32(&pConnection->mParms[0], mMsgType); /* Message ID */ 421 HGCMSvcSetU32(&pConnection->mParms[1], mParmCount); /* Required parameters for message */ 422 422 } 423 423 else … … 777 777 && mPendingCon.mNumParms >= 2) 778 778 { 779 mPendingCon.mParms[0].setUInt32(HOST_CANCEL_PENDING_WAITS); /* Message ID. */780 mPendingCon.mParms[1].setUInt32(0); /* Required parameters for message. */779 HGCMSvcSetU32(&mPendingCon.mParms[0], HOST_CANCEL_PENDING_WAITS); /* Message ID. */ 780 HGCMSvcSetU32(&mPendingCon.mParms[1], 0); /* Required parameters for message. */ 781 781 782 782 AssertPtr(mSvcHelpers); … … 1109 1109 uint32_t cParms = 0; 1110 1110 VBOXHGCMSVCPARM arParms[2]; 1111 arParms[cParms++].setUInt32(pCurCmd->mContextID);1111 HGCMSvcSetU32(&arParms[cParms++], pCurCmd->mContextID); 1112 1112 1113 1113 int rc2 = hostCallback(GUEST_DISCONNECTED, cParms, arParms); … … 1207 1207 1208 1208 uint32_t uValue; 1209 int rc = paParms[0].getUInt32(&uValue);1209 int rc = HGCMSvcGetU32(&paParms[0], &uValue); 1210 1210 if (RT_SUCCESS(rc)) 1211 1211 { 1212 1212 uint32_t uMaskAdd; 1213 rc = paParms[1].getUInt32(&uMaskAdd);1213 rc = HGCMSvcGetU32(&paParms[1], &uMaskAdd); 1214 1214 if (RT_SUCCESS(rc)) 1215 1215 { 1216 1216 uint32_t uMaskRemove; 1217 rc = paParms[2].getUInt32(&uMaskRemove);1217 rc = HGCMSvcGetU32(&paParms[2], &uMaskRemove); 1218 1218 /** @todo paParm[3] (flags) not used yet. */ 1219 1219 if (RT_SUCCESS(rc)) … … 1584 1584 1585 1585 uint32_t uContextID, uFlags; 1586 int rc = paParms[0].getUInt32(&uContextID);1586 int rc = HGCMSvcGetU32(&paParms[0], &uContextID); 1587 1587 if (RT_SUCCESS(rc)) 1588 rc = paParms[1].getUInt32(&uFlags);1588 rc = HGCMSvcGetU32(&paParms[1], &uFlags); 1589 1589 1590 1590 uint32_t uSessionID = VBOX_GUESTCTRL_CONTEXTID_GET_SESSION(uContextID); -
trunk/src/VBox/HostServices/GuestControl/testcase/tstGuestControlSvc.cpp
r75500 r75737 152 152 153 153 VBOXHGCMSVCPARM aParms[1]; 154 aParms[0].setUInt32(1000 /* Context ID */);154 HGCMSvcSetU32(&aParms[0], 1000 /* Context ID */); 155 155 156 156 CMDHOST aCmdHostAll[] = … … 208 208 /* No commands from host yet. */ 209 209 VBOXHGCMSVCPARM aParmsGuest[8]; 210 aParmsGuest[0].setUInt32(0 /* Msg type */);211 aParmsGuest[1].setUInt32(0 /* Parameters */);210 HGCMSvcSetU32(&aParmsGuest[0], 0 /* Msg type */); 211 HGCMSvcSetU32(&aParmsGuest[1], 0 /* Parameters */); 212 212 pTable->pfnCall(pTable->pvService, &callHandle, 1 /* Client ID */, NULL /* pvClient */, 213 213 GUEST_MSG_WAIT, 2, &aParmsGuest[0], 0); … … 216 216 /* Host: Add a dummy command. */ 217 217 VBOXHGCMSVCPARM aParmsHost[8]; 218 aParmsHost[0].setUInt32(1000 /* Context ID */);219 aParmsHost[1].setString("foo.bar");220 aParmsHost[2].setString("baz");218 HGCMSvcSetU32(&aParmsHost[0], 1000 /* Context ID */); 219 HGCMSvcSetStr(&aParmsHost[1], "foo.bar"); 220 HGCMSvcSetStr(&aParmsHost[2], "baz"); 221 221 222 222 rc = pTable->pfnHostCall(pTable->pvService, HOST_EXEC_CMD, 3, &aParmsHost[0]); -
trunk/src/VBox/HostServices/GuestProperties/service.cpp
r75500 r75737 528 528 */ 529 529 if ( cParms != 4 530 || RT_FAILURE( paParms[0].getPointer((void **)&papszNames, &cbDummy))531 || RT_FAILURE( paParms[1].getPointer((void **)&papszValues, &cbDummy))532 || RT_FAILURE( paParms[2].getPointer((void **)&pau64Timestamps, &cbDummy))533 || RT_FAILURE( paParms[3].getPointer((void **)&papszFlags, &cbDummy))530 || RT_FAILURE(HGCMSvcGetPv(&paParms[0], (void **)&papszNames, &cbDummy)) 531 || RT_FAILURE(HGCMSvcGetPv(&paParms[1], (void **)&papszValues, &cbDummy)) 532 || RT_FAILURE(HGCMSvcGetPv(&paParms[2], (void **)&pau64Timestamps, &cbDummy)) 533 || RT_FAILURE(HGCMSvcGetPv(&paParms[3], (void **)&papszFlags, &cbDummy)) 534 534 ) 535 535 rc = VERR_INVALID_PARAMETER; … … 624 624 LogFlowThisFunc(("\n")); 625 625 if ( cParms != 4 /* Hardcoded value as the next lines depend on it. */ 626 || RT_FAILURE( paParms[0].getString(&pcszName, &cbName)) /* name */627 || RT_FAILURE( paParms[1].getBuffer((void **)&pchBuf, &cbBuf)) /* buffer */626 || RT_FAILURE(HGCMSvcGetCStr(&paParms[0], &pcszName, &cbName)) /* name */ 627 || RT_FAILURE(HGCMSvcGetBuf(&paParms[1], (void **)&pchBuf, &cbBuf)) /* buffer */ 628 628 ) 629 629 rc = VERR_INVALID_PARAMETER; … … 652 652 size_t const cbValue = pProp->mValue.size() + 1; 653 653 size_t const cbNeeded = cbValue + cbFlags; 654 paParms[3].setUInt32((uint32_t)cbNeeded);654 HGCMSvcSetU32(&paParms[3], (uint32_t)cbNeeded); 655 655 if (cbBuf >= cbNeeded) 656 656 { … … 659 659 memcpy(pchBuf + cbValue, szFlags, cbFlags); 660 660 661 paParms[2].setUInt64(pProp->mTimestamp);661 HGCMSvcSetU64(&paParms[2], pProp->mTimestamp); 662 662 663 663 /* … … 708 708 if ( RT_SUCCESS(rc) 709 709 && ( (cParms < 2) || (cParms > 3) /* Hardcoded value as the next lines depend on it. */ 710 || RT_FAILURE( paParms[0].getString(&pcszName, &cchName)) /* name */711 || RT_FAILURE( paParms[1].getString(&pcszValue, &cchValue)) /* value */710 || RT_FAILURE(HGCMSvcGetCStr(&paParms[0], &pcszName, &cchName)) /* name */ 711 || RT_FAILURE(HGCMSvcGetCStr(&paParms[1], &pcszValue, &cchValue)) /* value */ 712 712 || ( (3 == cParms) 713 && RT_FAILURE( paParms[2].getString(&pcszFlags, &cchFlags)) /* flags */713 && RT_FAILURE(HGCMSvcGetCStr(&paParms[2], &pcszFlags, &cchFlags)) /* flags */ 714 714 ) 715 715 ) … … 825 825 */ 826 826 if ( (cParms == 1) /* Hardcoded value as the next lines depend on it. */ 827 && RT_SUCCESS( paParms[0].getString(&pcszName, &cbName)) /* name */827 && RT_SUCCESS(HGCMSvcGetCStr(&paParms[0], &pcszName, &cbName)) /* name */ 828 828 ) 829 829 rc = validateName(pcszName, cbName); … … 954 954 LogFlowThisFunc(("\n")); 955 955 if ( (cParms != 3) /* Hardcoded value as the next lines depend on it. */ 956 || RT_FAILURE( paParms[0].getString(&pchPatterns, &cbPatterns)) /* patterns */957 || RT_FAILURE( paParms[1].getBuffer((void **)&pchBuf, &cbBuf)) /* return buffer */956 || RT_FAILURE(HGCMSvcGetCStr(&paParms[0], &pchPatterns, &cbPatterns)) /* patterns */ 957 || RT_FAILURE(HGCMSvcGetBuf(&paParms[1], (void **)&pchBuf, &cbBuf)) /* return buffer */ 958 958 ) 959 959 rc = VERR_INVALID_PARAMETER; … … 989 989 if (RT_SUCCESS(rc)) 990 990 { 991 paParms[2].setUInt32((uint32_t)(EnumData.cbNeeded + 4));991 HGCMSvcSetU32(&paParms[2], (uint32_t)(EnumData.cbNeeded + 4)); 992 992 if (EnumData.cbLeft >= 4) 993 993 { … … 1048 1048 uint32_t cbBuf; 1049 1049 1050 int rc = paParms[2].getBuffer((void **)&pchBuf, &cbBuf);1050 int rc = HGCMSvcGetBuf(&paParms[2], (void **)&pchBuf, &cbBuf); 1051 1051 if (RT_SUCCESS(rc)) 1052 1052 { … … 1066 1066 if (RT_SUCCESS(rc)) 1067 1067 { 1068 paParms[1].setUInt64(u64Timestamp);1069 paParms[3].setUInt32((uint32_t)buffer.size());1068 HGCMSvcSetU64(&paParms[1], u64Timestamp); 1069 HGCMSvcSetU32(&paParms[3], (uint32_t)buffer.size()); 1070 1070 if (buffer.size() <= cbBuf) 1071 1071 buffer.copy(pchBuf, cbBuf); … … 1105 1105 LogFlowThisFunc(("\n")); 1106 1106 if ( cParms != 4 /* Hardcoded value as the next lines depend on it. */ 1107 || RT_FAILURE( paParms[0].getString(&pszPatterns, &cchPatterns)) /* patterns */1108 || RT_FAILURE( paParms[1].getUInt64(&u64Timestamp)) /* timestamp */1109 || RT_FAILURE( paParms[2].getBuffer((void **)&pchBuf, &cbBuf)) /* return buffer */1107 || RT_FAILURE(HGCMSvcGetStr(&paParms[0], &pszPatterns, &cchPatterns)) /* patterns */ 1108 || RT_FAILURE(HGCMSvcGetU64(&paParms[1], &u64Timestamp)) /* timestamp */ 1109 || RT_FAILURE(HGCMSvcGetBuf(&paParms[2], (void **)&pchBuf, &cbBuf)) /* return buffer */ 1110 1110 ) 1111 1111 rc = VERR_INVALID_PARAMETER; … … 1135 1135 const char *pszPatternsExisting; 1136 1136 uint32_t cchPatternsExisting; 1137 int rc3 = it->mParms[0].getString(&pszPatternsExisting, &cchPatternsExisting);1137 int rc3 = HGCMSvcGetCStr(&it->mParms[0], &pszPatternsExisting, &cchPatternsExisting); 1138 1138 1139 1139 if ( RT_SUCCESS(rc3) … … 1213 1213 const char *pszPatterns; 1214 1214 uint32_t cchPatterns; 1215 it->mParms[0].getString(&pszPatterns, &cchPatterns);1215 HGCMSvcGetCStr(&it->mParms[0], &pszPatterns, &cchPatterns); 1216 1216 if (prop.Matches(pszPatterns)) 1217 1217 { … … 1529 1529 { 1530 1530 uint32_t fFlags; 1531 rc = paParms[0].getUInt32(&fFlags);1531 rc = HGCMSvcGetU32(&paParms[0], &fFlags); 1532 1532 if (RT_SUCCESS(rc)) 1533 1533 mfGlobalFlags = fFlags; -
trunk/src/VBox/HostServices/GuestProperties/testcase/tstGuestPropSvc.cpp
r75500 r75737 225 225 226 226 VBOXHGCMSVCPARM aParms[4]; 227 aParms[0].setPointer((void *)g_apcszNameBlock, 0);228 aParms[1].setPointer((void *)g_apcszValueBlock, 0);229 aParms[2].setPointer((void *)g_au64TimestampBlock, 0);230 aParms[3].setPointer((void *)g_apcszFlagsBlock, 0);227 HGCMSvcSetPv(&aParms[0], (void *)g_apcszNameBlock, 0); 228 HGCMSvcSetPv(&aParms[1], (void *)g_apcszValueBlock, 0); 229 HGCMSvcSetPv(&aParms[2], (void *)g_au64TimestampBlock, 0); 230 HGCMSvcSetPv(&aParms[3], (void *)g_apcszFlagsBlock, 0); 231 231 RTTESTI_CHECK_RC(ptable->pfnHostCall(ptable->pvService, GUEST_PROP_FN_HOST_SET_PROPS, 4, &aParms[0]), VINF_SUCCESS); 232 232 } … … 337 337 338 338 /* Check that we get buffer overflow with a too small buffer. */ 339 aParms[0].setPointer((void *)g_aEnumStrings[i].pszPatterns, g_aEnumStrings[i].cchPatterns);340 aParms[1].setPointer((void *)abBuffer, g_aEnumStrings[i].cbBuffer - 1);339 HGCMSvcSetPv(&aParms[0], (void *)g_aEnumStrings[i].pszPatterns, g_aEnumStrings[i].cchPatterns); 340 HGCMSvcSetPv(&aParms[1], (void *)abBuffer, g_aEnumStrings[i].cbBuffer - 1); 341 341 memset(abBuffer, 0x55, sizeof(abBuffer)); 342 342 int rc2 = ptable->pfnHostCall(ptable->pvService, GUEST_PROP_FN_HOST_ENUM_PROPS, 3, aParms); … … 344 344 { 345 345 uint32_t cbNeeded; 346 RTTESTI_CHECK_RC(rc2 = aParms[2].getUInt32(&cbNeeded), VINF_SUCCESS);346 RTTESTI_CHECK_RC(rc2 = HGCMSvcGetU32(&aParms[2], &cbNeeded), VINF_SUCCESS); 347 347 if (RT_SUCCESS(rc2)) 348 348 RTTESTI_CHECK_MSG(cbNeeded == g_aEnumStrings[i].cbBuffer, … … 353 353 354 354 /* Make a successfull call. */ 355 aParms[0].setPointer((void *)g_aEnumStrings[i].pszPatterns, g_aEnumStrings[i].cchPatterns);356 aParms[1].setPointer((void *)abBuffer, g_aEnumStrings[i].cbBuffer);355 HGCMSvcSetPv(&aParms[0], (void *)g_aEnumStrings[i].pszPatterns, g_aEnumStrings[i].cchPatterns); 356 HGCMSvcSetPv(&aParms[1], (void *)abBuffer, g_aEnumStrings[i].cbBuffer); 357 357 memset(abBuffer, 0x55, sizeof(abBuffer)); 358 358 rc2 = ptable->pfnHostCall(ptable->pvService, GUEST_PROP_FN_HOST_ENUM_PROPS, 3, aParms); … … 416 416 RTStrPrintf(szValue, sizeof(szValue), "%s", pcszValue); 417 417 RTStrPrintf(szFlags, sizeof(szFlags), "%s", pcszFlags); 418 aParms[0].setString(szName);419 aParms[1].setString(szValue);420 aParms[2].setString(szFlags);418 HGCMSvcSetStr(&aParms[0], szName); 419 HGCMSvcSetStr(&aParms[1], szValue); 420 HGCMSvcSetStr(&aParms[2], szFlags); 421 421 if (isHost) 422 422 callHandle.rc = pTable->pfnHostCall(pTable->pvService, command, … … 505 505 command = GUEST_PROP_FN_HOST_DEL_PROP; 506 506 VBOXHGCMSVCPARM aParms[1]; 507 aParms[0].setString(pcszName);507 HGCMSvcSetStr(&aParms[0], pcszName); 508 508 if (isHost) 509 509 callHandle.rc = pTable->pfnHostCall(pTable->pvService, command, 1, aParms); … … 606 606 RTTESTI_CHECK_RETV(s_aGetProperties[i].cchValue < sizeof(szBuffer)); 607 607 608 aParms[0].setString(s_aGetProperties[i].pcszName);608 HGCMSvcSetStr(&aParms[0], s_aGetProperties[i].pcszName); 609 609 memset(szBuffer, 0x55, sizeof(szBuffer)); 610 aParms[1].setPointer(szBuffer, sizeof(szBuffer));610 HGCMSvcSetPv(&aParms[1], szBuffer, sizeof(szBuffer)); 611 611 int rc2 = pTable->pfnHostCall(pTable->pvService, GUEST_PROP_FN_HOST_GET_PROP, 4, aParms); 612 612 … … 630 630 631 631 uint32_t u32ValueLen = UINT32_MAX; 632 RTTESTI_CHECK_RC(rc2 = aParms[3].getUInt32(&u32ValueLen), VINF_SUCCESS);632 RTTESTI_CHECK_RC(rc2 = HGCMSvcGetU32(&aParms[3], &u32ValueLen), VINF_SUCCESS); 633 633 if (RT_SUCCESS(rc2)) 634 634 { … … 643 643 { 644 644 uint64_t u64Timestamp = UINT64_MAX; 645 RTTESTI_CHECK_RC(rc2 = aParms[2].getUInt64(&u64Timestamp), VINF_SUCCESS);645 RTTESTI_CHECK_RC(rc2 = HGCMSvcGetU64(&aParms[2], &u64Timestamp), VINF_SUCCESS); 646 646 if (u64Timestamp != s_aGetProperties[i].u64Timestamp) 647 647 RTTestIFailed("Bad timestamp %llu for property '%s', expected %llu.", … … 700 700 memset(pvBuf, 0x55, cbBuf); 701 701 702 aParms[0].setPointer((void *)s_szPattern, sizeof(s_szPattern));703 aParms[1].setUInt64(1);704 aParms[2].setPointer(pvBuf, cbBuf);702 HGCMSvcSetPv(&aParms[0], (void *)s_szPattern, sizeof(s_szPattern)); 703 HGCMSvcSetU64(&aParms[1], 1); 704 HGCMSvcSetPv(&aParms[2], pvBuf, cbBuf); 705 705 pTable->pfnCall(pTable->pvService, &callHandle, 0, NULL, GUEST_PROP_FN_GET_NOTIFICATION, 4, aParms, 0); 706 706 707 707 if ( callHandle.rc != VERR_BUFFER_OVERFLOW 708 || RT_FAILURE( aParms[3].getUInt32(&cbRetNeeded))708 || RT_FAILURE(HGCMSvcGetU32(&aParms[3], &cbRetNeeded)) 709 709 || cbRetNeeded != g_aGetNotifications[0].cbBuffer 710 710 ) … … 726 726 memset(pvBuf, 0x55, cbBuf); 727 727 728 aParms[0].setPointer((void *)s_szPattern, sizeof(s_szPattern));729 aParms[1].setUInt64(u64Timestamp);730 aParms[2].setPointer(pvBuf, cbBuf);728 HGCMSvcSetPv(&aParms[0], (void *)s_szPattern, sizeof(s_szPattern)); 729 HGCMSvcSetU64(&aParms[1], u64Timestamp); 730 HGCMSvcSetPv(&aParms[2], pvBuf, cbBuf); 731 731 pTable->pfnCall(pTable->pvService, &callHandle, 0, NULL, GUEST_PROP_FN_GET_NOTIFICATION, 4, aParms, 0); 732 732 if ( RT_FAILURE(callHandle.rc) 733 733 || (i == 0 && callHandle.rc != VWRN_NOT_FOUND) 734 || RT_FAILURE( aParms[1].getUInt64(&u64Timestamp))735 || RT_FAILURE( aParms[3].getUInt32(&cbRetNeeded))734 || RT_FAILURE(HGCMSvcGetU64(&aParms[1], &u64Timestamp)) 735 || RT_FAILURE(HGCMSvcGetU32(&aParms[3], &cbRetNeeded)) 736 736 || cbRetNeeded != g_aGetNotifications[i].cbBuffer 737 737 || memcmp(pvBuf, g_aGetNotifications[i].pchBuffer, cbRetNeeded) != 0 … … 764 764 static char s_szPattern[] = ""; 765 765 766 g_AsyncNotification.aParms[0].setPointer((void *)s_szPattern, sizeof(s_szPattern));767 g_AsyncNotification.aParms[1].setUInt64(0);768 g_AsyncNotification.aParms[2].setPointer((void *)g_AsyncNotification.abBuffer,766 HGCMSvcSetPv(&g_AsyncNotification.aParms[0], (void *)s_szPattern, sizeof(s_szPattern)); 767 HGCMSvcSetU64(&g_AsyncNotification.aParms[1], 0); 768 HGCMSvcSetPv(&g_AsyncNotification.aParms[2], (void *)g_AsyncNotification.abBuffer, 769 769 sizeof(g_AsyncNotification.abBuffer)); 770 770 g_AsyncNotification.callHandle.rc = VINF_HGCM_ASYNC_EXECUTE; … … 786 786 uint32_t u32Size; 787 787 if ( g_AsyncNotification.callHandle.rc != VINF_SUCCESS 788 || RT_FAILURE( g_AsyncNotification.aParms[1].getUInt64(&u64Timestamp))789 || RT_FAILURE( g_AsyncNotification.aParms[3].getUInt32(&u32Size))788 || RT_FAILURE(HGCMSvcGetU64(&g_AsyncNotification.aParms[1], &u64Timestamp)) 789 || RT_FAILURE(HGCMSvcGetU32(&g_AsyncNotification.aParms[3], &u32Size)) 790 790 || u32Size != g_aGetNotifications[0].cbBuffer 791 791 || memcmp(g_AsyncNotification.abBuffer, g_aGetNotifications[0].pchBuffer, u32Size) != 0 … … 834 834 { 835 835 VBOXHGCMSVCPARM paParm; 836 paParm.setUInt32(fFlags);836 HGCMSvcSetU32(&paParm, fFlags); 837 837 int rc = pTable->pfnHostCall(pTable->pvService, GUEST_PROP_FN_HOST_SET_GLOBAL_FLAGS, 1, &paParm); 838 838 if (RT_FAILURE(rc)) … … 1018 1018 1019 1019 VBOXHGCMSVCPARM aParms[4]; 1020 aParms[0].setString(s_szProp);1021 aParms[1].setPointer(pvBuf, cbBuf);1020 HGCMSvcSetStr(&aParms[0], s_szProp); 1021 HGCMSvcSetPv(&aParms[1], pvBuf, cbBuf); 1022 1022 svcTable.pfnHostCall(svcTable.pvService, GUEST_PROP_FN_HOST_GET_PROP, RT_ELEMENTS(aParms), aParms); 1023 1023 … … 1054 1054 1055 1055 VBOXHGCMSVCPARM aParms[3]; 1056 aParms[0].setString("*");1057 aParms[1].setPointer(pvBuf, cbBuf);1056 HGCMSvcSetStr(&aParms[0], "*"); 1057 HGCMSvcSetPv(&aParms[1], pvBuf, cbBuf); 1058 1058 svcTable.pfnHostCall(svcTable.pvService, GUEST_PROP_FN_HOST_ENUM_PROPS, RT_ELEMENTS(aParms), aParms); 1059 1059 … … 1123 1123 VBOXHGCMSVCPARM aParms[4]; 1124 1124 char szBuffer[256]; 1125 aParms[0].setPointer(szProp, (uint32_t)cchProp + 1);1126 aParms[1].setPointer(szBuffer, sizeof(szBuffer));1125 HGCMSvcSetPv(&aParms[0], szProp, (uint32_t)cchProp + 1); 1126 HGCMSvcSetPv(&aParms[1], szBuffer, sizeof(szBuffer)); 1127 1127 RTTESTI_CHECK_RC_BREAK(svcTable.pfnHostCall(svcTable.pvService, GUEST_PROP_FN_HOST_GET_PROP, 4, aParms), VINF_SUCCESS); 1128 1128 } -
trunk/src/VBox/HostServices/SharedClipboard/testcase/tstClipboardServiceHost.cpp
r75500 r75737 62 62 RTTESTI_CHECK_MSG_RETV(RT_SUCCESS(rc), ("rc=%Rrc\n", rc)); 63 63 /* Reset global variable which doesn't reset itself. */ 64 parms[0].setUInt32(VBOX_SHARED_CLIPBOARD_MODE_OFF);64 HGCMSvcSetU32(&parms[0], VBOX_SHARED_CLIPBOARD_MODE_OFF); 65 65 rc = table.pfnHostCall(NULL, VBOX_SHARED_CLIPBOARD_HOST_FN_SET_MODE, 66 66 1, parms); … … 75 75 2, parms); 76 76 RTTESTI_CHECK_RC(rc, VERR_INVALID_PARAMETER); 77 parms[0].setUInt64(99);78 rc = table.pfnHostCall(NULL, VBOX_SHARED_CLIPBOARD_HOST_FN_SET_MODE, 79 1, parms); 80 RTTESTI_CHECK_RC(rc, VERR_INVALID_PARAMETER); 81 parms[0].setUInt32(VBOX_SHARED_CLIPBOARD_MODE_HOST_TO_GUEST);77 HGCMSvcSetU64(&parms[0], 99); 78 rc = table.pfnHostCall(NULL, VBOX_SHARED_CLIPBOARD_HOST_FN_SET_MODE, 79 1, parms); 80 RTTESTI_CHECK_RC(rc, VERR_INVALID_PARAMETER); 81 HGCMSvcSetU32(&parms[0], VBOX_SHARED_CLIPBOARD_MODE_HOST_TO_GUEST); 82 82 rc = table.pfnHostCall(NULL, VBOX_SHARED_CLIPBOARD_HOST_FN_SET_MODE, 83 83 1, parms); … … 86 86 RTTESTI_CHECK_MSG(u32Mode == VBOX_SHARED_CLIPBOARD_MODE_HOST_TO_GUEST, 87 87 ("u32Mode=%u\n", (unsigned) u32Mode)); 88 parms[0].setUInt32(99);88 HGCMSvcSetU32(&parms[0], 99); 89 89 rc = table.pfnHostCall(NULL, VBOX_SHARED_CLIPBOARD_HOST_FN_SET_MODE, 90 90 1, parms); … … 107 107 RTTESTI_CHECK_MSG_RETV(RT_SUCCESS(rc), ("rc=%Rrc\n", rc)); 108 108 /* Unless we are bidirectional the host message requests will be dropped. */ 109 parms[0].setUInt32(VBOX_SHARED_CLIPBOARD_MODE_BIDIRECTIONAL);109 HGCMSvcSetU32(&parms[0], VBOX_SHARED_CLIPBOARD_MODE_BIDIRECTIONAL); 110 110 rc = table.pfnHostCall(NULL, VBOX_SHARED_CLIPBOARD_HOST_FN_SET_MODE, 111 111 1, parms); … … 114 114 RTTestISub("Testing FN_GET_HOST_MSG, one format, waiting guest call."); 115 115 RT_ZERO(g_Client); 116 parms[0].setUInt32(0);117 parms[1].setUInt32(0);116 HGCMSvcSetU32(&parms[0], 0); 117 HGCMSvcSetU32(&parms[1], 0); 118 118 call.rc = VERR_TRY_AGAIN; 119 119 table.pfnCall(NULL, &call, 1 /* clientId */, &g_Client, VBOX_SHARED_CLIPBOARD_FN_GET_HOST_MSG, … … 134 134 vboxSvcClipboardReportMsg (&g_Client, VBOX_SHARED_CLIPBOARD_HOST_MSG_READ_DATA, 135 135 VBOX_SHARED_CLIPBOARD_FMT_HTML); 136 parms[0].setUInt32(0);137 parms[1].setUInt32(0);136 HGCMSvcSetU32(&parms[0], 0); 137 HGCMSvcSetU32(&parms[1], 0); 138 138 call.rc = VERR_TRY_AGAIN; 139 139 table.pfnCall(NULL, &call, 1 /* clientId */, &g_Client, VBOX_SHARED_CLIPBOARD_FN_GET_HOST_MSG, … … 149 149 RTTestISub("Testing FN_GET_HOST_MSG, two formats, waiting guest call."); 150 150 RT_ZERO(g_Client); 151 parms[0].setUInt32(0);152 parms[1].setUInt32(0);151 HGCMSvcSetU32(&parms[0], 0); 152 HGCMSvcSetU32(&parms[1], 0); 153 153 call.rc = VERR_TRY_AGAIN; 154 154 table.pfnCall(NULL, &call, 1 /* clientId */, &g_Client, VBOX_SHARED_CLIPBOARD_FN_GET_HOST_MSG, … … 175 175 vboxSvcClipboardReportMsg (&g_Client, VBOX_SHARED_CLIPBOARD_HOST_MSG_READ_DATA, 176 176 VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT | VBOX_SHARED_CLIPBOARD_FMT_HTML); 177 parms[0].setUInt32(0);178 parms[1].setUInt32(0);177 HGCMSvcSetU32(&parms[0], 0); 178 HGCMSvcSetU32(&parms[1], 0); 179 179 call.rc = VERR_TRY_AGAIN; 180 180 table.pfnCall(NULL, &call, 1 /* clientId */, &g_Client, VBOX_SHARED_CLIPBOARD_FN_GET_HOST_MSG, … … 207 207 RTTESTI_CHECK_MSG_RETV(RT_SUCCESS(rc), ("rc=%Rrc\n", rc)); 208 208 /* Reset global variable which doesn't reset itself. */ 209 parms[0].setUInt32(false);209 HGCMSvcSetU32(&parms[0], false); 210 210 rc = table.pfnHostCall(NULL, VBOX_SHARED_CLIPBOARD_HOST_FN_SET_HEADLESS, 211 211 1, parms); … … 219 219 2, parms); 220 220 RTTESTI_CHECK_RC(rc, VERR_INVALID_PARAMETER); 221 parms[0].setUInt64(99);222 rc = table.pfnHostCall(NULL, VBOX_SHARED_CLIPBOARD_HOST_FN_SET_HEADLESS, 223 1, parms); 224 RTTESTI_CHECK_RC(rc, VERR_INVALID_PARAMETER); 225 parms[0].setUInt32(true);221 HGCMSvcSetU64(&parms[0], 99); 222 rc = table.pfnHostCall(NULL, VBOX_SHARED_CLIPBOARD_HOST_FN_SET_HEADLESS, 223 1, parms); 224 RTTESTI_CHECK_RC(rc, VERR_INVALID_PARAMETER); 225 HGCMSvcSetU32(&parms[0], true); 226 226 rc = table.pfnHostCall(NULL, VBOX_SHARED_CLIPBOARD_HOST_FN_SET_HEADLESS, 227 227 1, parms); … … 229 229 fHeadless = vboxSvcClipboardGetHeadless(); 230 230 RTTESTI_CHECK_MSG(fHeadless == true, ("fHeadless=%RTbool\n", fHeadless)); 231 parms[0].setUInt32(99);231 HGCMSvcSetU32(&parms[0], 99); 232 232 rc = table.pfnHostCall(NULL, VBOX_SHARED_CLIPBOARD_HOST_FN_SET_HEADLESS, 233 233 1, parms); -
trunk/src/VBox/HostServices/SharedFolders/testcase/tstSharedFolderService.cpp
r75570 r75737 659 659 fillTestShflString(&Mapping, pcszMapping); 660 660 fillTestShflString(&AutoMountPoint, ""); 661 aParms[0].setPointer(&FolderName, RT_UOFFSETOF(SHFLSTRING, String)661 HGCMSvcSetPv(&aParms[0], &FolderName, RT_UOFFSETOF(SHFLSTRING, String) 662 662 + FolderName.string.u16Size); 663 aParms[1].setPointer(&Mapping, RT_UOFFSETOF(SHFLSTRING, String)663 HGCMSvcSetPv(&aParms[1], &Mapping, RT_UOFFSETOF(SHFLSTRING, String) 664 664 + Mapping.string.u16Size); 665 aParms[2].setUInt32(1);666 aParms[3].setPointer(&AutoMountPoint, SHFLSTRING_HEADER_SIZE + AutoMountPoint.string.u16Size);665 HGCMSvcSetU32(&aParms[2], 1); 666 HGCMSvcSetPv(&aParms[3], &AutoMountPoint, SHFLSTRING_HEADER_SIZE + AutoMountPoint.string.u16Size); 667 667 rc = psvcTable->pfnHostCall(psvcTable->pvService, SHFL_FN_ADD_MAPPING, 668 668 SHFL_CPARMS_ADD_MAPPING, aParms); 669 669 AssertReleaseRC(rc); 670 aParms[0].setPointer(&Mapping, RT_UOFFSETOF(SHFLSTRING, String)670 HGCMSvcSetPv(&aParms[0], &Mapping, RT_UOFFSETOF(SHFLSTRING, String) 671 671 + Mapping.string.u16Size); 672 aParms[1].setUInt32(0); /* root */673 aParms[2].setUInt32('/'); /* delimiter */674 aParms[3].setUInt32(fCaseSensitive);672 HGCMSvcSetU32(&aParms[1], 0); /* root */ 673 HGCMSvcSetU32(&aParms[2], '/'); /* delimiter */ 674 HGCMSvcSetU32(&aParms[3], fCaseSensitive); 675 675 psvcTable->pfnCall(psvcTable->pvService, &callHandle, 0, 676 676 psvcTable->pvService, SHFL_FN_MAP_FOLDER, … … 692 692 int rc; 693 693 694 aParms[0].setUInt32(root);694 HGCMSvcSetU32(&aParms[0], root); 695 695 psvcTable->pfnCall(psvcTable->pvService, &callHandle, 0, 696 696 psvcTable->pvService, SHFL_FN_UNMAP_FOLDER, … … 698 698 AssertReleaseRC(callHandle.rc); 699 699 fillTestShflString(&FolderName, pcszFolderName); 700 aParms[0].setPointer(&FolderName, RT_UOFFSETOF(SHFLSTRING, String)700 HGCMSvcSetPv(&aParms[0], &FolderName, RT_UOFFSETOF(SHFLSTRING, String) 701 701 + FolderName.string.u16Size); 702 702 rc = psvcTable->pfnHostCall(psvcTable->pvService, SHFL_FN_REMOVE_MAPPING, … … 717 717 RT_ZERO(CreateParms); 718 718 CreateParms.CreateFlags = fCreateFlags; 719 aParms[0].setUInt32(Root);720 aParms[1].setPointer(&Path, RT_UOFFSETOF(SHFLSTRING, String)719 HGCMSvcSetU32(&aParms[0], Root); 720 HGCMSvcSetPv(&aParms[1], &Path, RT_UOFFSETOF(SHFLSTRING, String) 721 721 + Path.string.u16Size); 722 aParms[2].setPointer(&CreateParms, sizeof(CreateParms));722 HGCMSvcSetPv(&aParms[2], &CreateParms, sizeof(CreateParms)); 723 723 psvcTable->pfnCall(psvcTable->pvService, &callHandle, 0, 724 724 psvcTable->pvService, SHFL_FN_CREATE, … … 740 740 VBOXHGCMCALLHANDLE_TYPEDEF callHandle = { VINF_SUCCESS }; 741 741 742 aParms[0].setUInt32(Root);743 aParms[1].setUInt64((uint64_t) hFile);744 aParms[2].setUInt64(offSeek);745 aParms[3].setUInt32(cbRead);746 aParms[4].setPointer(pvBuf, cbBuf);742 HGCMSvcSetU32(&aParms[0], Root); 743 HGCMSvcSetU64(&aParms[1], (uint64_t) hFile); 744 HGCMSvcSetU64(&aParms[2], offSeek); 745 HGCMSvcSetU32(&aParms[3], cbRead); 746 HGCMSvcSetPv(&aParms[4], pvBuf, cbBuf); 747 747 psvcTable->pfnCall(psvcTable->pvService, &callHandle, 0, 748 748 psvcTable->pvService, SHFL_FN_READ, … … 760 760 VBOXHGCMCALLHANDLE_TYPEDEF callHandle = { VINF_SUCCESS }; 761 761 762 aParms[0].setUInt32(Root);763 aParms[1].setUInt64((uint64_t) hFile);764 aParms[2].setUInt64(offSeek);765 aParms[3].setUInt32(cbWrite);766 aParms[4].setPointer((void *)pvBuf, cbBuf);762 HGCMSvcSetU32(&aParms[0], Root); 763 HGCMSvcSetU64(&aParms[1], (uint64_t) hFile); 764 HGCMSvcSetU64(&aParms[2], offSeek); 765 HGCMSvcSetU32(&aParms[3], cbWrite); 766 HGCMSvcSetPv(&aParms[4], (void *)pvBuf, cbBuf); 767 767 psvcTable->pfnCall(psvcTable->pvService, &callHandle, 0, 768 768 psvcTable->pvService, SHFL_FN_WRITE, … … 779 779 VBOXHGCMCALLHANDLE_TYPEDEF callHandle = { VINF_SUCCESS }; 780 780 781 aParms[0].setUInt32(root);782 aParms[1].setUInt64(handle);781 HGCMSvcSetU32(&aParms[0], root); 782 HGCMSvcSetU64(&aParms[1], handle); 783 783 psvcTable->pfnCall(psvcTable->pvService, &callHandle, 0, 784 784 psvcTable->pvService, SHFL_FN_FLUSH, … … 796 796 VBOXHGCMCALLHANDLE_TYPEDEF callHandle = { VINF_SUCCESS }; 797 797 798 aParms[0].setUInt32(root);799 aParms[1].setUInt64(handle);800 aParms[2].setUInt32(fFlags);801 aParms[3].setUInt32(cbBuf);798 HGCMSvcSetU32(&aParms[0], root); 799 HGCMSvcSetU64(&aParms[1], handle); 800 HGCMSvcSetU32(&aParms[2], fFlags); 801 HGCMSvcSetU32(&aParms[3], cbBuf); 802 802 if (pcszPath) 803 803 { 804 804 fillTestShflString(&Path, pcszPath); 805 aParms[4].setPointer(&Path, RT_UOFFSETOF(SHFLSTRING, String)805 HGCMSvcSetPv(&aParms[4], &Path, RT_UOFFSETOF(SHFLSTRING, String) 806 806 + Path.string.u16Size); 807 807 } 808 808 else 809 aParms[4].setPointer(NULL, 0);810 aParms[5].setPointer(pvBuf, cbBuf);811 aParms[6].setUInt32(resumePoint);812 aParms[7].setUInt32(0);809 HGCMSvcSetPv(&aParms[4], NULL, 0); 810 HGCMSvcSetPv(&aParms[5], pvBuf, cbBuf); 811 HGCMSvcSetU32(&aParms[6], resumePoint); 812 HGCMSvcSetU32(&aParms[7], 0); 813 813 psvcTable->pfnCall(psvcTable->pvService, &callHandle, 0, 814 814 psvcTable->pvService, SHFL_FN_LIST, … … 826 826 VBOXHGCMCALLHANDLE_TYPEDEF callHandle = { VINF_SUCCESS }; 827 827 828 aParms[0].setUInt32(root);829 aParms[1].setUInt64(handle);830 aParms[2].setUInt32(fFlags);831 aParms[3].setUInt32(cb);832 aParms[4].setPointer(pInfo, cb);828 HGCMSvcSetU32(&aParms[0], root); 829 HGCMSvcSetU64(&aParms[1], handle); 830 HGCMSvcSetU32(&aParms[2], fFlags); 831 HGCMSvcSetU32(&aParms[3], cb); 832 HGCMSvcSetPv(&aParms[4], pInfo, cb); 833 833 psvcTable->pfnCall(psvcTable->pvService, &callHandle, 0, 834 834 psvcTable->pvService, SHFL_FN_INFORMATION, … … 844 844 VBOXHGCMCALLHANDLE_TYPEDEF callHandle = { VINF_SUCCESS }; 845 845 846 aParms[0].setUInt32(root);847 aParms[1].setUInt64(handle);848 aParms[2].setUInt64(offLock);849 aParms[3].setUInt64(cbLock);850 aParms[4].setUInt32(fFlags);846 HGCMSvcSetU32(&aParms[0], root); 847 HGCMSvcSetU64(&aParms[1], handle); 848 HGCMSvcSetU64(&aParms[2], offLock); 849 HGCMSvcSetU64(&aParms[3], cbLock); 850 HGCMSvcSetU32(&aParms[4], fFlags); 851 851 psvcTable->pfnCall(psvcTable->pvService, &callHandle, 0, 852 852 psvcTable->pvService, SHFL_FN_LOCK, -
trunk/src/VBox/HostServices/common/client.cpp
r74213 r75737 222 222 AssertPtrReturn(m_Deferred.paParms, VERR_BUFFER_OVERFLOW); 223 223 224 m_Deferred.paParms[0].setUInt32(uMsg);225 m_Deferred.paParms[1].setUInt32(cParms);224 HGCMSvcSetU32(&m_Deferred.paParms[0], uMsg); 225 HGCMSvcSetU32(&m_Deferred.paParms[1], cParms); 226 226 227 227 return VINF_SUCCESS; -
trunk/src/VBox/HostServices/testcase/tstHGCMSvc.cpp
r69500 r75737 24 24 #include <iprt/test.h> 25 25 26 /** Test the getString member function. Indirectly tests the getPointer 27 * and getBuffer APIs. 28 * @param hTest an running IPRT test 29 * @param type the type that the parameter should be set to before 30 * calling getString 31 * @param pcch the value that the parameter should be set to before 32 * calling getString, and also the address (!) which we 33 * expect getString to return. Stricter than needed of 34 * course, but I was feeling lazy. 35 * @param cb the size that the parameter should be set to before 36 * calling getString, and also the size which we expect 37 * getString to return. 38 * @param rcExp the expected return value of the call to getString. 39 */ 40 void doTestGetString(VBOXHGCMSVCPARM *pParm, RTTEST hTest, uint32_t type, 41 const char *pcch, uint32_t cb, int rcExp) 42 { 43 /* An RTTest API like this, which would print out an additional line 44 * of context if a test failed, would be nice. This is because the 45 * line number alone doesn't help much here, given that this is a 46 * subroutine called many times. */ 47 /* 48 RTTestContextF(hTest, 49 ("doTestGetString, type=%u, pcch=%p, acp=%u, rcExp=%Rrc", 50 type, pcch, acp, rcExp)); 51 */ 52 HGCMSvcSetPv(pParm, (void *)pcch, cb); 53 pParm->type = type; /* in case we don't want VBOX_HGCM_SVC_PARM_PTR */ 54 const char *pcch2 = NULL; 55 uint32_t cb2 = 0; 56 int rc = HGCMSvcGetCStr(pParm, &pcch2, &cb2); 57 RTTEST_CHECK_RC(hTest, rc, rcExp); 58 if (RT_SUCCESS(rcExp)) 59 { 60 RTTEST_CHECK_MSG_RETV(hTest, (pcch2 == pcch), 61 (hTest, "expected %p, got %p", pcch, pcch2)); 62 RTTEST_CHECK_MSG_RETV(hTest, (cb2 == cb), 63 (hTest, "expected %u, got %u", cb, cb2)); 64 } 65 } 66 67 /** Run some unit tests on the getString method and indirectly test 68 * getPointer and getBuffer as well. */ 69 void testGetString(VBOXHGCMSVCPARM *pParm, RTTEST hTest) 70 { 71 RTTestSub(hTest, "HGCM string parameter handling"); 72 doTestGetString(pParm, hTest, VBOX_HGCM_SVC_PARM_32BIT, "test", 3, 73 VERR_INVALID_PARAMETER); 74 doTestGetString(pParm, hTest, VBOX_HGCM_SVC_PARM_PTR, "test", 5, 75 VINF_SUCCESS); 76 doTestGetString(pParm, hTest, VBOX_HGCM_SVC_PARM_PTR, "test", 3, 77 VERR_BUFFER_OVERFLOW); 78 doTestGetString(pParm, hTest, VBOX_HGCM_SVC_PARM_PTR, "test\xf0", 6, 79 VERR_INVALID_UTF8_ENCODING); 80 doTestGetString(pParm, hTest, VBOX_HGCM_SVC_PARM_PTR, "test", 0, 81 VERR_INVALID_PARAMETER); 82 doTestGetString(pParm, hTest, VBOX_HGCM_SVC_PARM_PTR, (const char *)0x1, 5, 83 VERR_INVALID_PARAMETER); 84 RTTestSubDone(hTest); 85 } 86 26 87 int main() 27 88 { … … 39 100 */ 40 101 VBOXHGCMSVCPARM parm; 41 parm.testGetString(hTest);102 testGetString(&parm, hTest); 42 103 43 104 /*
Note:
See TracChangeset
for help on using the changeset viewer.