=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: ninput: Add SetInteractionConfigurationInteractionContext() stub.

Alexandre Julliard julliard at winehq.org
Fri Jun 22 18:32:38 CDT 2018


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

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Thu Jun 21 16:19:45 2018 +0200

ninput: Add SetInteractionConfigurationInteractionContext() stub.

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ninput/main.c         | 17 +++++++++++++++++
 dlls/ninput/ninput.spec    |  2 +-
 dlls/ninput/tests/ninput.c | 36 ++++++++++++++++++++++++++++++++++++
 3 files changed, 54 insertions(+), 1 deletion(-)

diff --git a/dlls/ninput/main.c b/dlls/ninput/main.c
index 90f9e7e..0170374 100644
--- a/dlls/ninput/main.c
+++ b/dlls/ninput/main.c
@@ -131,6 +131,23 @@ HRESULT WINAPI SetPropertyInteractionContext(HINTERACTIONCONTEXT handle,
     }
 }
 
+HRESULT WINAPI SetInteractionConfigurationInteractionContext(HINTERACTIONCONTEXT handle,
+        UINT32 count, const INTERACTION_CONTEXT_CONFIGURATION *configuration)
+{
+    struct interaction_context *context = context_from_handle(handle);
+
+    FIXME("context %p, count %u, configuration %p: stub!.\n", context, count, configuration);
+
+    if (!context)
+        return E_HANDLE;
+    if (!count)
+        return E_INVALIDARG;
+    if (!configuration)
+        return E_POINTER;
+
+    return S_OK;
+}
+
 HRESULT WINAPI ProcessInertiaInteractionContext(HINTERACTIONCONTEXT context)
 {
     FIXME("context %p: stub!\n", context);
diff --git a/dlls/ninput/ninput.spec b/dlls/ninput/ninput.spec
index 166e3d1..70d296c 100644
--- a/dlls/ninput/ninput.spec
+++ b/dlls/ninput/ninput.spec
@@ -17,7 +17,7 @@
 @ stub ResetInteractionContext
 @ stub SetCrossSlideParametersInteractionContext
 @ stub SetInertiaParameterInteractionContext
-@ stub SetInteractionConfigurationInteractionContext
+@ stdcall SetInteractionConfigurationInteractionContext(ptr long ptr)
 @ stub SetMouseWheelParameterInteractionContext
 @ stub SetPivotInteractionContext
 @ stdcall SetPropertyInteractionContext(ptr long long)
diff --git a/dlls/ninput/tests/ninput.c b/dlls/ninput/tests/ninput.c
index 156e3e8..7fd3893 100644
--- a/dlls/ninput/tests/ninput.c
+++ b/dlls/ninput/tests/ninput.c
@@ -82,8 +82,44 @@ static void test_properties(void)
     ok(hr == S_OK, "Failed to destroy context, hr %#x.\n", hr);
 }
 
+static void test_configuration(void)
+{
+    HINTERACTIONCONTEXT context;
+    HRESULT hr;
+
+    static const INTERACTION_CONTEXT_CONFIGURATION config[] =
+    {
+        {
+            INTERACTION_ID_MANIPULATION,
+            INTERACTION_CONFIGURATION_FLAG_MANIPULATION |
+            INTERACTION_CONFIGURATION_FLAG_MANIPULATION_TRANSLATION_X |
+            INTERACTION_CONFIGURATION_FLAG_MANIPULATION_TRANSLATION_Y |
+            INTERACTION_CONFIGURATION_FLAG_MANIPULATION_SCALING |
+            INTERACTION_CONFIGURATION_FLAG_MANIPULATION_TRANSLATION_INERTIA |
+            INTERACTION_CONFIGURATION_FLAG_MANIPULATION_SCALING_INERTIA
+        },
+    };
+
+    hr = CreateInteractionContext(&context);
+    ok(hr == S_OK, "Failed to create context, hr %#x.\n", hr);
+
+    hr = SetInteractionConfigurationInteractionContext(NULL, 0, NULL);
+    ok(hr == E_HANDLE, "Got hr %#x.\n", hr);
+    hr = SetInteractionConfigurationInteractionContext(context, 0, NULL);
+    ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
+    hr = SetInteractionConfigurationInteractionContext(context, 1, NULL);
+    ok(hr == E_POINTER, "Got hr %#x.\n", hr);
+
+    hr = SetInteractionConfigurationInteractionContext(context, ARRAY_SIZE(config), config);
+    ok(hr == S_OK, "Failed to set configuration, hr %#x.\n", hr);
+
+    hr = DestroyInteractionContext(context);
+    ok(hr == S_OK, "Failed to destroy context, hr %#x.\n", hr);
+}
+
 START_TEST(ninput)
 {
     test_context();
     test_properties();
+    test_configuration();
 }




More information about the wine-cvs mailing list