Changeset 82847 in vbox for trunk/src/VBox
- Timestamp:
- Jan 24, 2020 10:27:25 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-transfers.cpp
r82846 r82847 51 51 * Prototypes * 52 52 *********************************************************************************************************************************/ 53 static int shClSvcTransferSetListOpen(uint32_t cParms, VBOXHGCMSVCPARM paParms[],53 static int shClSvcTransferSetListOpen(uint32_t cParms, VBOXHGCMSVCPARM aParms[], 54 54 PSHCLMSGCTX pMsgCtx, PSHCLLISTOPENPARMS pOpenParms); 55 static int shClSvcTransferSetListClose(uint32_t cParms, VBOXHGCMSVCPARM paParms[],55 static int shClSvcTransferSetListClose(uint32_t cParms, VBOXHGCMSVCPARM aParms[], 56 56 PSHCLMSGCTX pMsgCtx, SHCLLISTHANDLE hList); 57 57 … … 127 127 SHCLEVENTID idEvent = ShClEventIDGenerate(&pCtx->pTransfer->Events); 128 128 129 HGCMSvcSetU64(&pMsgHdr-> paParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID,130 131 HGCMSvcSetU32(&pMsgHdr-> paParms[1], 0 /* fRoots */);129 HGCMSvcSetU64(&pMsgHdr->aParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID, 130 pCtx->pTransfer->State.uID, idEvent)); 131 HGCMSvcSetU32(&pMsgHdr->aParms[1], 0 /* fRoots */); 132 132 133 133 rc = shClSvcMsgAdd(pClient, pMsgHdr, true /* fAppend */); … … 167 167 idEvent = ShClEventIDGenerate(&pCtx->pTransfer->Events); 168 168 169 HGCMSvcSetU64(&pMsgEntry-> paParms[0],169 HGCMSvcSetU64(&pMsgEntry->aParms[0], 170 170 VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uClientID, 171 171 pCtx->pTransfer->State.uID, idEvent)); 172 HGCMSvcSetU32(&pMsgEntry-> paParms[1], 0 /* fRoots */);173 HGCMSvcSetU32(&pMsgEntry-> paParms[2], i /* uIndex */);172 HGCMSvcSetU32(&pMsgEntry->aParms[1], 0 /* fRoots */); 173 HGCMSvcSetU32(&pMsgEntry->aParms[2], i /* uIndex */); 174 174 175 175 rc2 = ShClEventRegister(&pCtx->pTransfer->Events, idEvent); … … 249 249 idEvent); 250 250 251 rc = shClSvcTransferSetListOpen(pMsg->cParms, pMsg-> paParms, &pMsg->Ctx, pOpenParms);251 rc = shClSvcTransferSetListOpen(pMsg->cParms, pMsg->aParms, &pMsg->Ctx, pOpenParms); 252 252 if (RT_SUCCESS(rc)) 253 253 { … … 309 309 idEvent); 310 310 311 rc = shClSvcTransferSetListClose(pMsg->cParms, pMsg-> paParms, &pMsg->Ctx, hList);311 rc = shClSvcTransferSetListClose(pMsg->cParms, pMsg->aParms, &pMsg->Ctx, hList); 312 312 if (RT_SUCCESS(rc)) 313 313 { … … 354 354 const SHCLEVENTID idEvent = ShClEventIDGenerate(&pCtx->pTransfer->Events); 355 355 356 HGCMSvcSetU64(&pMsg-> paParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID,357 358 HGCMSvcSetU64(&pMsg-> paParms[1], hList);359 HGCMSvcSetU32(&pMsg-> paParms[2], 0 /* fFlags */);356 HGCMSvcSetU64(&pMsg->aParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID, 357 pCtx->pTransfer->State.uID, idEvent)); 358 HGCMSvcSetU64(&pMsg->aParms[1], hList); 359 HGCMSvcSetU32(&pMsg->aParms[2], 0 /* fFlags */); 360 360 361 361 rc = shClSvcMsgAdd(pClient, pMsg, true /* fAppend */); … … 415 415 const SHCLEVENTID idEvent = ShClEventIDGenerate(&pCtx->pTransfer->Events); 416 416 417 HGCMSvcSetU64(&pMsg-> paParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID,418 419 HGCMSvcSetU64(&pMsg-> paParms[1], hList);420 HGCMSvcSetU32(&pMsg-> paParms[2], 0 /* fInfo */);417 HGCMSvcSetU64(&pMsg->aParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID, 418 pCtx->pTransfer->State.uID, idEvent)); 419 HGCMSvcSetU64(&pMsg->aParms[1], hList); 420 HGCMSvcSetU32(&pMsg->aParms[2], 0 /* fInfo */); 421 421 422 422 rc = shClSvcMsgAdd(pClient, pMsg, true /* fAppend */); … … 479 479 const uint32_t cbPath = (uint32_t)strlen(pCreateParms->pszPath) + 1; /* Include terminating zero */ 480 480 481 HGCMSvcSetU64(&pMsg-> paParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID,482 483 HGCMSvcSetU64(&pMsg-> paParms[1], 0); /* uHandle */484 HGCMSvcSetU32(&pMsg-> paParms[2], cbPath);485 HGCMSvcSetPv (&pMsg-> paParms[3], pCreateParms->pszPath, cbPath);486 HGCMSvcSetU32(&pMsg-> paParms[4], pCreateParms->fCreate);481 HGCMSvcSetU64(&pMsg->aParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID, 482 pCtx->pTransfer->State.uID, idEvent)); 483 HGCMSvcSetU64(&pMsg->aParms[1], 0); /* uHandle */ 484 HGCMSvcSetU32(&pMsg->aParms[2], cbPath); 485 HGCMSvcSetPv (&pMsg->aParms[3], pCreateParms->pszPath, cbPath); 486 HGCMSvcSetU32(&pMsg->aParms[4], pCreateParms->fCreate); 487 487 488 488 rc = shClSvcMsgAdd(pClient, pMsg, true /* fAppend */); … … 537 537 const SHCLEVENTID idEvent = ShClEventIDGenerate(&pCtx->pTransfer->Events); 538 538 539 HGCMSvcSetU64(&pMsg-> paParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID,540 541 HGCMSvcSetU64(&pMsg-> paParms[1], hObj);539 HGCMSvcSetU64(&pMsg->aParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID, 540 pCtx->pTransfer->State.uID, idEvent)); 541 HGCMSvcSetU64(&pMsg->aParms[1], hObj); 542 542 543 543 rc = shClSvcMsgAdd(pClient, pMsg, true /* fAppend */); … … 593 593 const SHCLEVENTID idEvent = ShClEventIDGenerate(&pCtx->pTransfer->Events); 594 594 595 HGCMSvcSetU64(&pMsg-> paParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID,596 597 HGCMSvcSetU64(&pMsg-> paParms[1], hObj);598 HGCMSvcSetU32(&pMsg-> paParms[2], cbData);599 HGCMSvcSetU32(&pMsg-> paParms[3], fFlags);595 HGCMSvcSetU64(&pMsg->aParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID, 596 pCtx->pTransfer->State.uID, idEvent)); 597 HGCMSvcSetU64(&pMsg->aParms[1], hObj); 598 HGCMSvcSetU32(&pMsg->aParms[2], cbData); 599 HGCMSvcSetU32(&pMsg->aParms[3], fFlags); 600 600 601 601 rc = shClSvcMsgAdd(pClient, pMsg, true /* fAppend */); … … 652 652 const SHCLEVENTID idEvent = ShClEventIDGenerate(&pCtx->pTransfer->Events); 653 653 654 HGCMSvcSetU64(&pMsg-> paParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID,655 656 HGCMSvcSetU64(&pMsg-> paParms[1], hObj);657 HGCMSvcSetU64(&pMsg-> paParms[2], cbData);658 HGCMSvcSetU64(&pMsg-> paParms[3], fFlags);654 HGCMSvcSetU64(&pMsg->aParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID, 655 pCtx->pTransfer->State.uID, idEvent)); 656 HGCMSvcSetU64(&pMsg->aParms[1], hObj); 657 HGCMSvcSetU64(&pMsg->aParms[2], cbData); 658 HGCMSvcSetU64(&pMsg->aParms[3], fFlags); 659 659 660 660 rc = shClSvcMsgAdd(pClient, pMsg, true /* fAppend */); … … 778 778 * 779 779 * @returns VBox status code. 780 * @param cParms Number of HGCM parameters supplied in \a paParms.781 * @param paParmsArray of HGCM parameters.780 * @param cParms Number of HGCM parameters supplied in \a aParms. 781 * @param aParms Array of HGCM parameters. 782 782 * @param pReply Where to store the reply. 783 783 */ 784 static int shClSvcTransferGetReply(uint32_t cParms, VBOXHGCMSVCPARM paParms[],784 static int shClSvcTransferGetReply(uint32_t cParms, VBOXHGCMSVCPARM aParms[], 785 785 PSHCLREPLY pReply) 786 786 { … … 791 791 uint32_t cbPayload = 0; 792 792 793 /* paParms[0] has the context ID. */794 rc = HGCMSvcGetU32(& paParms[1], &pReply->uType);795 if (RT_SUCCESS(rc)) 796 rc = HGCMSvcGetU32(& paParms[2], &pReply->rc);797 if (RT_SUCCESS(rc)) 798 rc = HGCMSvcGetU32(& paParms[3], &cbPayload);799 if (RT_SUCCESS(rc)) 800 { 801 rc = HGCMSvcGetPv(& paParms[4], &pReply->pvPayload, &pReply->cbPayload);793 /* aParms[0] has the context ID. */ 794 rc = HGCMSvcGetU32(&aParms[1], &pReply->uType); 795 if (RT_SUCCESS(rc)) 796 rc = HGCMSvcGetU32(&aParms[2], &pReply->rc); 797 if (RT_SUCCESS(rc)) 798 rc = HGCMSvcGetU32(&aParms[3], &cbPayload); 799 if (RT_SUCCESS(rc)) 800 { 801 rc = HGCMSvcGetPv(&aParms[4], &pReply->pvPayload, &pReply->cbPayload); 802 802 AssertReturn(cbPayload == pReply->cbPayload, VERR_INVALID_PARAMETER); 803 803 } … … 812 812 { 813 813 if (cParms >= 6) 814 rc = HGCMSvcGetU32(& paParms[5], &pReply->u.TransferStatus.uStatus);814 rc = HGCMSvcGetU32(&aParms[5], &pReply->u.TransferStatus.uStatus); 815 815 816 816 LogFlowFunc(("uTransferStatus=%RU32\n", pReply->u.TransferStatus.uStatus)); … … 821 821 { 822 822 if (cParms >= 6) 823 rc = HGCMSvcGetU64(& paParms[5], &pReply->u.ListOpen.uHandle);823 rc = HGCMSvcGetU64(&aParms[5], &pReply->u.ListOpen.uHandle); 824 824 825 825 LogFlowFunc(("hListOpen=%RU64\n", pReply->u.ListOpen.uHandle)); … … 830 830 { 831 831 if (cParms >= 6) 832 rc = HGCMSvcGetU64(& paParms[5], &pReply->u.ListClose.uHandle);832 rc = HGCMSvcGetU64(&aParms[5], &pReply->u.ListClose.uHandle); 833 833 834 834 LogFlowFunc(("hListClose=%RU64\n", pReply->u.ListClose.uHandle)); … … 839 839 { 840 840 if (cParms >= 6) 841 rc = HGCMSvcGetU64(& paParms[5], &pReply->u.ObjOpen.uHandle);841 rc = HGCMSvcGetU64(&aParms[5], &pReply->u.ObjOpen.uHandle); 842 842 843 843 LogFlowFunc(("hObjOpen=%RU64\n", pReply->u.ObjOpen.uHandle)); … … 848 848 { 849 849 if (cParms >= 6) 850 rc = HGCMSvcGetU64(& paParms[5], &pReply->u.ObjClose.uHandle);850 rc = HGCMSvcGetU64(&aParms[5], &pReply->u.ObjClose.uHandle); 851 851 852 852 LogFlowFunc(("hObjClose=%RU64\n", pReply->u.ObjClose.uHandle)); … … 871 871 * 872 872 * @returns VBox status code. 873 * @param cParms Number of HGCM parameters supplied in \a paParms.874 * @param paParmsArray of HGCM parameters.873 * @param cParms Number of HGCM parameters supplied in \a aParms. 874 * @param aParms Array of HGCM parameters. 875 875 * @param pRootLstHdr Where to store the transfer root list header on success. 876 876 */ 877 static int shClSvcTransferGetRootListHdr(uint32_t cParms, VBOXHGCMSVCPARM paParms[],877 static int shClSvcTransferGetRootListHdr(uint32_t cParms, VBOXHGCMSVCPARM aParms[], 878 878 PSHCLROOTLISTHDR pRootLstHdr) 879 879 { … … 882 882 if (cParms == VBOX_SHCL_CPARMS_ROOT_LIST_HDR_WRITE) 883 883 { 884 rc = HGCMSvcGetU32(& paParms[1], &pRootLstHdr->fRoots);885 if (RT_SUCCESS(rc)) 886 rc = HGCMSvcGetU32(& paParms[2], &pRootLstHdr->cRoots);884 rc = HGCMSvcGetU32(&aParms[1], &pRootLstHdr->fRoots); 885 if (RT_SUCCESS(rc)) 886 rc = HGCMSvcGetU32(&aParms[2], &pRootLstHdr->cRoots); 887 887 } 888 888 else … … 897 897 * 898 898 * @returns VBox status code. 899 * @param cParms Number of HGCM parameters supplied in \a paParms.900 * @param paParmsArray of HGCM parameters.899 * @param cParms Number of HGCM parameters supplied in \a aParms. 900 * @param aParms Array of HGCM parameters. 901 901 * @param pListEntry Where to store the root list entry. 902 902 */ 903 static int shClSvcTransferGetRootListEntry(uint32_t cParms, VBOXHGCMSVCPARM paParms[],903 static int shClSvcTransferGetRootListEntry(uint32_t cParms, VBOXHGCMSVCPARM aParms[], 904 904 PSHCLROOTLISTENTRY pListEntry) 905 905 { … … 908 908 if (cParms == VBOX_SHCL_CPARMS_ROOT_LIST_ENTRY_WRITE) 909 909 { 910 rc = HGCMSvcGetU32(& paParms[1], &pListEntry->fInfo);911 /* Note: paParms[2] contains the entry index, currently being ignored. */912 if (RT_SUCCESS(rc)) 913 rc = HGCMSvcGetPv(& paParms[3], (void **)&pListEntry->pszName, &pListEntry->cbName);910 rc = HGCMSvcGetU32(&aParms[1], &pListEntry->fInfo); 911 /* Note: aParms[2] contains the entry index, currently being ignored. */ 912 if (RT_SUCCESS(rc)) 913 rc = HGCMSvcGetPv(&aParms[3], (void **)&pListEntry->pszName, &pListEntry->cbName); 914 914 if (RT_SUCCESS(rc)) 915 915 { 916 916 uint32_t cbInfo; 917 rc = HGCMSvcGetU32(& paParms[4], &cbInfo);918 if (RT_SUCCESS(rc)) 919 { 920 rc = HGCMSvcGetPv(& paParms[5], &pListEntry->pvInfo, &pListEntry->cbInfo);917 rc = HGCMSvcGetU32(&aParms[4], &cbInfo); 918 if (RT_SUCCESS(rc)) 919 { 920 rc = HGCMSvcGetPv(&aParms[5], &pListEntry->pvInfo, &pListEntry->cbInfo); 921 921 AssertReturn(cbInfo == pListEntry->cbInfo, VERR_INVALID_PARAMETER); 922 922 } … … 934 934 * 935 935 * @returns VBox status code. 936 * @param cParms Number of HGCM parameters supplied in \a paParms.937 * @param paParmsArray of HGCM parameters.936 * @param cParms Number of HGCM parameters supplied in \a aParms. 937 * @param aParms Array of HGCM parameters. 938 938 * @param pOpenParms Where to store the open parameters of the request. 939 939 */ 940 static int shClSvcTransferGetListOpen(uint32_t cParms, VBOXHGCMSVCPARM paParms[],940 static int shClSvcTransferGetListOpen(uint32_t cParms, VBOXHGCMSVCPARM aParms[], 941 941 PSHCLLISTOPENPARMS pOpenParms) 942 942 { … … 948 948 uint32_t cbFilter = 0; 949 949 950 rc = HGCMSvcGetU32(& paParms[1], &pOpenParms->fList);951 if (RT_SUCCESS(rc)) 952 rc = HGCMSvcGetU32(& paParms[2], &cbFilter);953 if (RT_SUCCESS(rc)) 954 { 955 rc = HGCMSvcGetStr(& paParms[3], &pOpenParms->pszFilter, &pOpenParms->cbFilter);950 rc = HGCMSvcGetU32(&aParms[1], &pOpenParms->fList); 951 if (RT_SUCCESS(rc)) 952 rc = HGCMSvcGetU32(&aParms[2], &cbFilter); 953 if (RT_SUCCESS(rc)) 954 { 955 rc = HGCMSvcGetStr(&aParms[3], &pOpenParms->pszFilter, &pOpenParms->cbFilter); 956 956 AssertReturn(cbFilter == pOpenParms->cbFilter, VERR_INVALID_PARAMETER); 957 957 } 958 958 if (RT_SUCCESS(rc)) 959 rc = HGCMSvcGetU32(& paParms[4], &cbPath);960 if (RT_SUCCESS(rc)) 961 { 962 rc = HGCMSvcGetStr(& paParms[5], &pOpenParms->pszPath, &pOpenParms->cbPath);959 rc = HGCMSvcGetU32(&aParms[4], &cbPath); 960 if (RT_SUCCESS(rc)) 961 { 962 rc = HGCMSvcGetStr(&aParms[5], &pOpenParms->pszPath, &pOpenParms->cbPath); 963 963 AssertReturn(cbPath == pOpenParms->cbPath, VERR_INVALID_PARAMETER); 964 964 } … … 977 977 * 978 978 * @returns VBox status code. 979 * @param cParms Number of HGCM parameters supplied in \a paParms.980 * @param paParmsArray of HGCM parameters.979 * @param cParms Number of HGCM parameters supplied in \a aParms. 980 * @param aParms Array of HGCM parameters. 981 981 * @param pMsgCtx Message context to use. 982 982 * @param pOpenParms List open parameters to set. 983 983 */ 984 static int shClSvcTransferSetListOpen(uint32_t cParms, VBOXHGCMSVCPARM paParms[],984 static int shClSvcTransferSetListOpen(uint32_t cParms, VBOXHGCMSVCPARM aParms[], 985 985 PSHCLMSGCTX pMsgCtx, PSHCLLISTOPENPARMS pOpenParms) 986 986 { … … 989 989 if (cParms == VBOX_SHCL_CPARMS_LIST_OPEN) 990 990 { 991 HGCMSvcSetU64(& paParms[0], pMsgCtx->uContextID);992 HGCMSvcSetU32(& paParms[1], pOpenParms->fList);993 HGCMSvcSetU32(& paParms[2], pOpenParms->cbFilter);994 HGCMSvcSetPv (& paParms[3], pOpenParms->pszFilter, pOpenParms->cbFilter);995 HGCMSvcSetU32(& paParms[4], pOpenParms->cbPath);996 HGCMSvcSetPv (& paParms[5], pOpenParms->pszPath, pOpenParms->cbPath);997 HGCMSvcSetU64(& paParms[6], 0); /* OUT: uHandle */991 HGCMSvcSetU64(&aParms[0], pMsgCtx->uContextID); 992 HGCMSvcSetU32(&aParms[1], pOpenParms->fList); 993 HGCMSvcSetU32(&aParms[2], pOpenParms->cbFilter); 994 HGCMSvcSetPv (&aParms[3], pOpenParms->pszFilter, pOpenParms->cbFilter); 995 HGCMSvcSetU32(&aParms[4], pOpenParms->cbPath); 996 HGCMSvcSetPv (&aParms[5], pOpenParms->pszPath, pOpenParms->cbPath); 997 HGCMSvcSetU64(&aParms[6], 0); /* OUT: uHandle */ 998 998 999 999 rc = VINF_SUCCESS; … … 1010 1010 * 1011 1011 * @returns VBox status code. 1012 * @param cParms Number of HGCM parameters supplied in \a paParms.1013 * @param paParmsArray of HGCM parameters.1012 * @param cParms Number of HGCM parameters supplied in \a aParms. 1013 * @param aParms Array of HGCM parameters. 1014 1014 * @param pMsgCtx Message context to use. 1015 1015 * @param hList Handle of list to close. 1016 1016 */ 1017 static int shClSvcTransferSetListClose(uint32_t cParms, VBOXHGCMSVCPARM paParms[],1017 static int shClSvcTransferSetListClose(uint32_t cParms, VBOXHGCMSVCPARM aParms[], 1018 1018 PSHCLMSGCTX pMsgCtx, SHCLLISTHANDLE hList) 1019 1019 { … … 1022 1022 if (cParms == VBOX_SHCL_CPARMS_LIST_CLOSE) 1023 1023 { 1024 HGCMSvcSetU64(& paParms[0], pMsgCtx->uContextID);1025 HGCMSvcSetU64(& paParms[1], hList);1024 HGCMSvcSetU64(&aParms[0], pMsgCtx->uContextID); 1025 HGCMSvcSetU64(&aParms[1], hList); 1026 1026 1027 1027 rc = VINF_SUCCESS; … … 1038 1038 * 1039 1039 * @returns VBox status code. 1040 * @param cParms Number of HGCM parameters supplied in \a paParms.1041 * @param paParmsArray of HGCM parameters.1040 * @param cParms Number of HGCM parameters supplied in \a aParms. 1041 * @param aParms Array of HGCM parameters. 1042 1042 * @param phList Where to store the list handle. 1043 1043 * @param pListHdr Where to store the list header. 1044 1044 */ 1045 static int shClSvcTransferGetListHdr(uint32_t cParms, VBOXHGCMSVCPARM paParms[],1045 static int shClSvcTransferGetListHdr(uint32_t cParms, VBOXHGCMSVCPARM aParms[], 1046 1046 PSHCLLISTHANDLE phList, PSHCLLISTHDR pListHdr) 1047 1047 { … … 1050 1050 if (cParms == VBOX_SHCL_CPARMS_LIST_HDR) 1051 1051 { 1052 rc = HGCMSvcGetU64(& paParms[1], phList);1053 /* Note: Flags ( paParms[2]) not used here. */1054 if (RT_SUCCESS(rc)) 1055 rc = HGCMSvcGetU32(& paParms[3], &pListHdr->fFeatures);1056 if (RT_SUCCESS(rc)) 1057 rc = HGCMSvcGetU64(& paParms[4], &pListHdr->cTotalObjects);1058 if (RT_SUCCESS(rc)) 1059 rc = HGCMSvcGetU64(& paParms[5], &pListHdr->cbTotalSize);1052 rc = HGCMSvcGetU64(&aParms[1], phList); 1053 /* Note: Flags (aParms[2]) not used here. */ 1054 if (RT_SUCCESS(rc)) 1055 rc = HGCMSvcGetU32(&aParms[3], &pListHdr->fFeatures); 1056 if (RT_SUCCESS(rc)) 1057 rc = HGCMSvcGetU64(&aParms[4], &pListHdr->cTotalObjects); 1058 if (RT_SUCCESS(rc)) 1059 rc = HGCMSvcGetU64(&aParms[5], &pListHdr->cbTotalSize); 1060 1060 1061 1061 if (RT_SUCCESS(rc)) … … 1076 1076 * 1077 1077 * @returns VBox status code. 1078 * @param cParms Number of HGCM parameters supplied in \a paParms.1079 * @param paParmsArray of HGCM parameters.1078 * @param cParms Number of HGCM parameters supplied in \a aParms. 1079 * @param aParms Array of HGCM parameters. 1080 1080 * @param pListHdr Pointer to list header to set. 1081 1081 */ 1082 static int shClSvcTransferSetListHdr(uint32_t cParms, VBOXHGCMSVCPARM paParms[], PSHCLLISTHDR pListHdr)1082 static int shClSvcTransferSetListHdr(uint32_t cParms, VBOXHGCMSVCPARM aParms[], PSHCLLISTHDR pListHdr) 1083 1083 { 1084 1084 int rc; … … 1089 1089 /** @todo Calculate header checksum. */ 1090 1090 1091 HGCMSvcSetU32(& paParms[3], pListHdr->fFeatures);1092 HGCMSvcSetU64(& paParms[4], pListHdr->cTotalObjects);1093 HGCMSvcSetU64(& paParms[5], pListHdr->cbTotalSize);1091 HGCMSvcSetU32(&aParms[3], pListHdr->fFeatures); 1092 HGCMSvcSetU64(&aParms[4], pListHdr->cTotalObjects); 1093 HGCMSvcSetU64(&aParms[5], pListHdr->cbTotalSize); 1094 1094 1095 1095 rc = VINF_SUCCESS; … … 1106 1106 * 1107 1107 * @returns VBox status code. 1108 * @param cParms Number of HGCM parameters supplied in \a paParms.1109 * @param paParmsArray of HGCM parameters.1108 * @param cParms Number of HGCM parameters supplied in \a aParms. 1109 * @param aParms Array of HGCM parameters. 1110 1110 * @param phList Where to store the list handle. 1111 1111 * @param pListEntry Where to store the list entry. 1112 1112 */ 1113 static int shClSvcTransferGetListEntry(uint32_t cParms, VBOXHGCMSVCPARM paParms[],1113 static int shClSvcTransferGetListEntry(uint32_t cParms, VBOXHGCMSVCPARM aParms[], 1114 1114 PSHCLLISTHANDLE phList, PSHCLLISTENTRY pListEntry) 1115 1115 { … … 1118 1118 if (cParms == VBOX_SHCL_CPARMS_LIST_ENTRY) 1119 1119 { 1120 rc = HGCMSvcGetU64(& paParms[1], phList);1121 if (RT_SUCCESS(rc)) 1122 rc = HGCMSvcGetU32(& paParms[2], &pListEntry->fInfo);1123 if (RT_SUCCESS(rc)) 1124 rc = HGCMSvcGetPv(& paParms[3], (void **)&pListEntry->pszName, &pListEntry->cbName);1120 rc = HGCMSvcGetU64(&aParms[1], phList); 1121 if (RT_SUCCESS(rc)) 1122 rc = HGCMSvcGetU32(&aParms[2], &pListEntry->fInfo); 1123 if (RT_SUCCESS(rc)) 1124 rc = HGCMSvcGetPv(&aParms[3], (void **)&pListEntry->pszName, &pListEntry->cbName); 1125 1125 if (RT_SUCCESS(rc)) 1126 1126 { 1127 1127 uint32_t cbInfo; 1128 rc = HGCMSvcGetU32(& paParms[4], &cbInfo);1129 if (RT_SUCCESS(rc)) 1130 { 1131 rc = HGCMSvcGetPv(& paParms[5], &pListEntry->pvInfo, &pListEntry->cbInfo);1128 rc = HGCMSvcGetU32(&aParms[4], &cbInfo); 1129 if (RT_SUCCESS(rc)) 1130 { 1131 rc = HGCMSvcGetPv(&aParms[5], &pListEntry->pvInfo, &pListEntry->cbInfo); 1132 1132 AssertReturn(cbInfo == pListEntry->cbInfo, VERR_INVALID_PARAMETER); 1133 1133 } … … 1151 1151 * 1152 1152 * @returns VBox status code. 1153 * @param cParms Number of HGCM parameters supplied in \a paParms.1154 * @param paParmsArray of HGCM parameters.1153 * @param cParms Number of HGCM parameters supplied in \a aParms. 1154 * @param aParms Array of HGCM parameters. 1155 1155 * @param pListEntry Pointer list entry to set. 1156 1156 */ 1157 static int shClSvcTransferSetListEntry(uint32_t cParms, VBOXHGCMSVCPARM paParms[],1157 static int shClSvcTransferSetListEntry(uint32_t cParms, VBOXHGCMSVCPARM aParms[], 1158 1158 PSHCLLISTENTRY pListEntry) 1159 1159 { … … 1165 1165 if (cParms == VBOX_SHCL_CPARMS_LIST_ENTRY) 1166 1166 { 1167 HGCMSvcSetPv (& paParms[3], pListEntry->pszName, pListEntry->cbName);1168 HGCMSvcSetU32(& paParms[4], pListEntry->cbInfo);1169 HGCMSvcSetPv (& paParms[5], pListEntry->pvInfo, pListEntry->cbInfo);1167 HGCMSvcSetPv (&aParms[3], pListEntry->pszName, pListEntry->cbName); 1168 HGCMSvcSetU32(&aParms[4], pListEntry->cbInfo); 1169 HGCMSvcSetPv (&aParms[5], pListEntry->pvInfo, pListEntry->cbInfo); 1170 1170 1171 1171 rc = VINF_SUCCESS; … … 1182 1182 * 1183 1183 * @returns VBox status code. 1184 * @param cParms Number of HGCM parameters supplied in \a paParms.1185 * @param paParmsArray of HGCM parameters.1184 * @param cParms Number of HGCM parameters supplied in \a aParms. 1185 * @param aParms Array of HGCM parameters. 1186 1186 * @param pDataChunk Where to store the object data chunk data. 1187 1187 */ 1188 static int shClSvcTransferGetObjDataChunk(uint32_t cParms, VBOXHGCMSVCPARM paParms[], PSHCLOBJDATACHUNK pDataChunk)1189 { 1190 AssertPtrReturn( paParms, VERR_INVALID_PARAMETER);1188 static int shClSvcTransferGetObjDataChunk(uint32_t cParms, VBOXHGCMSVCPARM aParms[], PSHCLOBJDATACHUNK pDataChunk) 1189 { 1190 AssertPtrReturn(aParms, VERR_INVALID_PARAMETER); 1191 1191 AssertPtrReturn(pDataChunk, VERR_INVALID_PARAMETER); 1192 1192 … … 1195 1195 if (cParms == VBOX_SHCL_CPARMS_OBJ_WRITE) 1196 1196 { 1197 rc = HGCMSvcGetU64(& paParms[1], &pDataChunk->uHandle);1197 rc = HGCMSvcGetU64(&aParms[1], &pDataChunk->uHandle); 1198 1198 if (RT_SUCCESS(rc)) 1199 1199 { 1200 1200 uint32_t cbData; 1201 rc = HGCMSvcGetU32(& paParms[2], &cbData);1202 if (RT_SUCCESS(rc)) 1203 { 1204 rc = HGCMSvcGetPv(& paParms[3], &pDataChunk->pvData, &pDataChunk->cbData);1201 rc = HGCMSvcGetU32(&aParms[2], &cbData); 1202 if (RT_SUCCESS(rc)) 1203 { 1204 rc = HGCMSvcGetPv(&aParms[3], &pDataChunk->pvData, &pDataChunk->cbData); 1205 1205 AssertReturn(cbData == pDataChunk->cbData, VERR_INVALID_PARAMETER); 1206 1206 … … 1223 1223 * @param pTransfer Pointer to transfer to handle guest reply for. 1224 1224 * @param cParms Number of function parameters supplied. 1225 * @param paParmsArray function parameters supplied.1225 * @param aParms Array function parameters supplied. 1226 1226 */ 1227 1227 static int shClSvcTransferHandleReply(PSHCLCLIENT pClient, PSHCLTRANSFER pTransfer, 1228 uint32_t cParms, VBOXHGCMSVCPARM paParms[])1228 uint32_t cParms, VBOXHGCMSVCPARM aParms[]) 1229 1229 { 1230 1230 RT_NOREF(pClient); … … 1236 1236 if (pReply) 1237 1237 { 1238 rc = shClSvcTransferGetReply(cParms, paParms, pReply);1238 rc = shClSvcTransferGetReply(cParms, aParms, pReply); 1239 1239 if (RT_SUCCESS(rc)) 1240 1240 { … … 1259 1259 { 1260 1260 uint64_t uCID; 1261 rc = HGCMSvcGetU64(& paParms[0], &uCID);1261 rc = HGCMSvcGetU64(&aParms[0], &uCID); 1262 1262 if (RT_SUCCESS(rc)) 1263 1263 { … … 1307 1307 * @param u32Function Function number being called. 1308 1308 * @param cParms Number of function parameters supplied. 1309 * @param paParms Array function parameterssupplied.1309 * @param aParms Array function parameters supplied. 1310 1310 * @param tsArrival Timestamp of arrival. 1311 1311 */ … … 1314 1314 uint32_t u32Function, 1315 1315 uint32_t cParms, 1316 VBOXHGCMSVCPARM paParms[],1316 VBOXHGCMSVCPARM aParms[], 1317 1317 uint64_t tsArrival) 1318 1318 { 1319 RT_NOREF(callHandle, paParms, tsArrival);1319 RT_NOREF(callHandle, aParms, tsArrival); 1320 1320 1321 1321 LogFlowFunc(("uClient=%RU32, u32Function=%RU32 (%s), cParms=%RU32, g_ExtState.pfnExtension=%p\n", … … 1362 1362 break; 1363 1363 1364 rc = HGCMSvcGetU64(& paParms[0], &uCID);1364 rc = HGCMSvcGetU64(&aParms[0], &uCID); 1365 1365 if (RT_FAILURE(rc)) 1366 1366 break; … … 1387 1387 case VBOX_SHCL_GUEST_FN_REPLY: 1388 1388 { 1389 rc = shClSvcTransferHandleReply(pClient, pTransfer, cParms, paParms);1389 rc = shClSvcTransferHandleReply(pClient, pTransfer, cParms, aParms); 1390 1390 break; 1391 1391 } … … 1413 1413 rootListHdr.cRoots = ShClTransferRootsCount(pTransfer); 1414 1414 1415 HGCMSvcSetU64(& paParms[0], 0 /* Context ID */);1416 HGCMSvcSetU32(& paParms[1], rootListHdr.fRoots);1417 HGCMSvcSetU32(& paParms[2], rootListHdr.cRoots);1415 HGCMSvcSetU64(&aParms[0], 0 /* Context ID */); 1416 HGCMSvcSetU32(&aParms[1], rootListHdr.fRoots); 1417 HGCMSvcSetU32(&aParms[2], rootListHdr.cRoots); 1418 1418 1419 1419 rc = VINF_SUCCESS; … … 1424 1424 { 1425 1425 SHCLROOTLISTHDR lstHdr; 1426 rc = shClSvcTransferGetRootListHdr(cParms, paParms, &lstHdr);1426 rc = shClSvcTransferGetRootListHdr(cParms, aParms, &lstHdr); 1427 1427 if (RT_SUCCESS(rc)) 1428 1428 { … … 1449 1449 break; 1450 1450 1451 /* paParms[1] contains fInfo flags, currently unused. */1451 /* aParms[1] contains fInfo flags, currently unused. */ 1452 1452 uint32_t uIndex; 1453 rc = HGCMSvcGetU32(& paParms[2], &uIndex);1453 rc = HGCMSvcGetU32(&aParms[2], &uIndex); 1454 1454 if (RT_SUCCESS(rc)) 1455 1455 { … … 1458 1458 if (RT_SUCCESS(rc)) 1459 1459 { 1460 HGCMSvcSetPv (& paParms[3], rootListEntry.pszName, rootListEntry.cbName);1461 HGCMSvcSetU32(& paParms[4], rootListEntry.cbInfo);1462 HGCMSvcSetPv (& paParms[5], rootListEntry.pvInfo, rootListEntry.cbInfo);1460 HGCMSvcSetPv (&aParms[3], rootListEntry.pszName, rootListEntry.cbName); 1461 HGCMSvcSetU32(&aParms[4], rootListEntry.cbInfo); 1462 HGCMSvcSetPv (&aParms[5], rootListEntry.pvInfo, rootListEntry.cbInfo); 1463 1463 } 1464 1464 } … … 1469 1469 { 1470 1470 SHCLROOTLISTENTRY lstEntry; 1471 rc = shClSvcTransferGetRootListEntry(cParms, paParms, &lstEntry);1471 rc = shClSvcTransferGetRootListEntry(cParms, aParms, &lstEntry); 1472 1472 if (RT_SUCCESS(rc)) 1473 1473 { … … 1492 1492 { 1493 1493 SHCLLISTOPENPARMS listOpenParms; 1494 rc = shClSvcTransferGetListOpen(cParms, paParms, &listOpenParms);1494 rc = shClSvcTransferGetListOpen(cParms, aParms, &listOpenParms); 1495 1495 if (RT_SUCCESS(rc)) 1496 1496 { … … 1500 1500 { 1501 1501 /* Return list handle. */ 1502 HGCMSvcSetU64(& paParms[6], hList);1502 HGCMSvcSetU64(&aParms[6], hList); 1503 1503 } 1504 1504 } … … 1512 1512 1513 1513 SHCLLISTHANDLE hList; 1514 rc = HGCMSvcGetU64(& paParms[1], &hList);1514 rc = HGCMSvcGetU64(&aParms[1], &hList); 1515 1515 if (RT_SUCCESS(rc)) 1516 1516 { … … 1526 1526 1527 1527 SHCLLISTHANDLE hList; 1528 rc = HGCMSvcGetU64(& paParms[1], &hList); /* Get list handle. */1528 rc = HGCMSvcGetU64(&aParms[1], &hList); /* Get list handle. */ 1529 1529 if (RT_SUCCESS(rc)) 1530 1530 { … … 1532 1532 rc = ShClTransferListGetHeader(pTransfer, hList, &hdrList); 1533 1533 if (RT_SUCCESS(rc)) 1534 rc = shClSvcTransferSetListHdr(cParms, paParms, &hdrList);1534 rc = shClSvcTransferSetListHdr(cParms, aParms, &hdrList); 1535 1535 } 1536 1536 break; … … 1544 1544 { 1545 1545 SHCLLISTHANDLE hList; 1546 rc = shClSvcTransferGetListHdr(cParms, paParms, &hList, &hdrList);1546 rc = shClSvcTransferGetListHdr(cParms, aParms, &hList, &hdrList); 1547 1547 if (RT_SUCCESS(rc)) 1548 1548 { … … 1571 1571 1572 1572 SHCLLISTHANDLE hList; 1573 rc = HGCMSvcGetU64(& paParms[1], &hList); /* Get list handle. */1573 rc = HGCMSvcGetU64(&aParms[1], &hList); /* Get list handle. */ 1574 1574 if (RT_SUCCESS(rc)) 1575 1575 { … … 1580 1580 rc = ShClTransferListRead(pTransfer, hList, &entryList); 1581 1581 if (RT_SUCCESS(rc)) 1582 rc = shClSvcTransferSetListEntry(cParms, paParms, &entryList);1582 rc = shClSvcTransferSetListEntry(cParms, aParms, &entryList); 1583 1583 } 1584 1584 } … … 1593 1593 { 1594 1594 SHCLLISTHANDLE hList; 1595 rc = shClSvcTransferGetListEntry(cParms, paParms, &hList, &entryList);1595 rc = shClSvcTransferGetListEntry(cParms, aParms, &hList, &entryList); 1596 1596 if (RT_SUCCESS(rc)) 1597 1597 { … … 1622 1622 1623 1623 uint32_t cbPath; 1624 rc = HGCMSvcGetU32(& paParms[2], &cbPath); /** @todo r=bird: This is an pointless parameter. */1624 rc = HGCMSvcGetU32(&aParms[2], &cbPath); /** @todo r=bird: This is an pointless parameter. */ 1625 1625 if (RT_SUCCESS(rc)) 1626 1626 { 1627 1627 /** @todo r=bird: This is the wrong way of getting a string! */ 1628 rc = HGCMSvcGetPv(& paParms[3], (void **)&openCreateParms.pszPath, &openCreateParms.cbPath);1628 rc = HGCMSvcGetPv(&aParms[3], (void **)&openCreateParms.pszPath, &openCreateParms.cbPath); 1629 1629 if (cbPath != openCreateParms.cbPath) 1630 1630 rc = VERR_INVALID_PARAMETER; 1631 1631 } 1632 1632 if (RT_SUCCESS(rc)) 1633 rc = HGCMSvcGetU32(& paParms[4], &openCreateParms.fCreate);1633 rc = HGCMSvcGetU32(&aParms[4], &openCreateParms.fCreate); 1634 1634 1635 1635 if (RT_SUCCESS(rc)) … … 1641 1641 LogFlowFunc(("hObj=%RU64\n", hObj)); 1642 1642 1643 HGCMSvcSetU64(& paParms[1], hObj);1643 HGCMSvcSetU64(&aParms[1], hObj); 1644 1644 } 1645 1645 } … … 1653 1653 1654 1654 SHCLOBJHANDLE hObj; 1655 rc = HGCMSvcGetU64(& paParms[1], &hObj); /* Get object handle. */1655 rc = HGCMSvcGetU64(&aParms[1], &hObj); /* Get object handle. */ 1656 1656 if (RT_SUCCESS(rc)) 1657 1657 rc = ShClTransferObjClose(pTransfer, hObj); … … 1665 1665 1666 1666 SHCLOBJHANDLE hObj; 1667 rc = HGCMSvcGetU64(& paParms[1], &hObj); /* Get object handle. */1667 rc = HGCMSvcGetU64(&aParms[1], &hObj); /* Get object handle. */ 1668 1668 1669 1669 uint32_t cbToRead = 0; 1670 1670 if (RT_SUCCESS(rc)) 1671 rc = HGCMSvcGetU32(& paParms[2], &cbToRead);1671 rc = HGCMSvcGetU32(&aParms[2], &cbToRead); 1672 1672 1673 1673 void *pvBuf = NULL; 1674 1674 uint32_t cbBuf = 0; 1675 1675 if (RT_SUCCESS(rc)) 1676 rc = HGCMSvcGetPv(& paParms[3], &pvBuf, &cbBuf);1676 rc = HGCMSvcGetPv(&aParms[3], &pvBuf, &cbBuf); 1677 1677 1678 1678 LogFlowFunc(("hObj=%RU64, cbBuf=%RU32, cbToRead=%RU32, rc=%Rrc\n", hObj, cbBuf, cbToRead, rc)); … … 1694 1694 if (RT_SUCCESS(rc)) 1695 1695 { 1696 HGCMSvcSetU32(& paParms[3], cbRead);1696 HGCMSvcSetU32(&aParms[3], cbRead); 1697 1697 1698 1698 /** @todo Implement checksum support. */ … … 1705 1705 { 1706 1706 SHCLOBJDATACHUNK dataChunk; 1707 rc = shClSvcTransferGetObjDataChunk(cParms, paParms, &dataChunk);1707 rc = shClSvcTransferGetObjDataChunk(cParms, aParms, &dataChunk); 1708 1708 if (RT_SUCCESS(rc)) 1709 1709 { … … 1741 1741 * @param u32Function Function number being called. 1742 1742 * @param cParms Number of function parameters supplied. 1743 * @param paParms Array function parameterssupplied.1743 * @param aParms Array function parameters supplied. 1744 1744 */ 1745 1745 int shClSvcTransferHostHandler(uint32_t u32Function, 1746 1746 uint32_t cParms, 1747 VBOXHGCMSVCPARM paParms[])1748 { 1749 RT_NOREF(cParms, paParms);1747 VBOXHGCMSVCPARM aParms[]) 1748 { 1749 RT_NOREF(cParms, aParms); 1750 1750 1751 1751 int rc = VERR_NOT_IMPLEMENTED; /* Play safe. */ … … 1977 1977 * @param uStatus Status to report. 1978 1978 * @param rcTransfer Result code to report. Optional and depending on status. 1979 * @param pidEvent 1979 * @param pidEvent Where to store the created wait event. Optional. 1980 1980 */ 1981 1981 int shClSvcTransferSendStatus(PSHCLCLIENT pClient, PSHCLTRANSFER pTransfer, SHCLTRANSFERSTATUS uStatus, … … 1993 1993 const SHCLEVENTID idEvent = ShClEventIDGenerate(&pTransfer->Events); 1994 1994 1995 HGCMSvcSetU64(&pMsgReadData-> paParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID,1996 1997 HGCMSvcSetU32(&pMsgReadData-> paParms[1], pTransfer->State.enmDir);1998 HGCMSvcSetU32(&pMsgReadData-> paParms[2], uStatus);1999 HGCMSvcSetU32(&pMsgReadData-> paParms[3], (uint32_t)rcTransfer); /** @todo uint32_t vs. int. */2000 HGCMSvcSetU32(&pMsgReadData-> paParms[4], 0 /* fFlags, unused */);1995 HGCMSvcSetU64(&pMsgReadData->aParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID, 1996 pTransfer->State.uID, idEvent)); 1997 HGCMSvcSetU32(&pMsgReadData->aParms[1], pTransfer->State.enmDir); 1998 HGCMSvcSetU32(&pMsgReadData->aParms[2], uStatus); 1999 HGCMSvcSetU32(&pMsgReadData->aParms[3], (uint32_t)rcTransfer); /** @todo uint32_t vs. int. */ 2000 HGCMSvcSetU32(&pMsgReadData->aParms[4], 0 /* fFlags, unused */); 2001 2001 2002 2002 int rc = shClSvcMsgAdd(pClient, pMsgReadData, true /* fAppend */);
Note:
See TracChangeset
for help on using the changeset viewer.