VirtualBox

Changeset 96387 in vbox


Ignore:
Timestamp:
Aug 20, 2022 11:06:28 PM (2 years ago)
Author:
vboxsync
Message:

Add/NT/Inst: More RegCleanup cleanups, changing makefile to always build the x86 version. bugref:10261

Location:
trunk/src/VBox/Additions/WINNT/Installer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Installer/Makefile.kmk

    r96038 r96387  
    5454
    5555PROGRAMS += RegCleanup
    56 RegCleanup_TEMPLATE = VBoxGuestR3Exe
    57 RegCleanup_DEFS     = _WIN32_WINNT=0x0400 UNICODE
    58 RegCleanup_SOURCES  = \
     56RegCleanup_TEMPLATE     := VBoxGuestR3Exe
     57RegCleanup_BLD_TRG_ARCH := x86
     58RegCleanup_DEFS         := _WIN32_WINNT=0x0400
     59RegCleanup_SOURCES      := \
    5960        RegCleanup.cpp \
    6061        RegCleanup.rc
     
    377378
    378379include $(FILE_KBUILD_SUB_FOOTER)
     380
  • trunk/src/VBox/Additions/WINNT/Installer/RegCleanup.cpp

    r96375 r96387  
    3333
    3434
    35 static BOOL isNT4(void)
     35static bool IsNt4(void)
    3636{
    37     OSVERSIONINFO OSversion;
    38 
    39     OSversion.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
    40     ::GetVersionEx(&OSversion);
    41 
    42     switch (OSversion.dwPlatformId)
    43     {
    44         case VER_PLATFORM_WIN32s:
    45         case VER_PLATFORM_WIN32_WINDOWS:
    46             return FALSE;
    47         case VER_PLATFORM_WIN32_NT:
    48             if (OSversion.dwMajorVersion == 4)
    49                 return TRUE;
    50             return FALSE;
    51         default:
    52             break;
    53     }
    54     return FALSE;
     37    OSVERSIONINFOW VerInfo = { sizeof(VerInfo), 0 };
     38    GetVersionExW(&VerInfo);
     39    return VerInfo.dwPlatformId  == VER_PLATFORM_WIN32_NT
     40        && VerInfo.dwMajorVersion == 4;
    5541}
    5642
     
    5844int main()
    5945{
    60     /* This program is only for installing drivers on NT4 */
    61     if (!isNT4())
     46    if (!IsNt4())
    6247    {
    6348        DWORD cbIgn;
    6449        WriteFile(GetStdHandle(STD_ERROR_HANDLE), RT_STR_TUPLE("This program only runs on NT4\r\n"), &cbIgn, NULL);
    65         return 1;
     50        return RTEXITCODE_FAILURE;
    6651    }
    6752
     
    7257    RegDeleteKeyW(HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Control\\GraphicsDrivers\\InvalidDisplay");
    7358    RegDeleteKeyW(HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Control\\GraphicsDrivers\\NewDisplay");
    74 
    75     return 0;
     59    return RTEXITCODE_SUCCESS;
    7660}
    7761
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