[PATCH 3/3] dwmapi: Partially implement DwmGetCompositionTimingInfo().
Jactry Zeng
jzeng at codeweavers.com
Wed May 11 02:44:21 CDT 2022
This makes Tencent START cloud game client happy.
Signed-off-by: Jactry Zeng <jzeng at 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();
}
--
2.35.1
More information about the wine-devel
mailing list