Changeset 25258 in vbox for trunk/src/VBox/HostDrivers/Support
- Timestamp:
- Dec 9, 2009 1:52:52 AM (15 years ago)
- Location:
- trunk/src/VBox/HostDrivers/Support
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPDrv.c
r25181 r25258 1288 1288 PSUPLDROPEN pReq = (PSUPLDROPEN)pReqHdr; 1289 1289 REQ_CHECK_SIZES(SUP_IOCTL_LDR_OPEN); 1290 REQ_CHECK_EXPR(SUP_IOCTL_LDR_OPEN, pReq->u.In.cbImage > 0); 1291 REQ_CHECK_EXPR(SUP_IOCTL_LDR_OPEN, pReq->u.In.cbImage < _1M*16); 1290 REQ_CHECK_EXPR(SUP_IOCTL_LDR_OPEN, pReq->u.In.cbImageWithTabs > 0); 1291 REQ_CHECK_EXPR(SUP_IOCTL_LDR_OPEN, pReq->u.In.cbImageWithTabs < 16*_1M); 1292 #ifdef SUPDRV_USE_NATIVE_LOADER 1293 REQ_CHECK_EXPR(SUP_IOCTL_LDR_OPEN, pReq->u.In.cbImageBits > 0); 1294 REQ_CHECK_EXPR(SUP_IOCTL_LDR_OPEN, pReq->u.In.cbImageBits > 0); 1295 REQ_CHECK_EXPR(SUP_IOCTL_LDR_OPEN, pReq->u.In.cbImageBits < pReq->u.In.cbImageWithTabs); 1296 #endif 1292 1297 REQ_CHECK_EXPR(SUP_IOCTL_LDR_OPEN, pReq->u.In.szName[0]); 1293 1298 REQ_CHECK_EXPR(SUP_IOCTL_LDR_OPEN, memchr(pReq->u.In.szName, '\0', sizeof(pReq->u.In.szName))); 1294 1299 REQ_CHECK_EXPR(SUP_IOCTL_LDR_OPEN, !supdrvCheckInvalidChar(pReq->u.In.szName, ";:()[]{}/\\|&*%#@!~`\"'")); 1300 #ifdef SUPDRV_USE_NATIVE_LOADER 1301 REQ_CHECK_EXPR(SUP_IOCTL_LDR_OPEN, memchr(pReq->u.In.szFilename, '\0', sizeof(pReq->u.In.szFilename))); 1302 #endif 1295 1303 1296 1304 /* execute */ … … 1304 1312 PSUPLDRLOAD pReq = (PSUPLDRLOAD)pReqHdr; 1305 1313 REQ_CHECK_EXPR(Name, pReq->Hdr.cbIn >= sizeof(*pReq)); 1306 REQ_CHECK_SIZES_EX(SUP_IOCTL_LDR_LOAD, SUP_IOCTL_LDR_LOAD_SIZE_IN(pReq->u.In.cbImage ), SUP_IOCTL_LDR_LOAD_SIZE_OUT);1314 REQ_CHECK_SIZES_EX(SUP_IOCTL_LDR_LOAD, SUP_IOCTL_LDR_LOAD_SIZE_IN(pReq->u.In.cbImageWithTabs), SUP_IOCTL_LDR_LOAD_SIZE_OUT); 1307 1315 REQ_CHECK_EXPR(SUP_IOCTL_LDR_LOAD, pReq->u.In.cSymbols <= 16384); 1308 1316 REQ_CHECK_EXPR_FMT( !pReq->u.In.cSymbols 1309 || ( pReq->u.In.offSymbols < pReq->u.In.cbImage 1310 && pReq->u.In.offSymbols + pReq->u.In.cSymbols * sizeof(SUPLDRSYM) <= pReq->u.In.cbImage ),1311 ("SUP_IOCTL_LDR_LOAD: offSymbols=%#lx cSymbols=%#lx cbImage =%#lx\n", (long)pReq->u.In.offSymbols,1312 (long)pReq->u.In.cSymbols, (long)pReq->u.In.cbImage ));1317 || ( pReq->u.In.offSymbols < pReq->u.In.cbImageWithTabs 1318 && pReq->u.In.offSymbols + pReq->u.In.cSymbols * sizeof(SUPLDRSYM) <= pReq->u.In.cbImageWithTabs), 1319 ("SUP_IOCTL_LDR_LOAD: offSymbols=%#lx cSymbols=%#lx cbImageWithTabs=%#lx\n", (long)pReq->u.In.offSymbols, 1320 (long)pReq->u.In.cSymbols, (long)pReq->u.In.cbImageWithTabs)); 1313 1321 REQ_CHECK_EXPR_FMT( !pReq->u.In.cbStrTab 1314 || ( pReq->u.In.offStrTab < pReq->u.In.cbImage 1315 && pReq->u.In.offStrTab + pReq->u.In.cbStrTab <= pReq->u.In.cbImage 1316 && pReq->u.In.cbStrTab <= pReq->u.In.cbImage ),1317 ("SUP_IOCTL_LDR_LOAD: offStrTab=%#lx cbStrTab=%#lx cbImage =%#lx\n", (long)pReq->u.In.offStrTab,1318 (long)pReq->u.In.cbStrTab, (long)pReq->u.In.cbImage ));1322 || ( pReq->u.In.offStrTab < pReq->u.In.cbImageWithTabs 1323 && pReq->u.In.offStrTab + pReq->u.In.cbStrTab <= pReq->u.In.cbImageWithTabs 1324 && pReq->u.In.cbStrTab <= pReq->u.In.cbImageWithTabs), 1325 ("SUP_IOCTL_LDR_LOAD: offStrTab=%#lx cbStrTab=%#lx cbImageWithTabs=%#lx\n", (long)pReq->u.In.offStrTab, 1326 (long)pReq->u.In.cbStrTab, (long)pReq->u.In.cbImageWithTabs)); 1319 1327 1320 1328 if (pReq->u.In.cSymbols) … … 1324 1332 for (i = 0; i < pReq->u.In.cSymbols; i++) 1325 1333 { 1326 REQ_CHECK_EXPR_FMT(paSyms[i].offSymbol < pReq->u.In.cbImage ,1327 ("SUP_IOCTL_LDR_LOAD: sym #%ld: symb off %#lx (max=%#lx)\n", (long)i, (long)paSyms[i].offSymbol, (long)pReq->u.In.cbImage ));1334 REQ_CHECK_EXPR_FMT(paSyms[i].offSymbol < pReq->u.In.cbImageWithTabs, 1335 ("SUP_IOCTL_LDR_LOAD: sym #%ld: symb off %#lx (max=%#lx)\n", (long)i, (long)paSyms[i].offSymbol, (long)pReq->u.In.cbImageWithTabs)); 1328 1336 REQ_CHECK_EXPR_FMT(paSyms[i].offName < pReq->u.In.cbStrTab, 1329 ("SUP_IOCTL_LDR_LOAD: sym #%ld: name off %#lx (max=%#lx)\n", (long)i, (long)paSyms[i].offName, (long)pReq->u.In.cbImage ));1337 ("SUP_IOCTL_LDR_LOAD: sym #%ld: name off %#lx (max=%#lx)\n", (long)i, (long)paSyms[i].offName, (long)pReq->u.In.cbImageWithTabs)); 1330 1338 REQ_CHECK_EXPR_FMT(memchr(&pReq->u.In.achImage[pReq->u.In.offStrTab + paSyms[i].offName], '\0', pReq->u.In.cbStrTab - paSyms[i].offName), 1331 ("SUP_IOCTL_LDR_LOAD: sym #%ld: unterminated name! (%#lx / %#lx)\n", (long)i, (long)paSyms[i].offName, (long)pReq->u.In.cbImage ));1339 ("SUP_IOCTL_LDR_LOAD: sym #%ld: unterminated name! (%#lx / %#lx)\n", (long)i, (long)paSyms[i].offName, (long)pReq->u.In.cbImageWithTabs)); 1332 1340 } 1333 1341 } … … 3428 3436 static int supdrvIOCtl_LdrOpen(PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSession, PSUPLDROPEN pReq) 3429 3437 { 3438 int rc; 3430 3439 PSUPDRVLDRIMAGE pImage; 3431 unsigned cb;3432 3440 void *pv; 3433 3441 size_t cchName = strlen(pReq->u.In.szName); /* (caller checked < 32). */ 3434 LogFlow(("supdrvIOCtl_LdrOpen: szName=%s cbImage =%d\n", pReq->u.In.szName, pReq->u.In.cbImage));3442 LogFlow(("supdrvIOCtl_LdrOpen: szName=%s cbImageWithTabs=%d\n", pReq->u.In.szName, pReq->u.In.cbImageWithTabs)); 3435 3443 3436 3444 /* … … 3443 3451 && !memcmp(pImage->szName, pReq->u.In.szName, cchName)) 3444 3452 { 3453 /** @todo check cbImageBits and cbImageWithTabs here, if they differs that indicates that the images are different. */ 3445 3454 pImage->cUsage++; 3446 3455 pReq->u.Out.pvImageBase = pImage->pvImage; … … 3456 3465 * Allocate memory. 3457 3466 */ 3458 cb = pReq->u.In.cbImage + sizeof(SUPDRVLDRIMAGE) + 31; 3459 pv = RTMemExecAlloc(cb); 3467 pv = RTMemAlloc(RT_OFFSETOF(SUPDRVLDRIMAGE, szName[cchName + 1])); 3460 3468 if (!pv) 3461 3469 { 3462 3470 RTSemFastMutexRelease(pDevExt->mtxLdr); 3463 Log(("supdrvIOCtl_LdrOpen: RTMem ExecAlloc(%u) failed\n", cb));3471 Log(("supdrvIOCtl_LdrOpen: RTMemAlloc() failed\n")); 3464 3472 return VERR_NO_MEMORY; 3465 3473 } … … 3469 3477 */ 3470 3478 pImage = (PSUPDRVLDRIMAGE)pv; 3471 pImage->pvImage = RT_ALIGN_P(pImage + 1, 32); 3472 pImage->cbImage = pReq->u.In.cbImage; 3479 pImage->pvImage = NULL; 3480 pImage->pvImageAlloc = NULL; 3481 pImage->cbImageWithTabs = pReq->u.In.cbImageWithTabs; 3482 #ifdef SUPDRV_USE_NATIVE_LOADER 3483 pImage->cbImageBits = pReq->u.In.cbImageBits; 3484 #else 3485 pImage->cbImageBits = pReq->u.In.cbImageWithTabs; 3486 #endif 3487 pImage->cSymbols = 0; 3488 pImage->paSymbols = NULL; 3489 pImage->pachStrTab = NULL; 3490 pImage->cbStrTab = 0; 3473 3491 pImage->pfnModuleInit = NULL; 3474 3492 pImage->pfnModuleTerm = NULL; … … 3478 3496 memcpy(pImage->szName, pReq->u.In.szName, cchName + 1); 3479 3497 3498 /* 3499 * Try load it using the native loader, if that isn't supported, fall back 3500 * on the older method. 3501 */ 3502 #ifdef SUPDRV_USE_NATIVE_LOADER 3503 pImage->fNative = true; 3504 rc = supdrvOSLdrOpen(pDevExt, pImage, pReq->u.In.szFilename); 3505 #else 3506 rc = VERR_NOT_SUPPORTED; 3507 #endif 3508 if (rc == VERR_NOT_SUPPORTED) 3509 { 3510 pImage->pvImageAlloc = RTMemExecAlloc(pImage->cbImageBits + 31); 3511 pImage->pvImage = RT_ALIGN_P(pImage->pvImageAlloc, 32); 3512 #ifdef SUPDRV_USE_NATIVE_LOADER 3513 pImage->fNative = false; 3514 #endif 3515 rc = pImage->pvImageAlloc ? VINF_SUCCESS : VERR_NO_MEMORY; 3516 } 3517 if (RT_FAILURE(rc)) 3518 { 3519 RTSemFastMutexRelease(pDevExt->mtxLdr); 3520 RTMemFree(pImage); 3521 Log(("supdrvIOCtl_LdrOpen(%s): failed - %Rrc\n", pReq->u.In.szName, rc)); 3522 return VERR_NO_MEMORY; 3523 } 3524 Assert(VALID_PTR(pImage->pvImage) || RT_FAILURE(rc)); 3525 3526 /* 3527 * Link it. 3528 */ 3480 3529 pImage->pNext = pDevExt->pLdrImages; 3481 3530 pDevExt->pLdrImages = pImage; … … 3495 3544 3496 3545 /** 3546 * Worker that validates a pointer to an image entrypoint. 3547 * 3548 * @returns IPRT status code. 3549 * @param pDevExt The device globals. 3550 * @param pImage The loader image. 3551 * @param pv The pointer into the image. 3552 * @param fMayBeNull Whether it may be NULL. 3553 * @param pszWhat What is this entrypoint? (for logging) 3554 * @param pbImageBits The image bits prepared by ring-3. 3555 * 3556 * @remarks Will leave the lock on failure. 3557 */ 3558 static int supdrvLdrValidatePointer(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, void *pv, 3559 bool fMayBeNull, const uint8_t *pbImageBits, const char *pszWhat) 3560 { 3561 if (!fMayBeNull || pv) 3562 { 3563 if ((uintptr_t)pv - (uintptr_t)pImage->pvImage >= pImage->cbImageBits) 3564 { 3565 RTSemFastMutexRelease(pDevExt->mtxLdr); 3566 Log(("Out of range (%p LB %#x): %s=%p\n", pImage->pvImage, pImage->cbImageBits, pszWhat, pv)); 3567 return VERR_INVALID_PARAMETER; 3568 } 3569 3570 #ifdef SUPDRV_USE_NATIVE_LOADER 3571 if (pImage->fNative) 3572 { 3573 int rc = supdrvOSLdrValidatePointer(pDevExt, pImage, pv, pbImageBits); 3574 if (RT_FAILURE(rc)) 3575 { 3576 RTSemFastMutexRelease(pDevExt->mtxLdr); 3577 Log(("Bad entry point address: %s=%p (rc=%Rrc)\n", pszWhat, pv, rc)); 3578 return rc; 3579 } 3580 } 3581 #endif 3582 } 3583 return VINF_SUCCESS; 3584 } 3585 3586 3587 /** 3497 3588 * Loads the image bits. 3498 3589 * … … 3509 3600 PSUPDRVLDRIMAGE pImage; 3510 3601 int rc; 3511 LogFlow(("supdrvIOCtl_LdrLoad: pvImageBase=%p cbImage =%d\n", pReq->u.In.pvImageBase, pReq->u.In.cbImage));3602 LogFlow(("supdrvIOCtl_LdrLoad: pvImageBase=%p cbImageWithBits=%d\n", pReq->u.In.pvImageBase, pReq->u.In.cbImageWithTabs)); 3512 3603 3513 3604 /* … … 3525 3616 } 3526 3617 pImage = pUsage->pImage; 3527 if (pImage->cbImage != pReq->u.In.cbImage) 3618 3619 /* 3620 * Validate input. 3621 */ 3622 #ifdef SUPDRV_USE_NATIVE_LOADER 3623 if ( pImage->cbImageWithTabs != pReq->u.In.cbImageWithTabs 3624 || pImage->cbImageBits != pReq->u.In.cbImageBits) 3625 #else 3626 if (pImage->cbImageWithTabs != pReq->u.In.cbImageWithTabs) 3627 #endif 3528 3628 { 3529 3629 RTSemFastMutexRelease(pDevExt->mtxLdr); 3530 Log(("SUP_IOCTL_LDR_LOAD: image size mismatch!! %d(prep) != %d(load)\n", pImage->cbImage, pReq->u.In.cbImage)); 3630 #ifdef SUPDRV_USE_NATIVE_LOADER 3631 Log(("SUP_IOCTL_LDR_LOAD: image size mismatch!! %d(prep) != %d(load) or %d != %d\n", 3632 pImage->cbImageWithTabs, pReq->u.In.cbImageWithTabs, pImage->cbImageBits, pReq->u.In.cbImageBits)); 3633 #else 3634 Log(("SUP_IOCTL_LDR_LOAD: image size mismatch!! %d(prep) != %d(load)\n", pImage->cbImageWithTabs, pReq->u.In.cbImageWithTabs)); 3635 #endif 3531 3636 return VERR_INVALID_HANDLE; 3532 3637 } 3638 3533 3639 if (pImage->uState != SUP_IOCTL_LDR_OPEN) 3534 3640 { … … 3539 3645 return SUPDRV_ERR_ALREADY_LOADED; 3540 3646 } 3647 3541 3648 switch (pReq->u.In.eEPType) 3542 3649 { … … 3545 3652 3546 3653 case SUPLDRLOADEP_VMMR0: 3547 if ( !pReq->u.In.EP.VMMR0.pvVMMR0 3548 || !pReq->u.In.EP.VMMR0.pvVMMR0EntryInt 3549 || !pReq->u.In.EP.VMMR0.pvVMMR0EntryFast 3550 || !pReq->u.In.EP.VMMR0.pvVMMR0EntryEx) 3551 { 3552 RTSemFastMutexRelease(pDevExt->mtxLdr); 3553 Log(("NULL pointer: pvVMMR0=%p pvVMMR0EntryInt=%p pvVMMR0EntryFast=%p pvVMMR0EntryEx=%p!\n", 3554 pReq->u.In.EP.VMMR0.pvVMMR0, pReq->u.In.EP.VMMR0.pvVMMR0EntryInt, 3555 pReq->u.In.EP.VMMR0.pvVMMR0EntryFast, pReq->u.In.EP.VMMR0.pvVMMR0EntryEx)); 3556 return VERR_INVALID_PARAMETER; 3557 } 3558 /** @todo validate pReq->u.In.EP.VMMR0.pvVMMR0 against pvImage! */ 3559 if ( (uintptr_t)pReq->u.In.EP.VMMR0.pvVMMR0EntryInt - (uintptr_t)pImage->pvImage >= pReq->u.In.cbImage 3560 || (uintptr_t)pReq->u.In.EP.VMMR0.pvVMMR0EntryFast - (uintptr_t)pImage->pvImage >= pReq->u.In.cbImage 3561 || (uintptr_t)pReq->u.In.EP.VMMR0.pvVMMR0EntryEx - (uintptr_t)pImage->pvImage >= pReq->u.In.cbImage) 3562 { 3563 RTSemFastMutexRelease(pDevExt->mtxLdr); 3564 Log(("Out of range (%p LB %#x): pvVMMR0EntryInt=%p, pvVMMR0EntryFast=%p or pvVMMR0EntryEx=%p is NULL!\n", 3565 pImage->pvImage, pReq->u.In.cbImage, pReq->u.In.EP.VMMR0.pvVMMR0EntryInt, 3566 pReq->u.In.EP.VMMR0.pvVMMR0EntryFast, pReq->u.In.EP.VMMR0.pvVMMR0EntryEx)); 3567 return VERR_INVALID_PARAMETER; 3568 } 3654 rc = supdrvLdrValidatePointer( pDevExt, pImage, pReq->u.In.EP.VMMR0.pvVMMR0, false, pReq->u.In.achImage, "pvVMMR0"); 3655 if (RT_SUCCESS(rc)) 3656 rc = supdrvLdrValidatePointer(pDevExt, pImage, pReq->u.In.EP.VMMR0.pvVMMR0EntryInt, false, pReq->u.In.achImage, "pvVMMR0EntryInt"); 3657 if (RT_SUCCESS(rc)) 3658 rc = supdrvLdrValidatePointer(pDevExt, pImage, pReq->u.In.EP.VMMR0.pvVMMR0EntryFast, false, pReq->u.In.achImage, "pvVMMR0EntryFast"); 3659 if (RT_SUCCESS(rc)) 3660 rc = supdrvLdrValidatePointer(pDevExt, pImage, pReq->u.In.EP.VMMR0.pvVMMR0EntryEx, false, pReq->u.In.achImage, "pvVMMR0EntryEx"); 3661 if (RT_FAILURE(rc)) 3662 return rc; 3569 3663 break; 3570 3664 3571 3665 case SUPLDRLOADEP_SERVICE: 3572 if (!pReq->u.In.EP.Service.pfnServiceReq) 3573 { 3574 RTSemFastMutexRelease(pDevExt->mtxLdr); 3575 Log(("NULL pointer: pfnServiceReq=%p!\n", pReq->u.In.EP.Service.pfnServiceReq)); 3576 return VERR_INVALID_PARAMETER; 3577 } 3578 if ((uintptr_t)pReq->u.In.EP.Service.pfnServiceReq - (uintptr_t)pImage->pvImage >= pReq->u.In.cbImage) 3579 { 3580 RTSemFastMutexRelease(pDevExt->mtxLdr); 3581 Log(("Out of range (%p LB %#x): pfnServiceReq=%p, pvVMMR0EntryFast=%p or pvVMMR0EntryEx=%p is NULL!\n", 3582 pImage->pvImage, pReq->u.In.cbImage, pReq->u.In.EP.Service.pfnServiceReq)); 3583 return VERR_INVALID_PARAMETER; 3584 } 3666 rc = supdrvLdrValidatePointer(pDevExt, pImage, pReq->u.In.EP.Service.pfnServiceReq, false, pReq->u.In.achImage, "pfnServiceReq"); 3667 if (RT_FAILURE(rc)) 3668 return rc; 3585 3669 if ( pReq->u.In.EP.Service.apvReserved[0] != NIL_RTR0PTR 3586 3670 || pReq->u.In.EP.Service.apvReserved[1] != NIL_RTR0PTR … … 3589 3673 RTSemFastMutexRelease(pDevExt->mtxLdr); 3590 3674 Log(("Out of range (%p LB %#x): apvReserved={%p,%p,%p} MBZ!\n", 3591 pImage->pvImage, pReq->u.In.cbImage ,3675 pImage->pvImage, pReq->u.In.cbImageWithTabs, 3592 3676 pReq->u.In.EP.Service.apvReserved[0], 3593 3677 pReq->u.In.EP.Service.apvReserved[1], … … 3602 3686 return VERR_INVALID_PARAMETER; 3603 3687 } 3604 if ( pReq->u.In.pfnModuleInit 3605 && (uintptr_t)pReq->u.In.pfnModuleInit - (uintptr_t)pImage->pvImage >= pReq->u.In.cbImage) 3606 { 3607 RTSemFastMutexRelease(pDevExt->mtxLdr); 3608 Log(("SUP_IOCTL_LDR_LOAD: pfnModuleInit=%p is outside the image (%p %d bytes)\n", 3609 pReq->u.In.pfnModuleInit, pImage->pvImage, pReq->u.In.cbImage)); 3610 return VERR_INVALID_PARAMETER; 3611 } 3612 if ( pReq->u.In.pfnModuleTerm 3613 && (uintptr_t)pReq->u.In.pfnModuleTerm - (uintptr_t)pImage->pvImage >= pReq->u.In.cbImage) 3614 { 3615 RTSemFastMutexRelease(pDevExt->mtxLdr); 3616 Log(("SUP_IOCTL_LDR_LOAD: pfnModuleTerm=%p is outside the image (%p %d bytes)\n", 3617 pReq->u.In.pfnModuleTerm, pImage->pvImage, pReq->u.In.cbImage)); 3618 return VERR_INVALID_PARAMETER; 3619 } 3620 3621 /* 3622 * Copy the memory. 3623 */ 3624 /* no need to do try/except as this is a buffered request. */ 3625 memcpy(pImage->pvImage, &pReq->u.In.achImage[0], pImage->cbImage); 3626 pImage->uState = SUP_IOCTL_LDR_LOAD; 3627 pImage->pfnModuleInit = pReq->u.In.pfnModuleInit; 3628 pImage->pfnModuleTerm = pReq->u.In.pfnModuleTerm; 3629 pImage->offSymbols = pReq->u.In.offSymbols; 3630 pImage->cSymbols = pReq->u.In.cSymbols; 3631 pImage->offStrTab = pReq->u.In.offStrTab; 3632 pImage->cbStrTab = pReq->u.In.cbStrTab; 3688 3689 rc = supdrvLdrValidatePointer(pDevExt, pImage, pReq->u.In.pfnModuleInit, true, pReq->u.In.achImage, "pfnModuleInit"); 3690 if (RT_FAILURE(rc)) 3691 return rc; 3692 rc = supdrvLdrValidatePointer(pDevExt, pImage, pReq->u.In.pfnModuleTerm, true, pReq->u.In.achImage, "pfnModuleTerm"); 3693 if (RT_FAILURE(rc)) 3694 return rc; 3695 3696 /* 3697 * Allocate and copy the tables. 3698 * (No need to do try/except as this is a buffered request.) 3699 */ 3700 pImage->cbStrTab = pReq->u.In.cbStrTab; 3701 if (pImage->cbStrTab) 3702 { 3703 pImage->pachStrTab = (char *)RTMemAlloc(pImage->cbStrTab); 3704 if (pImage->pachStrTab) 3705 memcpy(pImage->pachStrTab, &pReq->u.In.achImage[pReq->u.In.offStrTab], pImage->cbStrTab); 3706 else 3707 rc = VERR_NO_MEMORY; 3708 } 3709 3710 pImage->cSymbols = pReq->u.In.cSymbols; 3711 if (RT_SUCCESS(rc) && pImage->cSymbols) 3712 { 3713 size_t cbSymbols = pImage->cSymbols * sizeof(SUPLDRSYM); 3714 pImage->paSymbols = (PSUPLDRSYM)RTMemAlloc(cbSymbols); 3715 if (pImage->paSymbols) 3716 memcpy(pImage->paSymbols, &pReq->u.In.achImage[pReq->u.In.offSymbols], cbSymbols); 3717 else 3718 rc = VERR_NO_MEMORY; 3719 } 3720 3721 /* 3722 * Copy the bits / complete native loading. 3723 */ 3724 if (RT_SUCCESS(rc)) 3725 { 3726 pImage->uState = SUP_IOCTL_LDR_LOAD; 3727 pImage->pfnModuleInit = pReq->u.In.pfnModuleInit; 3728 pImage->pfnModuleTerm = pReq->u.In.pfnModuleTerm; 3729 3730 #ifdef SUPDRV_USE_NATIVE_LOADER 3731 if (pImage->fNative) 3732 rc = supdrvOSLdrLoad(pDevExt, pImage, pReq->u.In.achImage); 3733 else 3734 #endif 3735 memcpy(pImage->pvImage, &pReq->u.In.achImage[0], pImage->cbImageBits); 3736 } 3633 3737 3634 3738 /* 3635 3739 * Update any entry points. 3636 3740 */ 3637 switch (pReq->u.In.eEPType) 3638 { 3639 default: 3640 case SUPLDRLOADEP_NOTHING: 3641 rc = VINF_SUCCESS; 3642 break; 3643 case SUPLDRLOADEP_VMMR0: 3644 rc = supdrvLdrSetVMMR0EPs(pDevExt, pReq->u.In.EP.VMMR0.pvVMMR0, pReq->u.In.EP.VMMR0.pvVMMR0EntryInt, 3645 pReq->u.In.EP.VMMR0.pvVMMR0EntryFast, pReq->u.In.EP.VMMR0.pvVMMR0EntryEx); 3646 break; 3647 case SUPLDRLOADEP_SERVICE: 3648 pImage->pfnServiceReqHandler = pReq->u.In.EP.Service.pfnServiceReq; 3649 rc = VINF_SUCCESS; 3650 break; 3741 if (RT_SUCCESS(rc)) 3742 { 3743 switch (pReq->u.In.eEPType) 3744 { 3745 default: 3746 case SUPLDRLOADEP_NOTHING: 3747 rc = VINF_SUCCESS; 3748 break; 3749 case SUPLDRLOADEP_VMMR0: 3750 rc = supdrvLdrSetVMMR0EPs(pDevExt, pReq->u.In.EP.VMMR0.pvVMMR0, pReq->u.In.EP.VMMR0.pvVMMR0EntryInt, 3751 pReq->u.In.EP.VMMR0.pvVMMR0EntryFast, pReq->u.In.EP.VMMR0.pvVMMR0EntryEx); 3752 break; 3753 case SUPLDRLOADEP_SERVICE: 3754 pImage->pfnServiceReqHandler = pReq->u.In.EP.Service.pfnServiceReq; 3755 rc = VINF_SUCCESS; 3756 break; 3757 } 3651 3758 } 3652 3759 … … 3667 3774 } 3668 3775 3669 if (rc) 3670 pImage->uState = SUP_IOCTL_LDR_OPEN; 3776 if (RT_FAILURE(rc)) 3777 { 3778 pImage->uState = SUP_IOCTL_LDR_OPEN; 3779 pImage->pfnModuleInit = NULL; 3780 pImage->pfnModuleTerm = NULL; 3781 pImage->pfnServiceReqHandler= NULL; 3782 pImage->cbStrTab = 0; 3783 RTMemFree(pImage->pachStrTab); 3784 pImage->pachStrTab = NULL; 3785 RTMemFree(pImage->paSymbols); 3786 pImage->paSymbols = NULL; 3787 pImage->cSymbols = 0; 3788 } 3671 3789 3672 3790 RTSemFastMutexRelease(pDevExt->mtxLdr); … … 3727 3845 PSUPDRVOBJ pObj; 3728 3846 for (pObj = pDevExt->pObjs; pObj; pObj = pObj->pNext) 3729 if (RT_UNLIKELY((uintptr_t)pObj->pfnDestructor - (uintptr_t)pImage->pvImage < pImage->cbImage ))3847 if (RT_UNLIKELY((uintptr_t)pObj->pfnDestructor - (uintptr_t)pImage->pvImage < pImage->cbImageBits)) 3730 3848 { 3731 3849 rc = VERR_DANGLING_OBJECTS; … … 3737 3855 PSUPDRVUSAGE pGenUsage; 3738 3856 for (pGenUsage = pSession->pUsage; pGenUsage; pGenUsage = pGenUsage->pNext) 3739 if (RT_UNLIKELY((uintptr_t)pGenUsage->pObj->pfnDestructor - (uintptr_t)pImage->pvImage < pImage->cbImage ))3857 if (RT_UNLIKELY((uintptr_t)pGenUsage->pObj->pfnDestructor - (uintptr_t)pImage->pvImage < pImage->cbImageBits)) 3740 3858 { 3741 3859 rc = VERR_DANGLING_OBJECTS; … … 3758 3876 3759 3877 /* 3760 * Deref rence the image.3878 * Dereference the image. 3761 3879 */ 3762 3880 if (pImage->cUsage <= 1) … … 3831 3949 * Search the symbol strings. 3832 3950 */ 3833 pchStrings = (const char *)((uint8_t *)pImage->pvImage + pImage->offStrTab);3834 paSyms = (PSUPLDRSYM)((uint8_t *)pImage->pvImage + pImage->offSymbols);3951 pchStrings = pImage->pachStrTab; 3952 paSyms = pImage->paSymbols; 3835 3953 for (i = 0; i < pImage->cSymbols; i++) 3836 3954 { 3837 if ( paSyms[i].offSymbol < pImage->cbImage /* paranoia */3955 if ( paSyms[i].offSymbol < pImage->cbImageBits /* paranoia */ 3838 3956 && paSyms[i].offName + cbSymbol <= pImage->cbStrTab 3839 3957 && !memcmp(pchStrings + paSyms[i].offName, pReq->u.In.szSymbol, cbSymbol)) … … 3915 4033 * Search the symbol strings. 3916 4034 */ 3917 const char *pchStrings = (const char *)((uint8_t *)pImage->pvImage + pImage->offStrTab);3918 PCSUPLDRSYM paSyms = (PCSUPLDRSYM)((uint8_t *)pImage->pvImage + pImage->offSymbols);4035 const char *pchStrings = pImage->pachStrTab; 4036 PCSUPLDRSYM paSyms = pImage->paSymbols; 3919 4037 for (i = 0; i < pImage->cSymbols; i++) 3920 4038 { 3921 if ( paSyms[i].offSymbol < pImage->cbImage /* paranoia */4039 if ( paSyms[i].offSymbol < pImage->cbImageBits /* paranoia */ 3922 4040 && paSyms[i].offName + cbSymbol <= pImage->cbStrTab 3923 4041 && !memcmp(pchStrings + paSyms[i].offName, pszSymbol, cbSymbol)) … … 4084 4202 RTSpinlockAcquire(pDevExt->Spinlock, &SpinlockTmp); 4085 4203 for (pObj = pDevExt->pObjs; pObj; pObj = pObj->pNext) 4086 if (RT_UNLIKELY((uintptr_t)pObj->pfnDestructor - (uintptr_t)pImage->pvImage < pImage->cbImage ))4204 if (RT_UNLIKELY((uintptr_t)pObj->pfnDestructor - (uintptr_t)pImage->pvImage < pImage->cbImageBits)) 4087 4205 { 4088 4206 pObj->pfnDestructor = NULL; … … 4106 4224 } 4107 4225 4226 #ifdef SUPDRV_USE_NATIVE_LOADER 4227 /* do native unload if appropriate. */ 4228 if (pImage->fNative) 4229 supdrvOSLdrUnload(pDevExt, pImage); 4230 #endif 4231 4108 4232 /* free the image */ 4109 4233 pImage->cUsage = 0; 4110 4234 pImage->pNext = 0; 4111 4235 pImage->uState = SUP_IOCTL_LDR_FREE; 4112 RTMemExecFree(pImage); 4236 RTMemExecFree(pImage->pvImageAlloc); 4237 pImage->pvImageAlloc = NULL; 4238 RTMemFree(pImage->pachStrTab); 4239 pImage->pachStrTab = NULL; 4240 RTMemFree(pImage->paSymbols); 4241 pImage->paSymbols = NULL; 4242 RTMemFree(pImage); 4113 4243 } 4114 4244 -
trunk/src/VBox/HostDrivers/Support/SUPDrvIOC.h
r24498 r25258 31 31 #ifndef ___SUPDrvIOC_h___ 32 32 #define ___SUPDrvIOC_h___ 33 34 /*#define SUPDRV_USE_NATIVE_LOADER*/ 33 35 34 36 /* … … 200 202 * next major version used on the trunk will be 0x00120000! 201 203 */ 204 #ifdef SUPDRV_USE_NATIVE_LOADER 205 #define SUPDRV_IOC_VERSION 0x00120000 206 #else 202 207 #define SUPDRV_IOC_VERSION 0x00100001 208 #endif 203 209 204 210 /** SUP_IOCTL_COOKIE. */ … … 292 298 struct 293 299 { 294 /** Size of the image we'll be loading. */ 295 uint32_t cbImage; 300 /** Size of the image we'll be loading (includeing tables). */ 301 uint32_t cbImageWithTabs; 302 #ifdef SUPDRV_USE_NATIVE_LOADER 303 /** The size of the image bits. (Less or equal to cbImageWithTabs.) */ 304 uint32_t cbImageBits; 305 #endif 296 306 /** Image name. 297 307 * This is the NAME of the image, not the file name. It is used 298 308 * to share code with other processes. (Max len is 32 chars!) */ 299 309 char szName[32]; 310 #ifdef SUPDRV_USE_NATIVE_LOADER 311 /** Image file name. 312 * This can be used to load the image using a native loader. */ 313 char szFilename[196]; 314 #endif 300 315 } In; 301 316 struct … … 406 421 /** Entry point type. */ 407 422 SUPLDRLOADEP eEPType; 423 #ifdef SUPDRV_USE_NATIVE_LOADER 424 /** The size of the image bits (starting at offset 0 and 425 * approaching offSymbols). */ 426 uint32_t cbImageBits; 427 #endif 408 428 /** The offset of the symbol table. */ 409 429 uint32_t offSymbols; … … 414 434 /** Size of the string table. */ 415 435 uint32_t cbStrTab; 416 /** Size of image (including string and symbol tables). */417 uint32_t cbImage ;436 /** Size of image data in achImage. */ 437 uint32_t cbImageWithTabs; 418 438 /** The image data. */ 419 439 char achImage[1]; -
trunk/src/VBox/HostDrivers/Support/SUPDrvInternal.h
r23726 r25258 401 401 /** Pointer to the image. */ 402 402 void *pvImage; 403 /** Pointer to the allocated image buffer. 404 * pvImage is 32-byte aligned or it may governed by the native loader (this 405 * member is NULL then). */ 406 void *pvImageAlloc; 407 /** Size of the image including the tables. This is mainly for verification 408 * of the load request. */ 409 uint32_t cbImageWithTabs; 410 /** Size of the image. */ 411 uint32_t cbImageBits; 412 /** The number of entries in the symbol table. */ 413 uint32_t cSymbols; 414 /** Pointer to the symbol table. */ 415 PSUPLDRSYM paSymbols; 416 /** The offset of the string table. */ 417 char *pachStrTab; 418 /** Size of the string table. */ 419 uint32_t cbStrTab; 403 420 /** Pointer to the optional module initialization callback. */ 404 421 PFNR0MODULEINIT pfnModuleInit; … … 407 424 /** Service request handler. This is NULL for non-service modules. */ 408 425 PFNSUPR0SERVICEREQHANDLER pfnServiceReqHandler; 409 /** Size of the image. */410 uint32_t cbImage;411 /** The offset of the symbol table. */412 uint32_t offSymbols;413 /** The number of entries in the symbol table. */414 uint32_t cSymbols;415 /** The offset of the string table. */416 uint32_t offStrTab;417 /** Size of the string table. */418 uint32_t cbStrTab;419 426 /** The ldr image state. (IOCtl code of last opration.) */ 420 427 uint32_t uState; 421 428 /** Usage count. */ 422 429 uint32_t volatile cUsage; 430 #ifdef SUPDRV_USE_NATIVE_LOADER 431 /** Whether it's loaded by the native loader or not. */ 432 bool fNative; 433 #endif 423 434 /** Image name. */ 424 435 char szName[32]; … … 651 662 int VBOXCALL supdrvOSEnableVTx(bool fEnabled); 652 663 664 #ifdef SUPDRV_USE_NATIVE_LOADER 665 666 /** 667 * Try open the image using the native loader. 668 * 669 * @returns IPRT status code. 670 * @retval VERR_NOT_SUPPORTED if native loading isn't supported. 671 * 672 * @param pDevExt The device globals. 673 * @param pImage The image handle. pvImage should be set on 674 * success, pvImageAlloc can also be set if 675 * appropriate. 676 * @param pszFilename The file name - UTF-8, may containg UNIX 677 * slashes on non-UNIX systems. 678 */ 679 int VBOXCALL supdrvOSLdrOpen(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const char *pszFilename); 680 681 /** 682 * Validates an entry point address. 683 * 684 * Called before supdrvOSLdrLoad. 685 * 686 * @returns IPRT status code. 687 * @param pDevExt The device globals. 688 * @param pImage The image data (still in the open state). 689 * @param pv The address within the image. 690 * @param pbImageBits The image bits as loaded by ring-3. 691 */ 692 int VBOXCALL supdrvOSLdrValidatePointer(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, 693 void *pv, const uint8_t *pbImageBits); 694 695 /** 696 * Load the image. 697 * 698 * @returns IPRT status code. 699 * @param pDevExt The device globals. 700 * @param pImage The image data (up to date except for some 701 * entry point pointers). 702 * @param pbImageBits The image bits as loaded by ring-3. 703 */ 704 int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits); 705 706 707 /** 708 * Unload the image. 709 * 710 * @param pDevExt The device globals. 711 * @param pImage The image data (mostly still valid). 712 */ 713 void VBOXCALL supdrvOSLdrUnload(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage); 714 715 #endif /* SUPDRV_USE_NATIVE_LOADER */ 653 716 654 717 /******************************************************************************* -
trunk/src/VBox/HostDrivers/Support/SUPLib.cpp
r23725 r25258 272 272 strcpy(CookieReq.u.In.szMagic, SUPCOOKIE_MAGIC); 273 273 CookieReq.u.In.u32ReqVersion = SUPDRV_IOC_VERSION; 274 const uint32_t uMinVersion = (SUPDRV_IOC_VERSION & 0xffff0000) == 0x00100001 275 ? 0x00100001 274 #ifdef SUPDRV_USE_NATIVE_LOADER 275 const uint32_t uMinVersion = (SUPDRV_IOC_VERSION & 0xffff0000) == 0x00120000 276 ? 0x00120000 276 277 : SUPDRV_IOC_VERSION & 0xffff0000; 278 #else 279 const uint32_t uMinVersion = (SUPDRV_IOC_VERSION & 0xffff0000) == 0x00100001 280 ? 0x00100001 281 : SUPDRV_IOC_VERSION & 0xffff0000; 282 #endif 277 283 CookieReq.u.In.u32MinVersion = uMinVersion; 278 284 rc = suplibOsIOCtl(&g_supLibData, SUP_IOCTL_COOKIE, &CookieReq, SUP_IOCTL_COOKIE_SIZE); … … 1644 1650 static int supLoadModule(const char *pszFilename, const char *pszModule, const char *pszSrvReqHandler, void **ppvImageBase) 1645 1651 { 1652 int rc; 1653 1646 1654 /* 1647 1655 * Validate input. … … 1651 1659 AssertPtrReturn(ppvImageBase, VERR_INVALID_PARAMETER); 1652 1660 AssertReturn(strlen(pszModule) < RT_SIZEOFMEMB(SUPLDROPEN, u.In.szName), VERR_FILENAME_TOO_LONG); 1661 #ifdef SUPDRV_USE_NATIVE_LOADER 1662 char szAbsFilename[RT_SIZEOFMEMB(SUPLDROPEN, u.In.szFilename)]; 1663 rc = RTPathAbs(pszFilename, szAbsFilename, sizeof(szAbsFilename)); 1664 if (RT_FAILURE(rc)) 1665 return rc; 1666 pszFilename = szAbsFilename; 1667 #endif 1653 1668 1654 1669 const bool fIsVMMR0 = !strcmp(pszModule, "VMMR0.r0"); … … 1660 1675 */ 1661 1676 RTLDRMOD hLdrMod; 1662 intrc = RTLdrOpen(pszFilename, 0, RTLDRARCH_HOST, &hLdrMod);1677 rc = RTLdrOpen(pszFilename, 0, RTLDRARCH_HOST, &hLdrMod); 1663 1678 if (!RT_SUCCESS(rc)) 1664 1679 return rc; … … 1673 1688 const uint32_t offSymTab = RT_ALIGN_32(CalcArgs.cbImage, 8); 1674 1689 const uint32_t offStrTab = offSymTab + CalcArgs.cSymbols * sizeof(SUPLDRSYM); 1675 const uint32_t cbImage 1690 const uint32_t cbImageWithTabs = RT_ALIGN_32(offStrTab + CalcArgs.cbStrings, 8); 1676 1691 1677 1692 /* … … 1685 1700 OpenReq.Hdr.fFlags = SUPREQHDR_FLAGS_DEFAULT; 1686 1701 OpenReq.Hdr.rc = VERR_INTERNAL_ERROR; 1687 OpenReq.u.In.cbImage = cbImage; 1702 OpenReq.u.In.cbImageWithTabs = cbImageWithTabs; 1703 #ifdef SUPDRV_USE_NATIVE_LOADER 1704 OpenReq.u.In.cbImageBits = (uint32_t)CalcArgs.cbImage; 1705 #endif 1688 1706 strcpy(OpenReq.u.In.szName, pszModule); 1707 #ifdef SUPDRV_USE_NATIVE_LOADER 1708 strcpy(OpenReq.u.In.szFilename, pszFilename); 1709 #endif 1689 1710 if (!g_u32FakeMode) 1690 1711 { … … 1706 1727 * Allocate memory for the image bits. 1707 1728 */ 1708 PSUPLDRLOAD pLoadReq = (PSUPLDRLOAD)RTMemTmpAlloc(SUP_IOCTL_LDR_LOAD_SIZE(cbImage ));1729 PSUPLDRLOAD pLoadReq = (PSUPLDRLOAD)RTMemTmpAlloc(SUP_IOCTL_LDR_LOAD_SIZE(cbImageWithTabs)); 1709 1730 if (pLoadReq) 1710 1731 { … … 1767 1788 pLoadReq->Hdr.u32Cookie = g_u32Cookie; 1768 1789 pLoadReq->Hdr.u32SessionCookie = g_u32SessionCookie; 1769 pLoadReq->Hdr.cbIn = SUP_IOCTL_LDR_LOAD_SIZE_IN(cbImage );1790 pLoadReq->Hdr.cbIn = SUP_IOCTL_LDR_LOAD_SIZE_IN(cbImageWithTabs); 1770 1791 pLoadReq->Hdr.cbOut = SUP_IOCTL_LDR_LOAD_SIZE_OUT; 1771 1792 pLoadReq->Hdr.fFlags = SUPREQHDR_FLAGS_MAGIC | SUPREQHDR_FLAGS_EXTRA_IN; … … 1795 1816 pLoadReq->u.In.cbStrTab = (uint32_t)CalcArgs.cbStrings; 1796 1817 AssertRelease(pLoadReq->u.In.cbStrTab == CalcArgs.cbStrings); 1818 #ifdef SUPDRV_USE_NATIVE_LOADER 1819 pLoadReq->u.In.cbImageBits = (uint32_t)CalcArgs.cbImage; 1820 #endif 1797 1821 pLoadReq->u.In.offSymbols = offSymTab; 1798 1822 pLoadReq->u.In.cSymbols = CalcArgs.cSymbols; 1799 pLoadReq->u.In.cbImage = cbImage;1823 pLoadReq->u.In.cbImageWithTabs = cbImageWithTabs; 1800 1824 pLoadReq->u.In.pvImageBase = OpenReq.u.Out.pvImageBase; 1801 1825 if (!g_u32FakeMode) 1802 1826 { 1803 rc = suplibOsIOCtl(&g_supLibData, SUP_IOCTL_LDR_LOAD, pLoadReq, SUP_IOCTL_LDR_LOAD_SIZE(cbImage ));1827 rc = suplibOsIOCtl(&g_supLibData, SUP_IOCTL_LDR_LOAD, pLoadReq, SUP_IOCTL_LDR_LOAD_SIZE(cbImageWithTabs)); 1804 1828 if (RT_SUCCESS(rc)) 1805 1829 rc = pLoadReq->Hdr.rc; … … 1834 1858 else 1835 1859 { 1836 AssertMsgFailed(("failed to allocated % d bytes for SUPLDRLOAD_IN structure!\n", SUP_IOCTL_LDR_LOAD_SIZE(cbImage)));1860 AssertMsgFailed(("failed to allocated %u bytes for SUPLDRLOAD_IN structure!\n", SUP_IOCTL_LDR_LOAD_SIZE(cbImageWithTabs))); 1837 1861 rc = VERR_NO_TMP_MEMORY; 1838 1862 } -
trunk/src/VBox/HostDrivers/Support/SUPLibInternal.h
r22615 r25258 31 31 #ifndef ___SUPLibInternal_h___ 32 32 #define ___SUPLibInternal_h___ 33 34 /*#define SUPDRV_USE_NATIVE_LOADER*/ 33 35 34 36 #include <VBox/cdefs.h> -
trunk/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp
r24183 r25258 759 759 } 760 760 761 #ifdef SUPDRV_USE_NATIVE_LOADER 762 763 int VBOXCALL supdrvOSLdrOpen(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const char *pszFilename) 764 { 765 NOREF(pDevExt); NOREF(pImage); NOREF(pszFilename); 766 return VERR_NOT_SUPPORTED; 767 } 768 769 770 int VBOXCALL supdrvOSLdrValidatePointer(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, void *pv, const uint8_t *pbImageBits) 771 { 772 NOREF(pDevExt); NOREF(pImage); NOREF(pv); NOREF(pbImageBits); 773 return VERR_NOT_SUPPORTED; 774 } 775 776 777 int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits) 778 { 779 NOREF(pDevExt); NOREF(pImage); NOREF(pbImageBits); 780 return VERR_NOT_SUPPORTED; 781 } 782 783 784 void VBOXCALL supdrvOSLdrUnload(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage) 785 { 786 NOREF(pDevExt); NOREF(pImage); 787 } 788 789 #endif /* SUPDRV_USE_NATIVE_LOADER */ 761 790 762 791 /** -
trunk/src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c
r22678 r25258 92 92 /** Declare the module as a pseudo device. */ 93 93 DECLARE_MODULE(vboxdrv, g_VBoxDrvFreeBSDModule, SI_SUB_PSEUDO, SI_ORDER_ANY); 94 MODULE_VERSION(vboxdrv, 1); 94 MODULE_VERSION(vboxdrv, 1); 95 95 96 96 /** … … 600 600 } 601 601 602 #ifdef SUPDRV_USE_NATIVE_LOADER 603 604 int VBOXCALL supdrvOSLdrOpen(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const char *pszFilename) 605 { 606 NOREF(pDevExt); NOREF(pImage); NOREF(pszFilename); 607 return VERR_NOT_SUPPORTED; 608 } 609 610 611 int VBOXCALL supdrvOSLdrValidatePointer(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, void *pv, const uint8_t *pbImageBits) 612 { 613 NOREF(pDevExt); NOREF(pImage); NOREF(pv); NOREF(pbImageBits); 614 return VERR_NOT_SUPPORTED; 615 } 616 617 618 int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits) 619 { 620 NOREF(pDevExt); NOREF(pImage); NOREF(pbImageBits); 621 return VERR_NOT_SUPPORTED; 622 } 623 624 625 void VBOXCALL supdrvOSLdrUnload(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage) 626 { 627 NOREF(pDevExt); NOREF(pImage); 628 } 629 630 #endif /* SUPDRV_USE_NATIVE_LOADER */ 602 631 603 632 SUPR0DECL(int) SUPR0Printf(const char *pszFormat, ...) -
trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
r25090 r25258 1006 1006 } 1007 1007 1008 #ifdef SUPDRV_USE_NATIVE_LOADER 1009 1010 int VBOXCALL supdrvOSLdrOpen(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const char *pszFilename) 1011 { 1012 NOREF(pDevExt); NOREF(pImage); NOREF(pszFilename); 1013 return VERR_NOT_SUPPORTED; 1014 } 1015 1016 1017 int VBOXCALL supdrvOSLdrValidatePointer(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, void *pv, const uint8_t *pbImageBits) 1018 { 1019 NOREF(pDevExt); NOREF(pImage); NOREF(pv); NOREF(pbImageBits); 1020 return VERR_NOT_SUPPORTED; 1021 } 1022 1023 1024 int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits) 1025 { 1026 NOREF(pDevExt); NOREF(pImage); NOREF(pbImageBits); 1027 return VERR_NOT_SUPPORTED; 1028 } 1029 1030 1031 void VBOXCALL supdrvOSLdrUnload(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage) 1032 { 1033 NOREF(pDevExt); NOREF(pImage); 1034 } 1035 1036 #endif /* SUPDRV_USE_NATIVE_LOADER */ 1008 1037 1009 1038 /** -
trunk/src/VBox/HostDrivers/Support/os2/SUPDrv-os2.cpp
r22077 r25258 382 382 } 383 383 384 #ifdef SUPDRV_USE_NATIVE_LOADER 385 386 int VBOXCALL supdrvOSLdrOpen(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const char *pszFilename) 387 { 388 NOREF(pDevExt); NOREF(pImage); NOREF(pszFilename); 389 return VERR_NOT_SUPPORTED; 390 } 391 392 393 int VBOXCALL supdrvOSLdrValidatePointer(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, void *pv, const uint8_t *pbImageBits) 394 { 395 NOREF(pDevExt); NOREF(pImage); NOREF(pv); NOREF(pbImageBits); 396 return VERR_NOT_SUPPORTED; 397 } 398 399 400 int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits) 401 { 402 NOREF(pDevExt); NOREF(pImage); NOREF(pbImageBits); 403 return VERR_NOT_SUPPORTED; 404 } 405 406 407 void VBOXCALL supdrvOSLdrUnload(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage) 408 { 409 NOREF(pDevExt); NOREF(pImage); 410 } 411 412 #endif /* SUPDRV_USE_NATIVE_LOADER */ 384 413 385 414 /** -
trunk/src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c
r25181 r25258 897 897 } 898 898 899 #ifdef SUPDRV_USE_NATIVE_LOADER 900 901 int VBOXCALL supdrvOSLdrOpen(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const char *pszFilename) 902 { 903 NOREF(pDevExt); NOREF(pImage); NOREF(pszFilename); 904 return VERR_NOT_SUPPORTED; 905 } 906 907 908 int VBOXCALL supdrvOSLdrValidatePointer(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, void *pv, const uint8_t *pbImageBits) 909 { 910 NOREF(pDevExt); NOREF(pImage); NOREF(pv); NOREF(pbImageBits); 911 return VERR_NOT_SUPPORTED; 912 } 913 914 915 int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits) 916 { 917 NOREF(pDevExt); NOREF(pImage); NOREF(pbImageBits); 918 return VERR_NOT_SUPPORTED; 919 } 920 921 922 void VBOXCALL supdrvOSLdrUnload(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage) 923 { 924 NOREF(pDevExt); NOREF(pImage); 925 } 926 927 #endif /* SUPDRV_USE_NATIVE_LOADER */ 899 928 900 929 RTDECL(int) SUPR0Printf(const char *pszFormat, ...) -
trunk/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp
r24035 r25258 594 594 } 595 595 596 #ifdef SUPDRV_USE_NATIVE_LOADER 597 598 int VBOXCALL supdrvOSLdrOpen(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const char *pszFilename) 599 { 600 NOREF(pDevExt); NOREF(pImage); NOREF(pszFilename); 601 return VERR_NOT_SUPPORTED; 602 } 603 604 605 int VBOXCALL supdrvOSLdrValidatePointer(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, void *pv, const uint8_t *pbImageBits) 606 { 607 NOREF(pDevExt); NOREF(pImage); NOREF(pv); NOREF(pbImageBits); 608 return VERR_NOT_SUPPORTED; 609 } 610 611 612 int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits) 613 { 614 NOREF(pDevExt); NOREF(pImage); NOREF(pbImageBits); 615 return VERR_NOT_SUPPORTED; 616 } 617 618 619 void VBOXCALL supdrvOSLdrUnload(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage) 620 { 621 NOREF(pDevExt); NOREF(pImage); 622 } 623 624 #endif /* SUPDRV_USE_NATIVE_LOADER */ 596 625 597 626 /**
Note:
See TracChangeset
for help on using the changeset viewer.