Signed-off-by: Jactry Zeng jzeng@codeweavers.com --- include/winerror.h | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+)
diff --git a/include/winerror.h b/include/winerror.h index d51d5648cdb..fb44eaacbed 100644 --- a/include/winerror.h +++ b/include/winerror.h @@ -3884,6 +3884,47 @@ static inline HRESULT HRESULT_FROM_WIN32(unsigned int x) #define WINCODEC_ERR_WIN32ERROR _HRESULT_TYPEDEF_(0x88982f94) #define WINCODEC_ERR_INVALIDPROGRESSIVELEVEL _HRESULT_TYPEDEF_(0x88982f95)
+#define MILERR_OBJECTBUSY _HRESULT_TYPEDEF_(0x88980001) +#define MILERR_INSUFFICIENTBUFFER _HRESULT_TYPEDEF_(0x88980002) +#define MILERR_WIN32ERROR _HRESULT_TYPEDEF_(0x88980003) +#define MILERR_SCANNER_FAILED _HRESULT_TYPEDEF_(0x88980004) +#define MILERR_SCREENACCESSDENIED _HRESULT_TYPEDEF_(0x88980005) +#define MILERR_DISPLAYSTATEINVALID _HRESULT_TYPEDEF_(0x88980006) +#define MILERR_NONINVERTIBLEMATRIX _HRESULT_TYPEDEF_(0x88980007) +#define MILERR_ZEROVECTOR _HRESULT_TYPEDEF_(0x88980008) +#define MILERR_TERMINATED _HRESULT_TYPEDEF_(0x88980009) +#define MILERR_BADNUMBER _HRESULT_TYPEDEF_(0x8898000a) +#define MILERR_INTERNALERROR _HRESULT_TYPEDEF_(0x88980080) +#define MILERR_DISPLAYFORMATNOTSUPPORTED _HRESULT_TYPEDEF_(0x88980084) +#define MILERR_INVALIDCALL _HRESULT_TYPEDEF_(0x88980085) +#define MILERR_ALREADYLOCKED _HRESULT_TYPEDEF_(0x88980086) +#define MILERR_NOTLOCKED _HRESULT_TYPEDEF_(0x88980087) +#define MILERR_DEVICECANNOTRENDERTEXT _HRESULT_TYPEDEF_(0x88980088) +#define MILERR_GLYPHBITMAPMISSED _HRESULT_TYPEDEF_(0x88980089) +#define MILERR_MALFORMEDGLYPHCACHE _HRESULT_TYPEDEF_(0x8898008a) +#define MILERR_GENERIC_IGNORE _HRESULT_TYPEDEF_(0x8898008b) +#define MILERR_MALFORMED_GUIDELINE_DATA _HRESULT_TYPEDEF_(0x8898008c) +#define MILERR_NO_HARDWARE_DEVICE _HRESULT_TYPEDEF_(0x8898008d) +#define MILERR_NEED_RECREATE_AND_PRESENT _HRESULT_TYPEDEF_(0x8898008e) +#define MILERR_ALREADY_INITIALIZED _HRESULT_TYPEDEF_(0x8898008f) +#define MILERR_MISMATCHED_SIZE _HRESULT_TYPEDEF_(0x88980090) +#define MILERR_NO_REDIRECTION_SURFACE_AVAILABLE _HRESULT_TYPEDEF_(0x88980091) +#define MILERR_REMOTING_NOT_SUPPORTED _HRESULT_TYPEDEF_(0x88980092) +#define MILERR_QUEUED_PRESENT_NOT_SUPPORTED _HRESULT_TYPEDEF_(0x88980093) +#define MILERR_NOT_QUEUING_PRESENTS _HRESULT_TYPEDEF_(0x88980094) +#define MILERR_NO_REDIRECTION_SURFACE_RETRY_LATER _HRESULT_TYPEDEF_(0x88980095) +#define MILERR_TOOMANYSHADERELEMNTS _HRESULT_TYPEDEF_(0x88980096) +#define MILERR_MROW_READLOCK_FAILED _HRESULT_TYPEDEF_(0x88980097) +#define MILERR_MROW_UPDATE_FAILED _HRESULT_TYPEDEF_(0x88980098) +#define MILERR_SHADER_COMPILE_FAILED _HRESULT_TYPEDEF_(0x88980099) +#define MILERR_MAX_TEXTURE_SIZE_EXCEEDED _HRESULT_TYPEDEF_(0x8898009a) +#define MILERR_QPC_TIME_WENT_BACKWARD _HRESULT_TYPEDEF_(0x8898009b) +#define MILERR_DXGI_ENUMERATION_OUT_OF_SYNC _HRESULT_TYPEDEF_(0x8898009d) +#define MILERR_ADAPTER_NOT_FOUND _HRESULT_TYPEDEF_(0x8898009e) +#define MILERR_COLORSPACE_NOT_SUPPORTED _HRESULT_TYPEDEF_(0x8898009f) +#define MILERR_PREFILTER_NOT_SUPPORTED _HRESULT_TYPEDEF_(0x889800a0) +#define MILERR_DISPLAYID_ACCESS_DENIED _HRESULT_TYPEDEF_(0x889800a1) + #define DWRITE_E_FILEFORMAT _HRESULT_TYPEDEF_(0x88985000) #define DWRITE_E_UNEXPECTED _HRESULT_TYPEDEF_(0x88985001) #define DWRITE_E_NOFONT _HRESULT_TYPEDEF_(0x88985002)
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@codeweavers.com --- 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;
This makes Tencent START cloud game client happy.
Signed-off-by: Jactry Zeng jzeng@codeweavers.com --- dlls/dwmapi/dwmapi_main.c | 8 +++++++- dlls/dwmapi/tests/dwmapi.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-)
diff --git a/dlls/dwmapi/dwmapi_main.c b/dlls/dwmapi/dwmapi_main.c index 5293a22729b..9defcb14373 100644 --- a/dlls/dwmapi/dwmapi_main.c +++ b/dlls/dwmapi/dwmapi_main.c @@ -218,9 +218,15 @@ HRESULT WINAPI DwmGetCompositionTimingInfo(HWND hwnd, DWM_TIMING_INFO *info) { static int i;
+ if (!info) + return E_INVALIDARG; + + if (info->cbSize != sizeof(DWM_TIMING_INFO)) + return MILERR_MISMATCHED_SIZE; + if(!i++) FIXME("(%p %p)\n", hwnd, info);
- return E_NOTIMPL; + return S_OK; }
/********************************************************************** diff --git a/dlls/dwmapi/tests/dwmapi.c b/dlls/dwmapi/tests/dwmapi.c index 7cb9eb424f1..696aa9c9d86 100644 --- a/dlls/dwmapi/tests/dwmapi.c +++ b/dlls/dwmapi/tests/dwmapi.c @@ -33,7 +33,36 @@ static void test_DwmIsCompositionEnabled(void) ok(enabled == TRUE || enabled == FALSE, "Got unexpected %#x.\n", enabled); }
+static void test_DwmGetCompositionTimingInfo(void) +{ + DWM_TIMING_INFO timing_info; + BOOL enabled; + HRESULT hr; + + enabled = FALSE; + hr = DwmIsCompositionEnabled(&enabled); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + if (!enabled) + { + skip("DWM is disabled.\n"); + return; + } + + hr = DwmGetCompositionTimingInfo(NULL, NULL); + ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr); + + memset(&timing_info, 0, sizeof(timing_info)); + hr = DwmGetCompositionTimingInfo(NULL, &timing_info); + ok(hr == MILERR_MISMATCHED_SIZE, "Got hr %#lx.\n", hr); + + timing_info.cbSize = sizeof(timing_info); + hr = DwmGetCompositionTimingInfo(NULL, &timing_info); + ok(hr == S_OK, "Got hr %#lx.\n", hr); +} + START_TEST(dwmapi) { test_DwmIsCompositionEnabled(); + test_DwmGetCompositionTimingInfo(); }