dwmapi: Use RtlGetVersion() for system version detection instead.

From commit 6719bf2e03, GetVersionExW() only returns the real
emulated system version when supportedOS is specified in the
application's manifest file, so let's use RtlGetVersion() instead.

Signed-off-by: Jactry Zeng <jzeng@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jactry Zeng 2022-05-11 02:44:20 -05:00 committed by Alexandre Julliard
parent 2a44723d4d
commit 0260f2dc12
1 changed files with 5 additions and 6 deletions

View File

@ -21,6 +21,7 @@
#include <stdarg.h>
#include "winternl.h"
#define COBJMACROS
#include "windef.h"
#include "winbase.h"
@ -37,18 +38,16 @@ WINE_DEFAULT_DEBUG_CHANNEL(dwmapi);
*/
HRESULT WINAPI DwmIsCompositionEnabled(BOOL *enabled)
{
OSVERSIONINFOW version;
RTL_OSVERSIONINFOEXW version;
TRACE("%p\n", enabled);
if (!enabled)
return E_INVALIDARG;
version.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW);
if (!GetVersionExW(&version))
*enabled = FALSE;
else
*enabled = FALSE;
version.dwOSVersionInfoSize = sizeof(version);
if (!RtlGetVersion(&version))
*enabled = (version.dwMajorVersion > 6 || (version.dwMajorVersion == 6 && version.dwMinorVersion >= 3));
return S_OK;