Changeset 26124 in vbox for trunk/src/VBox/Additions/common/VBoxGuestLib/HGCMInternal.cpp
- Timestamp:
- Feb 1, 2010 2:30:36 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuestLib/HGCMInternal.cpp
r23610 r26124 895 895 rc = vbglR0HGCMInternalCopyBackResult(pCallInfo, pHGCMCall, &ParmInfo, fIsUser, rc); 896 896 } 897 else 898 LogRel(("VbglR0HGCMInternalCall: vbglR0HGCMInternalDoCall failed. rc=%Rrc\n", rc)); 897 899 898 900 if (!fLeakIt) … … 900 902 } 901 903 } 904 else 905 LogRel(("VbglR0HGCMInternalCall: vbglR0HGCMInternalPreprocessCall failed. rc=%Rrc\n", rc)); 902 906 903 907 /* … … 921 925 PFNVBGLHGCMCALLBACK pfnAsyncCallback, void *pvAsyncData, uint32_t u32AsyncData) 922 926 { 923 VBoxGuestHGCMCallInfo *pCallInfo64 ;924 HGCMFunctionParameter *pParm64 ;925 HGCMFunctionParameter32 *pParm32 ;926 uint32_t cParms ;927 uint32_t iParm ;928 int rc;927 VBoxGuestHGCMCallInfo *pCallInfo64 = NULL; 928 HGCMFunctionParameter *pParm64 = NULL; 929 HGCMFunctionParameter32 *pParm32 = NULL; 930 uint32_t cParms = 0; 931 uint32_t iParm = 0; 932 int rc = VINF_SUCCESS; 929 933 930 934 /* … … 936 940 || !(fFlags & ~VBGLR0_HGCMCALL_F_MODE_MASK), 937 941 ("pCallInfo=%p pfnAsyncCallback=%p fFlags=%#x\n", pCallInfo, pfnAsyncCallback, fFlags), 938 VERR_INVALID_ PARAMETER);942 VERR_INVALID_HANDLE); 939 943 AssertReturn( cbCallInfo >= sizeof(VBoxGuestHGCMCallInfo) 940 944 || cbCallInfo >= pCallInfo->cParms * sizeof(HGCMFunctionParameter32), 941 VERR_INVALID_PARAMETER); 942 AssertReturn((fFlags & VBGLR0_HGCMCALL_F_MODE_MASK) == VBGLR0_HGCMCALL_F_KERNEL, VERR_INVALID_PARAMETER); 945 VERR_INVALID_MAGIC); 946 947 /* This Assert does not work on Solaris 64/32 mixed mode, not sure why, skipping for now */ 948 #ifndef RT_OS_SOLARIS 949 AssertReturn((fFlags & VBGLR0_HGCMCALL_F_MODE_MASK) == VBGLR0_HGCMCALL_F_KERNEL, VERR_WRONG_ORDER); 950 #endif 943 951 944 952 cParms = pCallInfo->cParms; … … 979 987 default: 980 988 rc = VERR_INVALID_PARAMETER; 989 LogRel(("VbglR0HGCMInternalCall32: pParm32 type %#x invalid.\n", pParm32->type)); 981 990 break; 982 991 } … … 989 998 pfnAsyncCallback, pvAsyncData, u32AsyncData); 990 999 991 /* 992 * Copy back. 993 */ 994 for (iParm = 0; iParm < cParms; iParm++, pParm32++, pParm64++) 1000 if (RT_SUCCESS(rc)) 995 1001 { 996 switch (pParm32->type) 1002 *pCallInfo = *pCallInfo64; 1003 1004 /* 1005 * Copy back. 1006 */ 1007 pParm32 = VBOXGUEST_HGCM_CALL_PARMS32(pCallInfo); 1008 pParm64 = VBOXGUEST_HGCM_CALL_PARMS(pCallInfo64); 1009 for (iParm = 0; iParm < cParms; iParm++, pParm32++, pParm64++) 997 1010 { 998 case VMMDevHGCMParmType_32bit: 999 pParm32->u.value32 = pParm32->u.value32; 1000 break; 1001 1002 case VMMDevHGCMParmType_64bit: 1003 pParm32->u.value64 = pParm64->u.value64; 1004 break; 1005 1006 case VMMDevHGCMParmType_LinAddr_Out: 1007 case VMMDevHGCMParmType_LinAddr: 1008 case VMMDevHGCMParmType_LinAddr_In: 1009 pParm32->u.Pointer.size = pParm64->u.Pointer.size; 1010 break; 1011 1012 default: 1013 rc = VERR_INTERNAL_ERROR_3; 1014 break; 1011 LogRel(("VbglR0HGCMInternalCall32: iParm=%d cParms=%d\n",iParm, cParms)); 1012 switch (pParm64->type) 1013 { 1014 case VMMDevHGCMParmType_32bit: 1015 LogRel(("pParm32->u.value32=%d\n", pParm32->u.value32)); 1016 pParm32->u.value32 = pParm64->u.value32; 1017 break; 1018 1019 case VMMDevHGCMParmType_64bit: 1020 pParm32->u.value64 = pParm64->u.value64; 1021 break; 1022 1023 case VMMDevHGCMParmType_LinAddr_Out: 1024 case VMMDevHGCMParmType_LinAddr: 1025 case VMMDevHGCMParmType_LinAddr_In: 1026 pParm32->u.Pointer.size = pParm64->u.Pointer.size; 1027 break; 1028 1029 default: 1030 LogRel(("VbglR0HGCMInternalCall32: failed invalid pParm32 type %d\n", pParm32->type)); 1031 rc = VERR_INTERNAL_ERROR_3; 1032 break; 1033 } 1015 1034 } 1016 1035 } 1017 *pCallInfo = *pCallInfo64; 1018 } 1036 else 1037 LogRel(("VbglR0HGCMInternalCall32: VbglR0HGCMInternalCall failed. rc=%Rrc\n", rc)); 1038 } 1039 else 1040 LogRel(("VbglR0HGCMInternalCall32: failed. rc=%Rrc\n", rc)); 1019 1041 1020 1042 RTMemTmpFree(pCallInfo64);
Note:
See TracChangeset
for help on using the changeset viewer.