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@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Vijay Kiran Kamuju 2019-04-12 05:21:09 +02:00 committed by Alexandre Julliard
parent fb1695a254
commit 9c44ef5b56
7 changed files with 93 additions and 1 deletions

1
configure vendored
View File

@ -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/quartz/tests enable_tests
wine_fn_config_makefile dlls/query enable_query wine_fn_config_makefile dlls/query enable_query
wine_fn_config_makefile dlls/qwave enable_qwave 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/rasapi16.dll16 enable_win16
wine_fn_config_makefile dlls/rasapi32 enable_rasapi32 wine_fn_config_makefile dlls/rasapi32 enable_rasapi32
wine_fn_config_makefile dlls/rasapi32/tests enable_tests wine_fn_config_makefile dlls/rasapi32/tests enable_tests

View File

@ -3603,6 +3603,7 @@ WINE_CONFIG_MAKEFILE(dlls/quartz)
WINE_CONFIG_MAKEFILE(dlls/quartz/tests) WINE_CONFIG_MAKEFILE(dlls/quartz/tests)
WINE_CONFIG_MAKEFILE(dlls/query) WINE_CONFIG_MAKEFILE(dlls/query)
WINE_CONFIG_MAKEFILE(dlls/qwave) WINE_CONFIG_MAKEFILE(dlls/qwave)
WINE_CONFIG_MAKEFILE(dlls/qwave/tests)
WINE_CONFIG_MAKEFILE(dlls/rasapi16.dll16,enable_win16) WINE_CONFIG_MAKEFILE(dlls/rasapi16.dll16,enable_win16)
WINE_CONFIG_MAKEFILE(dlls/rasapi32) WINE_CONFIG_MAKEFILE(dlls/rasapi32)
WINE_CONFIG_MAKEFILE(dlls/rasapi32/tests) WINE_CONFIG_MAKEFILE(dlls/rasapi32/tests)

View File

@ -1,4 +1,5 @@
MODULE = qwave.dll MODULE = qwave.dll
IMPORTLIB = qwave
C_SRCS = \ C_SRCS = \
main.c main.c

View File

@ -1,5 +1,6 @@
/* /*
* Copyright 2018 Louis Lenders * Copyright 2018 Louis Lenders
* Copyright 2019 Vijay Kiran Kamuju
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,6 +22,7 @@
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "qos2.h"
#include "wine/debug.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(qwave); WINE_DEFAULT_DEBUG_CHANNEL(qwave);
@ -39,3 +41,13 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD reason, LPVOID lpv)
} }
return TRUE; 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;
}

View File

@ -3,7 +3,7 @@
@ stub QOSAddSocketToFlow @ stub QOSAddSocketToFlow
@ stub QOSCancel @ stub QOSCancel
@ stub QOSCloseHandle @ stub QOSCloseHandle
@ stub QOSCreateHandle @ stdcall QOSCreateHandle(ptr ptr)
@ stub QOSEnumerateFlows @ stub QOSEnumerateFlows
@ stub QOSNotifyFlow @ stub QOSNotifyFlow
@ stub QOSQueryFlow @ stub QOSQueryFlow

View File

@ -0,0 +1,5 @@
TESTDLL = qwave.dll
IMPORTS = qwave
C_SRCS = \
qos.c

72
dlls/qwave/tests/qos.c Normal file
View File

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