Changeset 24364 in vbox
- Timestamp:
- Nov 5, 2009 2:18:31 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 54388
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/settings.h
r24296 r24364 395 395 { 396 396 CpuIdLeaf() 397 : ulId( -1),397 : ulId(UINT32_MAX), 398 398 ulEax(0), 399 399 ulEbx(0), -
trunk/src/VBox/Main/MachineImpl.cpp
r24354 r24364 1382 1382 STDMETHODIMP Machine::GetCpuIdLeaf(ULONG id, ULONG *aValEax, ULONG *aValEbx, ULONG *aValEcx, ULONG *aValEdx) 1383 1383 { 1384 if (!aValEax || !aValEbx || !aValEcx || !aValEdx) 1385 return E_POINTER; 1384 CheckComArgOutPointerValid(aValEax); 1385 CheckComArgOutPointerValid(aValEbx); 1386 CheckComArgOutPointerValid(aValEcx); 1387 CheckComArgOutPointerValid(aValEdx); 1386 1388 1387 1389 AutoCaller autoCaller(this); … … 1404 1406 case 0xA: 1405 1407 if (mHWData->mCpuIdStdLeafs[id].ulId != id) 1406 return E_INVALIDARG; /* not set */1408 return setError(E_INVALIDARG, tr("CpuId override leaf %#x is not set"), id); 1407 1409 1408 1410 *aValEax = mHWData->mCpuIdStdLeafs[id].ulEax; … … 1424 1426 case 0x8000000A: 1425 1427 if (mHWData->mCpuIdExtLeafs[id - 0x80000000].ulId != id) 1426 return E_INVALIDARG; /* not set */1428 return setError(E_INVALIDARG, tr("CpuId override leaf %#x is not set"), id); 1427 1429 1428 1430 *aValEax = mHWData->mCpuIdExtLeafs[id - 0x80000000].ulEax; … … 1433 1435 1434 1436 default: 1435 return E_INVALIDARG;1437 return setError(E_INVALIDARG, tr("CpuId override leaf %#x is out of range"), id); 1436 1438 } 1437 1439 return S_OK; … … 1461 1463 case 0x9: 1462 1464 case 0xA: 1465 AssertCompile(RT_ELEMENTS(mHWData->mCpuIdStdLeafs) == 0xA); 1463 1466 AssertRelease(id < RT_ELEMENTS(mHWData->mCpuIdStdLeafs)); 1464 1467 mHWData->mCpuIdStdLeafs[id].ulId = id; … … 1480 1483 case 0x80000009: 1481 1484 case 0x8000000A: 1485 AssertCompile(RT_ELEMENTS(mHWData->mCpuIdExtLeafs) == 0xA); 1482 1486 AssertRelease(id - 0x80000000 < RT_ELEMENTS(mHWData->mCpuIdExtLeafs)); 1483 1487 mHWData->mCpuIdExtLeafs[id - 0x80000000].ulId = id; … … 1489 1493 1490 1494 default: 1491 return E_INVALIDARG;1495 return setError(E_INVALIDARG, tr("CpuId override leaf %#x is out of range"), id); 1492 1496 } 1493 1497 return S_OK; … … 1517 1521 case 0x9: 1518 1522 case 0xA: 1523 AssertCompile(RT_ELEMENTS(mHWData->mCpuIdStdLeafs) == 0xA); 1519 1524 AssertRelease(id < RT_ELEMENTS(mHWData->mCpuIdStdLeafs)); 1520 1525 /* Invalidate leaf. */ 1521 mHWData->mCpuIdStdLeafs[id].ulId = -1;1526 mHWData->mCpuIdStdLeafs[id].ulId = UINT32_MAX; 1522 1527 break; 1523 1528 … … 1533 1538 case 0x80000009: 1534 1539 case 0x8000000A: 1540 AssertCompile(RT_ELEMENTS(mHWData->mCpuIdExtLeafs) == 0xA); 1535 1541 AssertRelease(id - 0x80000000 < RT_ELEMENTS(mHWData->mCpuIdExtLeafs)); 1536 1542 /* Invalidate leaf. */ 1537 mHWData->mCpuIdExtLeafs[id - 0x80000000].ulId = -1;1543 mHWData->mCpuIdExtLeafs[id - 0x80000000].ulId = UINT32_MAX; 1538 1544 break; 1539 1545 1540 1546 default: 1541 return E_INVALIDARG;1547 return setError(E_INVALIDARG, tr("CpuId override leaf %#x is out of range"), id); 1542 1548 } 1543 1549 return S_OK; … … 1556 1562 /* Invalidate all standard leafs. */ 1557 1563 for (unsigned i = 0; i < RT_ELEMENTS(mHWData->mCpuIdStdLeafs); i++) 1558 mHWData->mCpuIdStdLeafs[i].ulId = -1;1564 mHWData->mCpuIdStdLeafs[i].ulId = UINT32_MAX; 1559 1565 1560 1566 /* Invalidate all extended leafs. */ 1561 1567 for (unsigned i = 0; i < RT_ELEMENTS(mHWData->mCpuIdExtLeafs); i++) 1562 mHWData->mCpuIdExtLeafs[i].ulId = -1;1568 mHWData->mCpuIdExtLeafs[i].ulId = UINT32_MAX; 1563 1569 1564 1570 return S_OK; … … 6594 6600 for (unsigned idx = 0; idx < RT_ELEMENTS(mHWData->mCpuIdStdLeafs); idx++) 6595 6601 { 6596 if (mHWData->mCpuIdStdLeafs[idx].ulId != -1)6602 if (mHWData->mCpuIdStdLeafs[idx].ulId != UINT32_MAX) 6597 6603 data.llCpuIdLeafs.push_back(mHWData->mCpuIdStdLeafs[idx]); 6598 6604 } 6599 6605 for (unsigned idx = 0; idx < RT_ELEMENTS(mHWData->mCpuIdExtLeafs); idx++) 6600 6606 { 6601 if (mHWData->mCpuIdExtLeafs[idx].ulId != -1)6607 if (mHWData->mCpuIdExtLeafs[idx].ulId != UINT32_MAX) 6602 6608 data.llCpuIdLeafs.push_back(mHWData->mCpuIdExtLeafs[idx]); 6603 6609 }
Note:
See TracChangeset
for help on using the changeset viewer.