Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/kernelbase/version.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/dlls/kernelbase/version.c b/dlls/kernelbase/version.c index dc8cc61..37285e1 100644 --- a/dlls/kernelbase/version.c +++ b/dlls/kernelbase/version.c @@ -1431,11 +1431,15 @@ 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; + DWORD result; + + if (!init_current_version()) return 0; + + result = MAKELONG( MAKEWORD( current_version.dwMajorVersion, current_version.dwMinorVersion ), + (current_version.dwPlatformId ^ 2) << 14 ); + + if (current_version.dwPlatformId == VER_PLATFORM_WIN32_NT) + result |= LOWORD(current_version.dwBuildNumber) << 16; return result; }