VirtualBox

Changeset 101381 in vbox for trunk/src/VBox/Main/src-client


Ignore:
Timestamp:
Oct 6, 2023 10:00:59 AM (16 months ago)
Author:
vboxsync
Message:

Main: More guest OS id marking. bugref:10384

Location:
trunk/src/VBox/Main/src-client
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/ConsoleImplConfigX86.cpp

    r101374 r101381  
    680680    BOOL fW9xGuest = FALSE;
    681681    BOOL fDosGuest = FALSE;
    682     if (!pGuestOSType.isNull())
     682    if (pGuestOSType.isNotNull())
    683683    {
    684684        Bstr guestTypeFamilyId;
     
    686686        fOsXGuest = guestTypeFamilyId == Bstr("MacOS");
    687687        fWinGuest = guestTypeFamilyId == Bstr("Windows");
    688         fOs2Guest = osTypeId.startsWith("OS2");
    689         fW9xGuest = osTypeId.startsWith("Windows9");    /* Does not include Windows Me. */
    690         fDosGuest = osTypeId.startsWith("DOS") || osTypeId.startsWith("Windows31");
     688        fOs2Guest = osTypeId.startsWith(GUEST_OS_ID_STR_PARTIAL("OS2"));
     689        fW9xGuest = osTypeId.startsWith(GUEST_OS_ID_STR_PARTIAL("Windows9"));    /* Does not include Windows Me. */
     690        fDosGuest = osTypeId.equals(GUEST_OS_ID_STR_X86("DOS")) || osTypeId.equals(GUEST_OS_ID_STR_X86("Windows31"));
    691691    }
    692692
     
    767767        /* We must limit CPUID count for Windows NT 4, as otherwise it stops
    768768        with error 0x3e (MULTIPROCESSOR_CONFIGURATION_NOT_SUPPORTED). */
    769         if (osTypeId == "WindowsNT4")
     769        if (osTypeId == GUEST_OS_ID_STR_X86("WindowsNT4"))
    770770        {
    771771            LogRel(("Limiting CPUID leaf count for NT4 guests\n"));
     
    925925                but that requires quite a bit of API change in Main. */
    926926            if (    fIOAPIC
    927                 &&  (   osTypeId == "WindowsNT4"
    928                      || osTypeId == "Windows2000"
    929                      || osTypeId == "WindowsXP"
    930                      || osTypeId == "Windows2003"))
     927                &&  (   osTypeId == GUEST_OS_ID_STR_X86("WindowsNT4")
     928                     || osTypeId == GUEST_OS_ID_STR_X86("Windows2000")
     929                     || osTypeId == GUEST_OS_ID_STR_X86("WindowsXP")
     930                     || osTypeId == GUEST_OS_ID_STR_X86("Windows2003")))
    931931            {
    932932                /* Only allow TPR patching for NT, Win2k, XP and Windows Server 2003. (32 bits mode)
     
    10081008
    10091009        /* Enable workaround for missing TLB flush for OS/2 guests, see ticketref:20625. */
    1010         if (osTypeId.startsWith("OS2"))
     1010        if (fOs2Guest)
    10111011            InsertConfigInteger(pHM, "MissingOS2TlbFlushWorkaround", 1);
    10121012
     
    16381638            /** @todo @bugref{7145}: We might want to enable this by default for new VMs. For now,
    16391639             *        this is required for Windows 2012 guests. */
    1640             if (osTypeId == "Windows2012_64")
     1640            if (osTypeId == GUEST_OS_ID_STR_X64("Windows2012"))
    16411641                InsertConfigInteger(pBiosCfg, "DmiExposeMemoryTable", 1); /* boolean */
    16421642        }
  • trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp

    r99252 r101381  
    28782878         * Determine guest OS type and the required installer image.
    28792879         */
     2880/** @todo r=bird: Why are we using the guest properties for this instead of the
     2881 * reported guest VBOXOSTYPE/ID?  Since we've got guest properties, we must
     2882 * have GAs, so the guest additions must've reported the guest OS type. That
     2883 * would allow proper OS categorization by family ID instead of this ridiculous
     2884 * naive code assuming anything that isn't windows or solaris must be linux.  */
    28802885        Utf8Str strOSType;
    28812886        vrc = getGuestProperty(pGuest, "/VirtualBox/GuestInfo/OS/Product", strOSType);
    28822887        if (RT_SUCCESS(vrc))
    28832888        {
    2884             if (   strOSType.contains("Microsoft", Utf8Str::CaseInsensitive)
    2885                 || strOSType.contains("Windows", Utf8Str::CaseInsensitive))
     2889            if (   strOSType.contains(GUEST_OS_ID_STR_PARTIAL("Microsoft"), Utf8Str::CaseInsensitive)
     2890                || strOSType.contains(GUEST_OS_ID_STR_PARTIAL("Windows"), Utf8Str::CaseInsensitive))
    28862891            {
    28872892                osType = eOSType_Windows;
     
    29272932                }
    29282933            }
    2929             else if (strOSType.contains("Solaris", Utf8Str::CaseInsensitive))
     2934            else if (strOSType.contains(GUEST_OS_ID_STR_PARTIAL("Solaris"), Utf8Str::CaseInsensitive))
    29302935            {
    29312936                osType = eOSType_Solaris;
Note: See TracChangeset for help on using the changeset viewer.

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