Changeset 48400 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Sep 10, 2013 8:38:28 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/DevEFI.cpp
r46356 r48400 1661 1661 1662 1662 1663 static int efiParseDeviceString(PDEVEFI pThis, char *pszDeviceProps) 1664 { 1665 int rc = 0; 1666 uint32_t iStr, iHex, u32OutLen; 1667 uint8_t u8Value = 0; /* (shut up gcc) */ 1668 bool fUpper = true; 1669 1670 u32OutLen = (uint32_t)RTStrNLen(pszDeviceProps, RTSTR_MAX) / 2 + 1; 1671 1672 pThis->pbDeviceProps = (uint8_t *)PDMDevHlpMMHeapAlloc(pThis->pDevIns, u32OutLen); 1663 /** 1664 * Converts a hex string into a binary data blob located at 1665 * pThis->pbDeviceProps, size returned as pThis->cbDeviceProps. 1666 * 1667 * @returns VERR_NO_MEMORY or VINF_SUCCESS. 1668 * @param pThis The EFI instance data. 1669 * @param pszDeviceProps The device property hex string to decode. 1670 */ 1671 static int efiParseDeviceString(PDEVEFI pThis, const char *pszDeviceProps) 1672 { 1673 uint32_t const cbOut = (uint32_t)RTStrNLen(pszDeviceProps, RTSTR_MAX) / 2 + 1; 1674 pThis->pbDeviceProps = (uint8_t *)PDMDevHlpMMHeapAlloc(pThis->pDevIns, cbOut); 1673 1675 if (!pThis->pbDeviceProps) 1674 1676 return VERR_NO_MEMORY; 1675 1677 1676 for (iStr=0, iHex = 0; pszDeviceProps[iStr]; iStr++) 1678 uint32_t iHex = 0; 1679 bool fUpper = true; 1680 uint8_t u8Value = 0; /* (shut up gcc) */ 1681 for (uint32_t iStr = 0; pszDeviceProps[iStr]; iStr++) 1677 1682 { 1678 1683 uint8_t u8Hb = efiGetHalfByte(pszDeviceProps[iStr]); … … 1685 1690 pThis->pbDeviceProps[iHex++] = u8Hb | u8Value; 1686 1691 1687 Assert(iHex < u32OutLen);1692 Assert(iHex < cbOut); 1688 1693 fUpper = !fUpper; 1689 1694 } … … 1692 1697 pThis->cbDeviceProps = iHex; 1693 1698 1694 return rc;1699 return VINF_SUCCESS; 1695 1700 } 1696 1701
Note:
See TracChangeset
for help on using the changeset viewer.