Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/kernelbase/version.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/dlls/kernelbase/version.c b/dlls/kernelbase/version.c index d07c1c9..d0c5186 100644 --- a/dlls/kernelbase/version.c +++ b/dlls/kernelbase/version.c @@ -1305,11 +1305,20 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetProductInfo( DWORD os_major, DWORD os_minor, */ DWORD WINAPI GetVersion(void) { - DWORD result = MAKELONG( MAKEWORD( NtCurrentTeb()->Peb->OSMajorVersion, - NtCurrentTeb()->Peb->OSMinorVersion ), - (NtCurrentTeb()->Peb->OSPlatformId ^ 2) << 14 ); - if (NtCurrentTeb()->Peb->OSPlatformId == VER_PLATFORM_WIN32_NT) - result |= LOWORD(NtCurrentTeb()->Peb->OSBuildNumber) << 16; + const RTL_OSVERSIONINFOEXW *ver; + DWORD result; + + if (!(ver = __wine_get_compat_win_version())) + { + ERR( "failed to get version (not enough memory)\n" ); + return 0; + } + + result = MAKELONG( MAKEWORD( ver->dwMajorVersion, ver->dwMinorVersion ), + (ver->dwPlatformId ^ 2) << 14 ); + + if (ver->dwPlatformId == VER_PLATFORM_WIN32_NT) + result |= LOWORD(ver->dwBuildNumber) << 16; return result; }