Module: wine Branch: master Commit: 0260f2dc126c305be3cf9d4214c2d73e1ed46ec3 URL: https://source.winehq.org/git/wine.git/?a=commit;h=0260f2dc126c305be3cf9d421... Author: Jactry Zeng <jzeng(a)codeweavers.com> Date: Wed May 11 02:44:20 2022 -0500 dwmapi: Use RtlGetVersion() for system version detection instead.
From commit 6719bf2e037b, 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(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwmapi/dwmapi_main.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/dlls/dwmapi/dwmapi_main.c b/dlls/dwmapi/dwmapi_main.c index cec20220ec2..5293a22729b 100644 --- a/dlls/dwmapi/dwmapi_main.c +++ b/dlls/dwmapi/dwmapi_main.c @@ -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;