Jactry Zeng : dwmapi: Partially implement DwmGetCompositionTimingInfo().

Alexandre Julliard julliard at winehq.org
Tue May 17 15:37:23 CDT 2022


Module: wine
Branch: master
Commit: 182feddd4b02e83f3c69863bc2e6e63945eb2df1
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=182feddd4b02e83f3c69863bc2e6e63945eb2df1

Author: Jactry Zeng <jzeng at codeweavers.com>
Date:   Wed May 11 02:44:21 2022 -0500

dwmapi: Partially implement DwmGetCompositionTimingInfo().

This makes Tencent START cloud game client happy.

Signed-off-by: Jactry Zeng <jzeng at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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();
 }




More information about the wine-cvs mailing list