VirtualBox

Changeset 3395 in kBuild for trunk


Ignore:
Timestamp:
Jul 2, 2020 8:30:25 AM (5 years ago)
Author:
bird
Message:

kmk/variable.c: Build fix. Added KBUILD_HOST_VERSION_BUILD for windows and appended the build number to the KMK_HOST_VERSION string too.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/variable.c

    r3394 r3395  
    16781678  {
    16791679    OSVERSIONINFOEXW oix;
    1680     typedef NTSTATUS (WINAPI *pfnRtlGetVersion)(OSVERSIONINFOEXW *);
    1681     *(FARPROC *)&pfnRtlGetVersion = GetProcAddress (GetModuleHandleW ("NTDLL.DLL"),
     1680    NTSTATUS (WINAPI *pfnRtlGetVersion)(OSVERSIONINFOEXW *);
     1681    *(FARPROC *)&pfnRtlGetVersion = GetProcAddress (GetModuleHandleW (L"NTDLL.DLL"),
    16821682                                                    "RtlGetVersion"); /* GetVersionEx lies */
    16831683    memset (&oix, '\0', sizeof (oix));
    1684     oix.dwOSVersionInfoSize = sizeof (OSVERSIONINFOEX);
     1684    oix.dwOSVersionInfoSize = sizeof (OSVERSIONINFOEXW);
    16851685    if (!pfnRtlGetVersion || pfnRtlGetVersion (&oix) < 0)
    16861686      {
    16871687        memset (&oix, '\0', sizeof (oix));
    1688         oix.dwOSVersionInfoSize = sizeof (OSVERSIONINFOEX);
    1689         if (!GetVersionExW((LPOSVERSIONINFO)&oix))
     1688        oix.dwOSVersionInfoSize = sizeof (OSVERSIONINFOEXW);
     1689        if (!GetVersionExW((LPOSVERSIONINFOW)&oix))
    16901690          {
    16911691            memset (&oix, '\0', sizeof (oix));
    1692             oix.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
    1693             GetVersionExW ((LPOSVERSIONINFO)&oix);
     1692            oix.dwOSVersionInfoSize = sizeof (OSVERSIONINFOW);
     1693            GetVersionExW ((LPOSVERSIONINFOW)&oix);
    16941694          }
    16951695      }
     
    17101710        ul4th   = oix.wServicePackMajor;
    17111711      }
     1712    oix.dwBuildNumber &= 0x3fffffff;
     1713    sprintf (buf, "%lu", oix.dwBuildNumber);
     1714    define_variable_cname ("KBUILD_HOST_VERSION_BUILD", buf, o_default, 0);
     1715
     1716    sprintf (buf, "%lu.%lu.%lu.%lu.%lu", ulMajor, ulMinor, ulPatch, ul4th, oix.dwBuildNumber);
     1717    define_variable_cname ("KBUILD_HOST_VERSION", buf, o_default, 0);
    17121718  }
    17131719# else
     
    17251731  define_variable_cname ("KBUILD_HOST_UNAME_MACHINE", uts.machine, o_default, 0);
    17261732  define_variable_cname ("KBUILD_HOST_UNAME_NODENAME", uts.nodename, o_default, 0);
    1727 # endif
    17281733
    17291734  sprintf (buf, "%lu.%lu.%lu.%lu", ulMajor, ulMinor, ulPatch, ul4th);
    17301735  define_variable_cname ("KBUILD_HOST_VERSION", buf, o_default, 0);
     1736# endif
    17311737
    17321738  sprintf (buf, "%lu", ulMajor);
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