Vijay Kiran Kamuju : qwave: Add stub for QOSCreateHandle and tests.

Alexandre Julliard julliard at winehq.org
Mon Apr 15 16:26:41 CDT 2019


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

Author: Vijay Kiran Kamuju <infyquest at gmail.com>
Date:   Fri Apr 12 05:21:09 2019 +0200

qwave: Add stub for QOSCreateHandle and tests.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46174
Signed-off-by: Vijay Kiran Kamuju <infyquest at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 configure                    |  1 +
 configure.ac                 |  1 +
 dlls/qwave/Makefile.in       |  1 +
 dlls/qwave/main.c            | 12 ++++++++
 dlls/qwave/qwave.spec        |  2 +-
 dlls/qwave/tests/Makefile.in |  5 +++
 dlls/qwave/tests/qos.c       | 72 ++++++++++++++++++++++++++++++++++++++++++++
 7 files changed, 93 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 3e87c86..451c92d 100755
--- a/configure
+++ b/configure
@@ -20569,6 +20569,7 @@ wine_fn_config_makefile dlls/quartz enable_quartz
 wine_fn_config_makefile dlls/quartz/tests enable_tests
 wine_fn_config_makefile dlls/query enable_query
 wine_fn_config_makefile dlls/qwave enable_qwave
+wine_fn_config_makefile dlls/qwave/tests enable_tests
 wine_fn_config_makefile dlls/rasapi16.dll16 enable_win16
 wine_fn_config_makefile dlls/rasapi32 enable_rasapi32
 wine_fn_config_makefile dlls/rasapi32/tests enable_tests
diff --git a/configure.ac b/configure.ac
index 719afe6..611dc69 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3603,6 +3603,7 @@ WINE_CONFIG_MAKEFILE(dlls/quartz)
 WINE_CONFIG_MAKEFILE(dlls/quartz/tests)
 WINE_CONFIG_MAKEFILE(dlls/query)
 WINE_CONFIG_MAKEFILE(dlls/qwave)
+WINE_CONFIG_MAKEFILE(dlls/qwave/tests)
 WINE_CONFIG_MAKEFILE(dlls/rasapi16.dll16,enable_win16)
 WINE_CONFIG_MAKEFILE(dlls/rasapi32)
 WINE_CONFIG_MAKEFILE(dlls/rasapi32/tests)
diff --git a/dlls/qwave/Makefile.in b/dlls/qwave/Makefile.in
index 9de8224..5b4015c 100644
--- a/dlls/qwave/Makefile.in
+++ b/dlls/qwave/Makefile.in
@@ -1,4 +1,5 @@
 MODULE    = qwave.dll
+IMPORTLIB = qwave
 
 C_SRCS = \
 	main.c
diff --git a/dlls/qwave/main.c b/dlls/qwave/main.c
index ce1cfbd..6d77b29 100644
--- a/dlls/qwave/main.c
+++ b/dlls/qwave/main.c
@@ -1,5 +1,6 @@
 /*
  * Copyright 2018 Louis Lenders
+ * Copyright 2019 Vijay Kiran Kamuju
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -21,6 +22,7 @@
 
 #include "windef.h"
 #include "winbase.h"
+#include "qos2.h"
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(qwave);
@@ -39,3 +41,13 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD reason, LPVOID lpv)
     }
     return TRUE;
 }
+
+BOOL WINAPI QOSCreateHandle(PQOS_VERSION version, PHANDLE handle)
+{
+    FIXME("%p %p stub!\n", version, handle);
+    if (!version || !((version->MajorVersion == 1) && (version->MinorVersion == 0)) || !handle)
+        SetLastError(ERROR_INVALID_PARAMETER);
+    else
+        SetLastError(ERROR_SERVICE_ALREADY_RUNNING);
+    return FALSE;
+}
diff --git a/dlls/qwave/qwave.spec b/dlls/qwave/qwave.spec
index 27b07f5..94b62eb 100644
--- a/dlls/qwave/qwave.spec
+++ b/dlls/qwave/qwave.spec
@@ -3,7 +3,7 @@
 @ stub QOSAddSocketToFlow
 @ stub QOSCancel
 @ stub QOSCloseHandle
-@ stub QOSCreateHandle
+@ stdcall QOSCreateHandle(ptr ptr)
 @ stub QOSEnumerateFlows
 @ stub QOSNotifyFlow
 @ stub QOSQueryFlow
diff --git a/dlls/qwave/tests/Makefile.in b/dlls/qwave/tests/Makefile.in
new file mode 100644
index 0000000..713909b
--- /dev/null
+++ b/dlls/qwave/tests/Makefile.in
@@ -0,0 +1,5 @@
+TESTDLL   = qwave.dll
+IMPORTS   = qwave
+
+C_SRCS = \
+	qos.c
diff --git a/dlls/qwave/tests/qos.c b/dlls/qwave/tests/qos.c
new file mode 100644
index 0000000..5cb3e53
--- /dev/null
+++ b/dlls/qwave/tests/qos.c
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2019 Vijay Kiran Kamuju
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <windows.h>
+#include "qos2.h"
+
+#include "wine/test.h"
+
+static void test_QOSCreateHandle(void)
+{
+    QOS_VERSION ver;
+    HANDLE h;
+    BOOL ret;
+
+    SetLastError(0xdeadbeef);
+    ret = QOSCreateHandle(NULL, NULL);
+    ok(ret == FALSE, "Expected FALSE, got %d\n", ret);
+    ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
+
+    SetLastError(0xdeadbeef);
+    ret = QOSCreateHandle(&ver, NULL);
+    ok(ret == FALSE, "Expected FALSE, got %d\n", ret);
+    ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
+
+    SetLastError(0xdeadbeef);
+    ver.MajorVersion = 0;
+    ver.MinorVersion = 0;
+    ret = QOSCreateHandle(&ver, &h);
+    ok(ret == FALSE, "Expected FALSE, got %d\n", ret);
+    ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
+
+    SetLastError(0xdeadbeef);
+    ver.MajorVersion = 1;
+    ver.MinorVersion = 0;
+    ret = QOSCreateHandle(&ver, &h);
+    todo_wine ok(ret == TRUE, "Expected TRUE, got %d\n", ret);
+    todo_wine ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", GetLastError());
+
+    SetLastError(0xdeadbeef);
+    ver.MajorVersion = 1;
+    ver.MinorVersion = 5;
+    ret = QOSCreateHandle(&ver, &h);
+    ok(ret == FALSE, "Expected FALSE, got %d\n", ret);
+    ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
+
+    SetLastError(0xdeadbeef);
+    ver.MajorVersion = 2;
+    ver.MinorVersion = 0;
+    ret = QOSCreateHandle(&ver, &h);
+    ok(ret == FALSE, "Expected FALSE, got %d\n", ret);
+    ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
+}
+
+START_TEST(qos)
+{
+    test_QOSCreateHandle();
+}




More information about the wine-cvs mailing list