Changeset 21456 in vbox for trunk/src/VBox/Additions/common/VBoxGuestLib
- Timestamp:
- Jul 9, 2009 8:09:23 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuestLib/HGCMInternal.cpp
r21268 r21456 122 122 123 123 /** @todo merge with the one below (use a header file). Too lazy now. */ 124 DECLR0VBGL(int) VbglR0HGCMInternalCall (VBoxGuestHGCMCallInfo *pCallInfo, uint32_t fFlags,124 DECLR0VBGL(int) VbglR0HGCMInternalCall (VBoxGuestHGCMCallInfo *pCallInfo, uint32_t cbCallInfo, uint32_t fFlags, 125 125 VBGLHGCMCALLBACK *pAsyncCallback, void *pvAsyncData, uint32_t u32AsyncData) 126 126 { … … 140 140 pHGCMCall = NULL; 141 141 142 cbParms = pCallInfo->cParms * sizeof (HGCMFunctionParameter); 142 if (cbCallInfo == 0) 143 { 144 /* Caller did not specify the size (a valid value should be at least sizeof(VBoxGuestHGCMCallInfo)). 145 * Compute the size. 146 */ 147 cbParms = pCallInfo->cParms * sizeof (HGCMFunctionParameter32); 148 } 149 else if (cbCallInfo < sizeof (VBoxGuestHGCMCallInfo)) 150 { 151 return VERR_INVALID_PARAMETER; 152 } 153 else 154 { 155 cbParms = cbCallInfo - sizeof (VBoxGuestHGCMCallInfo); 156 } 143 157 144 158 /* Allocate request */ … … 195 209 else 196 210 pParm->type = VMMDevHGCMParmType_LinAddr; 211 break; 212 213 case VMMDevHGCMParmType_PageList: 214 if ((fFlags & VBGLR0_HGCMCALL_F_MODE_MASK) == VBGLR0_HGCMCALL_F_USER) 215 rc = VERR_INVALID_PARAMETER; 197 216 break; 198 217 … … 307 326 # if ARCH_BITS == 64 308 327 /** @todo merge with the one above (use a header file). Too lazy now. */ 309 DECLR0VBGL(int) VbglR0HGCMInternalCall32 (VBoxGuestHGCMCallInfo *pCallInfo, uint32_t fFlags,328 DECLR0VBGL(int) VbglR0HGCMInternalCall32 (VBoxGuestHGCMCallInfo *pCallInfo, uint32_t cbCallInfo, uint32_t fFlags, 310 329 VBGLHGCMCALLBACK *pAsyncCallback, void *pvAsyncData, uint32_t u32AsyncData) 311 330 { … … 325 344 pHGCMCall = NULL; 326 345 327 cbParms = pCallInfo->cParms * sizeof (HGCMFunctionParameter32); 346 if (cbCallInfo == 0) 347 { 348 /* Caller did not specify the size (a valid value should be at least sizeof(VBoxGuestHGCMCallInfo)). 349 * Compute the size. 350 */ 351 cbParms = pCallInfo->cParms * sizeof (HGCMFunctionParameter32); 352 } 353 else if (cbCallInfo < sizeof (VBoxGuestHGCMCallInfo)) 354 { 355 return VERR_INVALID_PARAMETER; 356 } 357 else 358 { 359 cbParms = cbCallInfo - sizeof (VBoxGuestHGCMCallInfo); 360 } 328 361 329 362 /* Allocate request */ … … 380 413 else 381 414 pParm->type = VMMDevHGCMParmType_LinAddr; 415 break; 416 417 case VMMDevHGCMParmType_PageList: 418 if ((fFlags & VBGLR0_HGCMCALL_F_MODE_MASK) == VBGLR0_HGCMCALL_F_USER) 419 rc = VERR_INVALID_PARAMETER; 382 420 break; 383 421
Note:
See TracChangeset
for help on using the changeset viewer.