Commit d05532e2 authored by Alexandre Julliard's avatar Alexandre Julliard

Directly use the PEB version fields in GetVersion.

parent 1c088a43
...@@ -107,15 +107,11 @@ DWORD WINAPI GetVersion16(void) ...@@ -107,15 +107,11 @@ DWORD WINAPI GetVersion16(void)
*/ */
DWORD WINAPI GetVersion(void) DWORD WINAPI GetVersion(void)
{ {
RTL_OSVERSIONINFOEXW info; DWORD result = MAKELONG( MAKEWORD( NtCurrentTeb()->Peb->OSMajorVersion,
DWORD result; NtCurrentTeb()->Peb->OSMinorVersion ),
(NtCurrentTeb()->Peb->OSPlatformId ^ 2) << 14 );
info.dwOSVersionInfoSize = sizeof(info); if (NtCurrentTeb()->Peb->OSPlatformId == VER_PLATFORM_WIN32_NT)
if (RtlGetVersion( &info ) != STATUS_SUCCESS) return 0; result |= LOWORD(NtCurrentTeb()->Peb->OSBuildNumber) << 16;
result = MAKELONG( MAKEWORD( info.dwMajorVersion, info.dwMinorVersion ),
(info.dwPlatformId ^ 2) << 14 );
if (info.dwPlatformId == VER_PLATFORM_WIN32_NT) result |= LOWORD(info.dwBuildNumber) << 16;
return result; return result;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment