VirtualBox

Changeset 26617 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Feb 17, 2010 3:56:50 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
57814
Message:

DevFwCommon.cpp: Allow more than 3 chars for product version and 12 for product name. RTSystemQueryDmiString zap the buffer regardless of status, so use a 2nd buffer for the host strings. Log the values we take from the host.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/DevFwCommon.cpp

    r26609 r26617  
    5959static const char   *s_szDefDmiBIOSReleaseDate  = "12/01/2006";
    6060static const char   *s_szDefDmiSystemVendor     = "innotek GmbH";
    61 static       char    s_szDefDmiSystemProduct[13]  = "VirtualBox";
    62 static       char    s_szDefDmiSystemVersion[4]   = "1.2";
     61static const char   *s_szDefDmiSystemProduct    = "VirtualBox";
     62static const char   *s_szDefDmiSystemVersion    = "1.2";
    6363static const char   *s_szDefDmiSystemSerial     = "0";
    6464static const char   *s_szDefDmiSystemFamily     = "Virtual Machine";
     
    6767static const char   *s_szDefDmiChassisSerial    = "";
    6868static const char   *s_szDefDmiChassisAssetTag  = "";
     69
     70static       char    g_szHostDmiSystemProduct[64];
     71static       char    g_szHostDmiSystemVersion[64];
    6972
    7073
     
    304307    return (u8Sum == 0);
    305308}
     309
    306310/*
    307311 * Macmini2,1 - matches Mac Mini
     
    312316
    313317    rc = RTSystemQueryDmiString(RTSYSDMISTR_PRODUCT_NAME,
    314                                 s_szDefDmiSystemProduct,
    315                                 sizeof s_szDefDmiSystemProduct);
    316     if (RT_FAILURE(rc))
     318                                g_szHostDmiSystemProduct, sizeof(g_szHostDmiSystemProduct));
     319    if (RT_SUCCESS(rc))
    317320    {
    318         // ignore rc?
     321        s_szDefDmiSystemProduct = g_szHostDmiSystemProduct;
     322        LogRel(("DMI: Using DmiSystemProduct from host: %s\n", g_szHostDmiSystemProduct));
    319323    }
    320324
    321325    rc = RTSystemQueryDmiString(RTSYSDMISTR_PRODUCT_VERSION,
    322                                 s_szDefDmiSystemVersion,
    323                                 sizeof s_szDefDmiSystemVersion);
    324     if (RT_FAILURE(rc))
     326                                g_szHostDmiSystemVersion, sizeof(g_szHostDmiSystemVersion));
     327    if (RT_SUCCESS(rc))
    325328    {
    326         // ignore rc?
     329        s_szDefDmiSystemVersion = g_szHostDmiSystemVersion;
     330        LogRel(("DMI: Using DmiSystemVersion from host: %s\n", g_szHostDmiSystemVersion));
    327331    }
    328332}
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette