- Timestamp:
- Oct 9, 2024 4:09:15 PM (7 weeks ago)
- Location:
- trunk/src/VBox/Devices/Security
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Security/DevTpm.cpp
r106061 r106259 544 544 /** The base interface for LUN\#0. */ 545 545 PDMIBASE IBase; 546 /** The base interface for LUN\#0. */ 547 PDMITPMPORT ITpmPort; 546 548 /** The base interface below. */ 547 549 R3PTRTYPE(PPDMIBASE) pDrvBase; … … 1627 1629 PDEVTPMCC pThisCC = RT_FROM_MEMBER(pInterface, DEVTPMCC, IBase); 1628 1630 PDMIBASE_RETURN_INTERFACE(pszIID, PDMIBASE, &pThisCC->IBase); 1629 //PDMIBASE_RETURN_INTERFACE(pszIID, PDMITPMPORT, &pThisCC->ITpmPort);1631 PDMIBASE_RETURN_INTERFACE(pszIID, PDMITPMPORT, &pThisCC->ITpmPort); 1630 1632 return NULL; 1633 } 1634 1635 1636 /* -=-=-=-=-=-=-=-=- PDMITPMPORT -=-=-=-=-=-=-=-=- */ 1637 1638 /** 1639 * @interface_method_impl{PDMITPMPORT,pfnGetMaxBufferSize} 1640 */ 1641 static DECLCALLBACK(uint32_t) tpmR3TpmPortGetMaxBufferSize(PPDMITPMPORT pInterface) 1642 { 1643 RT_NOREF(pInterface); 1644 return TPM_DATA_BUFFER_SIZE_MAX; 1631 1645 } 1632 1646 … … 1694 1708 /* IBase */ 1695 1709 pThisCC->IBase.pfnQueryInterface = tpmR3QueryInterface; 1710 1711 /* ITpmPort */ 1712 pThisCC->ITpmPort.pfnGetMaxBufferSize = tpmR3TpmPortGetMaxBufferSize; 1713 1696 1714 1697 1715 /* -
trunk/src/VBox/Devices/Security/DrvTpmEmu.cpp
r106061 r106259 292 292 /** Pointer to the driver instance. */ 293 293 PPDMDRVINS pDrvIns; 294 /** Pointer to the TPM port interface above. */ 295 PPDMITPMPORT pTpmPort; 294 296 295 297 /** Socket handle for the control connection. */ … … 854 856 855 857 /* 858 * Query the TPM port interface of the device above. 859 */ 860 pThis->pTpmPort = PDMIBASE_QUERY_INTERFACE(pDrvIns->pUpBase, PDMITPMPORT); 861 if (!pThis->pTpmPort) 862 { 863 AssertMsgFailed(("Configuration error: the above device/driver didn't export the TPM port interface!\n")); 864 return PDMDRV_SET_ERROR(pDrvIns, VERR_PDM_MISSING_INTERFACE_ABOVE, 865 N_("No TPM port interface above")); 866 } 867 868 /* 856 869 * Validate and read the configuration. 857 870 */ … … 946 959 return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, 947 960 N_("Configuration error: querying \"BufferSize\" resulted in %Rrc"), rc); 961 962 /* Limit to the maximum buffer size of the device above. */ 963 pThis->cbBuffer = RT_MIN(pThis->cbBuffer, pThis->pTpmPort->pfnGetMaxBufferSize(pThis->pTpmPort)); 948 964 949 965 /* Set the buffer size. */ -
trunk/src/VBox/Devices/Security/DrvTpmEmuTpms.cpp
r106061 r106259 79 79 /** The VFS interface of the driver below for NVRAM/TPM state loading and storing. */ 80 80 PPDMIVFSCONNECTOR pDrvVfs; 81 /** Pointer to the TPM port interface above. */ 82 PPDMITPMPORT pTpmPort; 81 83 82 84 /** The TPM version we are emulating. */ … … 480 482 481 483 /* 484 * Query the TPM port interface of the device above. 485 */ 486 pThis->pTpmPort = PDMIBASE_QUERY_INTERFACE(pDrvIns->pUpBase, PDMITPMPORT); 487 if (!pThis->pTpmPort) 488 { 489 AssertMsgFailed(("Configuration error: the above device/driver didn't export the TPM port interface!\n")); 490 return PDMDRV_SET_ERROR(pDrvIns, VERR_PDM_MISSING_INTERFACE_ABOVE, 491 N_("No TPM port interface above")); 492 } 493 494 /* 482 495 * Try attach the VFS driver below and query it's VFS interface. 483 496 */ … … 529 542 return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, 530 543 N_("Configuration error: querying \"BufferSize\" resulted in %Rrc"), rc); 544 545 /* Limit to the buffer size of the device above. */ 546 pThis->cbBuffer = RT_MIN(pThis->cbBuffer, pThis->pTpmPort->pfnGetMaxBufferSize(pThis->pTpmPort)); 531 547 532 548 uint32_t cbBufferMin = 0;
Note:
See TracChangeset
for help on using the changeset viewer.