Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
June 2022
- 68 participants
- 3274 messages
[PATCH 3/4] httpapi: Stop setting group->url if add_url() fails.
by Julian Klemann
The URL should not be set if the URL cannot be added to a request queue.
Signed-off-by: Julian Klemann <jklemann(a)codeweavers.com>
---
dlls/httpapi/httpapi_main.c | 11 ++++++++---
dlls/httpapi/tests/httpapi.c | 4 ++--
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/dlls/httpapi/httpapi_main.c b/dlls/httpapi/httpapi_main.c
index 4d2d307ffcb..a5f8007b0a9 100644
--- a/dlls/httpapi/httpapi_main.c
+++ b/dlls/httpapi/httpapi_main.c
@@ -686,6 +686,7 @@ ULONG WINAPI HttpAddUrlToUrlGroup(HTTP_URL_GROUP_ID id, const WCHAR *url,
HTTP_URL_CONTEXT context, ULONG reserved)
{
struct url_group *group = get_url_group(id);
+ ULONG ret;
TRACE("id %s, url %s, context %s, reserved %#lx.\n", wine_dbgstr_longlong(id),
debugstr_w(url), wine_dbgstr_longlong(context), reserved);
@@ -696,13 +697,17 @@ ULONG WINAPI HttpAddUrlToUrlGroup(HTTP_URL_GROUP_ID id, const WCHAR *url,
return ERROR_CALL_NOT_IMPLEMENTED;
}
+ if (group->queue)
+ {
+ ret = add_url(group->queue, url, context);
+ if (ret)
+ return ret;
+ }
+
if (!(group->url = heap_strdupW(url)))
return ERROR_OUTOFMEMORY;
group->context = context;
- if (group->queue)
- return add_url(group->queue, url, context);
-
return ERROR_SUCCESS;
}
diff --git a/dlls/httpapi/tests/httpapi.c b/dlls/httpapi/tests/httpapi.c
index d231fd1d8ed..3c3f7abcd90 100644
--- a/dlls/httpapi/tests/httpapi.c
+++ b/dlls/httpapi/tests/httpapi.c
@@ -1268,8 +1268,8 @@ static void test_v2_bound_port(void)
s = socket(AF_INET, SOCK_STREAM, 0);
ret = connect(s, (struct sockaddr *)&sockaddr, sizeof(sockaddr));
- todo_wine ok(ret, "Connecting to socket succeeded, %lu.\n", GetLastError());
- todo_wine ok(GetLastError() == WSAECONNREFUSED, "Unexpected error connecting to socket, %lu.\n", GetLastError());
+ ok(ret, "Connecting to socket succeeded, %lu.\n", GetLastError());
+ ok(GetLastError() == WSAECONNREFUSED, "Unexpected error connecting to socket, %lu.\n", GetLastError());
closesocket(s);
ret = pHttpCloseRequestQueue(dummy_queue);
--
2.36.1
June 14, 2022
[PATCH 2/4] httpapi/tests: Add tests for when URLs fail to be added to a queue.
by Julian Klemann
If a queue is associated to a URL group and the URL cannot be added to
the queue, the URL should not be set in the group. In other cases, it
should be.
Signed-off-by: Julian Klemann <jklemann(a)codeweavers.com>
---
dlls/httpapi/tests/httpapi.c | 118 +++++++++++++++++++++++++++++++++++
1 file changed, 118 insertions(+)
diff --git a/dlls/httpapi/tests/httpapi.c b/dlls/httpapi/tests/httpapi.c
index 9d344f26d02..d231fd1d8ed 100644
--- a/dlls/httpapi/tests/httpapi.c
+++ b/dlls/httpapi/tests/httpapi.c
@@ -1218,6 +1218,122 @@ static void test_HttpCreateUrlGroup(void)
ok(!ret, "Unexpected return value %u.\n", ret);
}
+static void test_v2_bound_port(void)
+{
+ static const HTTPAPI_VERSION version = {2, 0};
+ struct sockaddr_in sockaddr;
+ HTTP_SERVER_SESSION_ID session;
+ HTTP_BINDING_INFO binding;
+ HTTP_URL_GROUP_ID group;
+ unsigned short port;
+ WCHAR url[50];
+ HANDLE queue, dummy_queue;
+ int ret;
+ SOCKET s, s2;
+
+ ret = pHttpCreateServerSession(version, &session, 0);
+ ok(!ret, "Failed to create session, error %u.\n", ret);
+ ret = pHttpCreateUrlGroup(session, &group, 0);
+ ok(!ret, "Failed to create URL group, error %u.\n", ret);
+
+ ret = pHttpCreateRequestQueue(version, NULL, NULL, 0, &queue);
+ ok(!ret, "Failed to create request queue, error %u.\n", ret);
+ ret = pHttpCreateRequestQueue(version, NULL, NULL, 0, &dummy_queue);
+ ok(!ret, "Failed to create request queue, error %u.\n", ret);
+ binding.Flags.Present = 1;
+ binding.RequestQueueHandle = queue;
+ ret = pHttpSetUrlGroupProperty(group, HttpServerBindingProperty, &binding, sizeof(binding));
+ ok(!ret, "Failed to bind request queue, error %u.\n", ret);
+
+ s2 = socket(AF_INET, SOCK_STREAM, 0);
+ sockaddr.sin_family = AF_INET;
+ sockaddr.sin_addr.S_un.S_addr = inet_addr("127.0.0.1");
+ for (port = 50000; port < 51000; ++port)
+ {
+ sockaddr.sin_port = htons(port);
+ ret = bind(s2, (struct sockaddr *)&sockaddr, sizeof(sockaddr));
+ if (!ret)
+ break;
+ }
+ ok(!ret, "Failed to bind to port\n");
+ swprintf(url, ARRAY_SIZE(url), L"http://localhost:%u/", port);
+ ret = pHttpAddUrlToUrlGroup(group, url, 0xdeadbeef, 0);
+ ok(ret == ERROR_SHARING_VIOLATION, "Unexpected failure adding %s, error %u.\n", debugstr_w(url), ret);
+ shutdown(s2, SD_BOTH);
+ closesocket(s2);
+
+ binding.RequestQueueHandle = dummy_queue;
+ ret = pHttpSetUrlGroupProperty(group, HttpServerBindingProperty, &binding, sizeof(binding));
+ ok(!ret, "Failed to rebind request queue, error %u.\n", ret);
+
+ s = socket(AF_INET, SOCK_STREAM, 0);
+ ret = connect(s, (struct sockaddr *)&sockaddr, sizeof(sockaddr));
+ todo_wine ok(ret, "Connecting to socket succeeded, %lu.\n", GetLastError());
+ todo_wine ok(GetLastError() == WSAECONNREFUSED, "Unexpected error connecting to socket, %lu.\n", GetLastError());
+
+ closesocket(s);
+ ret = pHttpCloseRequestQueue(dummy_queue);
+ ok(!ret, "Failed to close queue handle, error %u.\n", ret);
+ ret = pHttpCloseRequestQueue(queue);
+ ok(!ret, "Failed to close queue handle, error %u.\n", ret);
+ ret = pHttpCloseUrlGroup(group);
+ ok(!ret, "Failed to close group, error %u.\n", ret);
+ ret = pHttpCloseServerSession(session);
+ ok(!ret, "Failed to close group, error %u.\n", ret);
+}
+
+static void test_v2_queue_after_url(void)
+{
+ char DECLSPEC_ALIGN(8) req_buffer[2048];
+ HTTP_REQUEST_V2 *reqv2 = (HTTP_REQUEST_V2 *)req_buffer;
+ static const HTTPAPI_VERSION version = {2, 0};
+ HTTP_REQUEST_V1 *req = &reqv2->s;
+ HTTP_SERVER_SESSION_ID session;
+ HTTP_BINDING_INFO binding;
+ HTTP_URL_GROUP_ID group;
+ unsigned short port;
+ char req_text[100];
+ HANDLE queue;
+ int ret;
+ SOCKET s;
+
+ ret = pHttpCreateServerSession(version, &session, 0);
+ ok(!ret, "Failed to create session, error %u.\n", ret);
+ ret = pHttpCreateUrlGroup(session, &group, 0);
+ ok(!ret, "Failed to create URL group, error %u.\n", ret);
+
+ port = add_url_v2(group);
+
+ ret = pHttpCreateRequestQueue(version, NULL, NULL, 0, &queue);
+ ok(!ret, "Failed to create request queue, error %u.\n", ret);
+ binding.Flags.Present = 1;
+ binding.RequestQueueHandle = queue;
+ ret = pHttpSetUrlGroupProperty(group, HttpServerBindingProperty, &binding, sizeof(binding));
+ ok(!ret, "Failed to bind request queue, error %u.\n", ret);
+
+ s = create_client_socket(port);
+
+ sprintf(req_text, simple_req, port);
+ ret = send(s, req_text, strlen(req_text), 0);
+ ok(ret == strlen(req_text), "send() returned %d.\n", ret);
+
+ ret = HttpReceiveHttpRequest(queue, HTTP_NULL_ID, 0, (HTTP_REQUEST *)req, sizeof(req_buffer), NULL, NULL);
+ ok(!ret, "Got error %u.\n", ret);
+
+ ok(req->BytesReceived == strlen(req_text), "Got %s bytes.\n", wine_dbgstr_longlong(req->BytesReceived));
+
+ ret = remove_url_v2(group, port);
+ ok(!ret, "Got error %u.\n", ret);
+
+ closesocket(s);
+ ret = pHttpCloseRequestQueue(queue);
+ ok(!ret, "Failed to close queue handle, error %u.\n", ret);
+ ret = pHttpCloseUrlGroup(group);
+ ok(!ret, "Failed to close group, error %u.\n", ret);
+ ret = pHttpCloseServerSession(session);
+ ok(!ret, "Failed to close group, error %u.\n", ret);
+}
+
static void test_v2_server(void)
{
char DECLSPEC_ALIGN(8) req_buffer[2048], response_buffer[2048];
@@ -1538,6 +1654,8 @@ START_TEST(httpapi)
test_HttpCreateServerSession();
test_HttpCreateUrlGroup();
test_v2_server();
+ test_v2_queue_after_url();
+ test_v2_bound_port();
test_v2_completion_port();
ret = HttpTerminate(HTTP_INITIALIZE_SERVER, NULL);
--
2.36.1
June 14, 2022
[PATCH 1/4] httpapi/tests: Move sleep statement.
by Julian Klemann
The mentioned bug randomly occurred after some subsequent patches, so
the sleep should happen before GetOverlappedResult is called.
Signed-off-by: Julian Klemann <jklemann(a)codeweavers.com>
---
dlls/httpapi/tests/httpapi.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/httpapi/tests/httpapi.c b/dlls/httpapi/tests/httpapi.c
index be1d31c12ad..9d344f26d02 100644
--- a/dlls/httpapi/tests/httpapi.c
+++ b/dlls/httpapi/tests/httpapi.c
@@ -228,10 +228,6 @@ static void test_v1_server(void)
ret = send(s, req_text, strlen(req_text), 0);
ok(ret == strlen(req_text), "send() returned %d.\n", ret);
- ret = GetOverlappedResult(queue, &ovl, &ret_size, TRUE);
- ok(ret, "Got error %lu.\n", GetLastError());
- ok(ret_size > sizeof(*req), "Got size %lu.\n", ret_size);
-
/* Various versions of Windows (observed on 64-bit Windows 8 and Windows 10
* version 1507, but probably affecting others) suffer from a bug where the
* kernel will report success before completely filling the buffer or
@@ -239,6 +235,10 @@ static void test_v1_server(void)
* around this. */
Sleep(100);
+ ret = GetOverlappedResult(queue, &ovl, &ret_size, TRUE);
+ ok(ret, "Got error %lu.\n", GetLastError());
+ ok(ret_size > sizeof(*req), "Got size %lu.\n", ret_size);
+
ok(!req->Flags, "Got flags %#lx.\n", req->Flags);
ok(req->ConnectionId, "Expected nonzero connection ID.\n");
ok(req->RequestId, "Expected nonzero connection ID.\n");
--
2.36.1
June 14, 2022
Re: [PATCH v6 9/9] windows.media.speech: Add stub ISpeechSynthesisStream iface.
by Marvin
Hi,
It looks like your patch introduced the new failures shown below.
Please investigate and fix them if they are indeed new. Note that rare
failures and failures with always changing text (e.g. because of memory
addresses) can cause false positives. If this is what happened, then
fixing those would really help.
The full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=116992
Your paranoid android.
=== build (build log) ===
error: patch failed: include/windows.media.idl:23
error: patch failed: include/windows.media.idl:26
error: patch failed: include/windows.media.speechsynthesis.idl:54
error: patch failed: include/windows.media.speechsynthesis.idl:23
error: patch failed: dlls/windows.media.speech/tests/speech.c:331
error: patch failed: dlls/windows.media.speech/tests/speech.c:1122
error: patch failed: dlls/windows.media.speech/tests/speech.c:41
error: patch failed: dlls/windows.media.speech/synthesizer.c:241
error: patch failed: dlls/windows.media.speech/tests/speech.c:933
error: patch failed: dlls/windows.media.speech/synthesizer.c:254
error: patch failed: dlls/windows.media.speech/tests/speech.c:971
error: patch failed: dlls/windows.media.speech/synthesizer.c:146
error: patch failed: dlls/windows.media.speech/tests/speech.c:947
Task: Patch failed to apply
=== debian11 (build log) ===
error: patch failed: include/windows.media.idl:23
error: patch failed: include/windows.media.idl:26
error: patch failed: include/windows.media.speechsynthesis.idl:54
error: patch failed: include/windows.media.speechsynthesis.idl:23
error: patch failed: dlls/windows.media.speech/tests/speech.c:331
error: patch failed: dlls/windows.media.speech/tests/speech.c:1122
error: patch failed: dlls/windows.media.speech/tests/speech.c:41
error: patch failed: dlls/windows.media.speech/synthesizer.c:241
error: patch failed: dlls/windows.media.speech/tests/speech.c:933
error: patch failed: dlls/windows.media.speech/synthesizer.c:254
error: patch failed: dlls/windows.media.speech/tests/speech.c:971
error: patch failed: dlls/windows.media.speech/synthesizer.c:146
error: patch failed: dlls/windows.media.speech/tests/speech.c:947
Task: Patch failed to apply
=== debian11 (build log) ===
error: patch failed: include/windows.media.idl:23
error: patch failed: include/windows.media.idl:26
error: patch failed: include/windows.media.speechsynthesis.idl:54
error: patch failed: include/windows.media.speechsynthesis.idl:23
error: patch failed: dlls/windows.media.speech/tests/speech.c:331
error: patch failed: dlls/windows.media.speech/tests/speech.c:1122
error: patch failed: dlls/windows.media.speech/tests/speech.c:41
error: patch failed: dlls/windows.media.speech/synthesizer.c:241
error: patch failed: dlls/windows.media.speech/tests/speech.c:933
error: patch failed: dlls/windows.media.speech/synthesizer.c:254
error: patch failed: dlls/windows.media.speech/tests/speech.c:971
error: patch failed: dlls/windows.media.speech/synthesizer.c:146
error: patch failed: dlls/windows.media.speech/tests/speech.c:947
Task: Patch failed to apply
June 14, 2022
Re: [PATCH v6 8/9] windows.media.speech: Return IAsyncOperation from synthesizer_SynthesizeSsmlToStreamAsync.
by Marvin
Hi,
It looks like your patch introduced the new failures shown below.
Please investigate and fix them if they are indeed new. Note that rare
failures and failures with always changing text (e.g. because of memory
addresses) can cause false positives. If this is what happened, then
fixing those would really help.
The full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=116991
Your paranoid android.
=== debian11 (build log) ===
error: patch failed: include/windows.media.idl:23
error: patch failed: include/windows.media.idl:26
error: patch failed: include/windows.media.speechsynthesis.idl:54
error: patch failed: include/windows.media.speechsynthesis.idl:23
error: patch failed: dlls/windows.media.speech/tests/speech.c:331
error: patch failed: dlls/windows.media.speech/tests/speech.c:1122
error: patch failed: dlls/windows.media.speech/tests/speech.c:41
error: patch failed: dlls/windows.media.speech/synthesizer.c:241
error: patch failed: dlls/windows.media.speech/tests/speech.c:933
error: patch failed: dlls/windows.media.speech/synthesizer.c:254
error: patch failed: dlls/windows.media.speech/tests/speech.c:971
Task: Patch failed to apply
=== debian11 (build log) ===
error: patch failed: include/windows.media.idl:23
error: patch failed: include/windows.media.idl:26
error: patch failed: include/windows.media.speechsynthesis.idl:54
error: patch failed: include/windows.media.speechsynthesis.idl:23
error: patch failed: dlls/windows.media.speech/tests/speech.c:331
error: patch failed: dlls/windows.media.speech/tests/speech.c:1122
error: patch failed: dlls/windows.media.speech/tests/speech.c:41
error: patch failed: dlls/windows.media.speech/synthesizer.c:241
error: patch failed: dlls/windows.media.speech/tests/speech.c:933
error: patch failed: dlls/windows.media.speech/synthesizer.c:254
error: patch failed: dlls/windows.media.speech/tests/speech.c:971
Task: Patch failed to apply
June 14, 2022
Re: [PATCH v6 7/9] windows.media.speech: Return IAsyncOperation from synthesizer_SynthesizeTextToStreamAsync.
by Marvin
Hi,
It looks like your patch introduced the new failures shown below.
Please investigate and fix them if they are indeed new. Note that rare
failures and failures with always changing text (e.g. because of memory
addresses) can cause false positives. If this is what happened, then
fixing those would really help.
The full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=116990
Your paranoid android.
=== debian11 (build log) ===
error: patch failed: include/windows.media.idl:23
error: patch failed: include/windows.media.idl:26
error: patch failed: include/windows.media.speechsynthesis.idl:54
error: patch failed: include/windows.media.speechsynthesis.idl:23
error: patch failed: dlls/windows.media.speech/tests/speech.c:331
error: patch failed: dlls/windows.media.speech/tests/speech.c:1122
error: patch failed: dlls/windows.media.speech/tests/speech.c:41
error: patch failed: dlls/windows.media.speech/synthesizer.c:241
error: patch failed: dlls/windows.media.speech/tests/speech.c:933
Task: Patch failed to apply
=== debian11 (build log) ===
error: patch failed: include/windows.media.idl:23
error: patch failed: include/windows.media.idl:26
error: patch failed: include/windows.media.speechsynthesis.idl:54
error: patch failed: include/windows.media.speechsynthesis.idl:23
error: patch failed: dlls/windows.media.speech/tests/speech.c:331
error: patch failed: dlls/windows.media.speech/tests/speech.c:1122
error: patch failed: dlls/windows.media.speech/tests/speech.c:41
error: patch failed: dlls/windows.media.speech/synthesizer.c:241
error: patch failed: dlls/windows.media.speech/tests/speech.c:933
Task: Patch failed to apply
June 14, 2022
Re: [PATCH v6 6/9] windows.media.speech/tests: Add basic tests for ssml/text to stream functions.
by Marvin
Hi,
It looks like your patch introduced the new failures shown below.
Please investigate and fix them if they are indeed new. Note that rare
failures and failures with always changing text (e.g. because of memory
addresses) can cause false positives. If this is what happened, then
fixing those would really help.
The full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=116989
Your paranoid android.
=== debian11 (build log) ===
error: patch failed: include/windows.media.idl:23
error: patch failed: include/windows.media.idl:26
error: patch failed: include/windows.media.speechsynthesis.idl:54
error: patch failed: include/windows.media.speechsynthesis.idl:23
error: patch failed: dlls/windows.media.speech/tests/speech.c:331
error: patch failed: dlls/windows.media.speech/tests/speech.c:1122
error: patch failed: dlls/windows.media.speech/tests/speech.c:41
Task: Patch failed to apply
=== debian11 (build log) ===
error: patch failed: include/windows.media.idl:23
error: patch failed: include/windows.media.idl:26
error: patch failed: include/windows.media.speechsynthesis.idl:54
error: patch failed: include/windows.media.speechsynthesis.idl:23
error: patch failed: dlls/windows.media.speech/tests/speech.c:331
error: patch failed: dlls/windows.media.speech/tests/speech.c:1122
error: patch failed: dlls/windows.media.speech/tests/speech.c:41
Task: Patch failed to apply
June 14, 2022
Re: [PATCH v6 5/9] windows.media.speech/tests: Handle a possible race condition.
by Marvin
Hi,
It looks like your patch introduced the new failures shown below.
Please investigate and fix them if they are indeed new. Note that rare
failures and failures with always changing text (e.g. because of memory
addresses) can cause false positives. If this is what happened, then
fixing those would really help.
The full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=116988
Your paranoid android.
=== debian11 (build log) ===
error: patch failed: include/windows.media.idl:23
error: patch failed: include/windows.media.idl:26
error: patch failed: include/windows.media.speechsynthesis.idl:54
error: patch failed: include/windows.media.speechsynthesis.idl:23
error: patch failed: dlls/windows.media.speech/tests/speech.c:331
error: patch failed: dlls/windows.media.speech/tests/speech.c:1122
Task: Patch failed to apply
June 14, 2022
[PATCH v6 9/9] windows.media.speech: Add stub ISpeechSynthesisStream iface.
by Bernhard Kölbl
From: Bernhard Kölbl <besentv(a)gmail.com>
Based on a patch by Connor McAdams <cmcadams(a)codeweavers.com>
Silences a warning about narrator being broken in Forza Horizon 5.
Signed-off-by: Bernhard Kölbl <besentv(a)gmail.com>
---
dlls/windows.media.speech/synthesizer.c | 142 ++++++++++++++++++++++-
dlls/windows.media.speech/tests/speech.c | 37 +++---
2 files changed, 153 insertions(+), 26 deletions(-)
diff --git a/dlls/windows.media.speech/synthesizer.c b/dlls/windows.media.speech/synthesizer.c
index 7e1d19cb4c1..ce257c7c355 100644
--- a/dlls/windows.media.speech/synthesizer.c
+++ b/dlls/windows.media.speech/synthesizer.c
@@ -146,6 +146,140 @@ static struct voice_information_vector all_voices =
0
};
+/*
+ *
+ * ISpeechSynthesisStream
+ *
+ */
+
+struct synthesis_stream
+{
+ ISpeechSynthesisStream ISpeechSynthesisStream_iface;
+ LONG ref;
+
+ IVector_IMediaMarker *markers;
+};
+
+static inline struct synthesis_stream *impl_from_ISpeechSynthesisStream( ISpeechSynthesisStream *iface )
+{
+ return CONTAINING_RECORD(iface, struct synthesis_stream, ISpeechSynthesisStream_iface);
+}
+
+HRESULT WINAPI synthesis_stream_QueryInterface( ISpeechSynthesisStream *iface, REFIID iid, void **out )
+{
+ struct synthesis_stream *impl = impl_from_ISpeechSynthesisStream(iface);
+
+ TRACE("iface %p, iid %s, out %p stub!\n", iface, debugstr_guid(iid), out);
+
+ if (IsEqualGUID(iid, &IID_IUnknown) ||
+ IsEqualGUID(iid, &IID_IInspectable) ||
+ IsEqualGUID(iid, &IID_IAgileObject) ||
+ IsEqualGUID(iid, &IID_ISpeechSynthesisStream))
+ {
+ IInspectable_AddRef((*out = &impl->ISpeechSynthesisStream_iface));
+ return S_OK;
+ }
+
+ FIXME("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid));
+ *out = NULL;
+ return E_NOINTERFACE;
+}
+
+ULONG WINAPI synthesis_stream_AddRef( ISpeechSynthesisStream *iface )
+{
+ struct synthesis_stream *impl = impl_from_ISpeechSynthesisStream(iface);
+ ULONG ref = InterlockedIncrement(&impl->ref);
+ TRACE("iface %p, ref %lu.\n", iface, ref);
+ return ref;
+}
+
+ULONG WINAPI synthesis_stream_Release( ISpeechSynthesisStream *iface )
+{
+ struct synthesis_stream *impl = impl_from_ISpeechSynthesisStream(iface);
+ ULONG ref = InterlockedDecrement(&impl->ref);
+
+ TRACE("iface %p, ref %lu.\n", iface, ref);
+
+ if (!ref)
+ free(impl);
+
+ return ref;
+}
+
+HRESULT WINAPI synthesis_stream_GetIids( ISpeechSynthesisStream *iface, ULONG *iid_count, IID **iids )
+{
+ FIXME("iface %p, iid_count %p, iids %p stub.\n", iface, iid_count, iids);
+ return E_NOTIMPL;
+}
+
+HRESULT WINAPI synthesis_stream_GetRuntimeClassName( ISpeechSynthesisStream *iface, HSTRING *class_name )
+{
+ FIXME("iface %p, class_name %p stub.\n", iface, class_name);
+ return E_NOTIMPL;
+}
+
+HRESULT WINAPI synthesis_stream_GetTrustLevel( ISpeechSynthesisStream *iface, TrustLevel *trust_level )
+{
+ FIXME("iface %p, trust_level %p stub.\n", iface, trust_level);
+ return E_NOTIMPL;
+}
+
+HRESULT WINAPI synthesis_stream_get_Markers( ISpeechSynthesisStream *iface, IVectorView_IMediaMarker **value )
+{
+ struct synthesis_stream *impl = impl_from_ISpeechSynthesisStream(iface);
+ FIXME("iface %p, value %p stub!\n", iface, value);
+ return IVector_IMediaMarker_GetView(impl->markers, value);
+}
+
+static const struct ISpeechSynthesisStreamVtbl synthesis_stream_vtbl =
+{
+ /* IUnknown methods */
+ synthesis_stream_QueryInterface,
+ synthesis_stream_AddRef,
+ synthesis_stream_Release,
+ /* IInspectable methods */
+ synthesis_stream_GetIids,
+ synthesis_stream_GetRuntimeClassName,
+ synthesis_stream_GetTrustLevel,
+ /* ISpeechSynthesisStream methods */
+ synthesis_stream_get_Markers
+};
+
+
+static HRESULT synthesis_stream_create( ISpeechSynthesisStream **out )
+{
+ struct synthesis_stream *impl;
+ struct vector_iids markers_iids =
+ {
+ .iterable = &IID_IIterable_IMediaMarker,
+ .iterator = &IID_IIterator_IMediaMarker,
+ .vector = &IID_IVector_IMediaMarker,
+ .view = &IID_IVectorView_IMediaMarker,
+ };
+ HRESULT hr;
+
+ TRACE("out %p.\n", out);
+
+ if (!(impl = calloc(1, sizeof(*impl))))
+ {
+ *out = NULL;
+ return E_OUTOFMEMORY;
+ }
+
+ impl->ISpeechSynthesisStream_iface.lpVtbl = &synthesis_stream_vtbl;
+ impl->ref = 1;
+ if (FAILED(hr = vector_inspectable_create(&markers_iids, (IVector_IInspectable**)&impl->markers)))
+ goto error;
+
+ TRACE("created ISpeechSynthesisStream %p.\n", impl);
+ *out = &impl->ISpeechSynthesisStream_iface;
+ return S_OK;
+
+error:
+ free(impl);
+ return hr;
+}
+
/*
*
* SpeechSynthesizer runtimeclass
@@ -243,26 +377,26 @@ static HRESULT WINAPI synthesizer_GetTrustLevel( ISpeechSynthesizer *iface, Trus
static HRESULT CALLBACK text_to_stream_operation( IInspectable *invoker, IInspectable **result )
{
- return S_OK;
+ return synthesis_stream_create((ISpeechSynthesisStream **)result);
}
static HRESULT WINAPI synthesizer_SynthesizeTextToStreamAsync( ISpeechSynthesizer *iface, HSTRING text,
IAsyncOperation_SpeechSynthesisStream **operation )
{
- FIXME("iface %p, text %p, operation %p stub.\n", iface, text, operation);
+ TRACE("iface %p, text %p, operation %p.\n", iface, text, operation);
return async_operation_inspectable_create(&IID_IAsyncOperation_SpeechSynthesisStream, NULL,
text_to_stream_operation, (IAsyncOperation_IInspectable **)operation);
}
static HRESULT CALLBACK ssml_to_stream_operation( IInspectable *invoker, IInspectable **result )
{
- return S_OK;
+ return synthesis_stream_create((ISpeechSynthesisStream **)result);
}
static HRESULT WINAPI synthesizer_SynthesizeSsmlToStreamAsync( ISpeechSynthesizer *iface, HSTRING ssml,
IAsyncOperation_SpeechSynthesisStream **operation )
{
- FIXME("iface %p, text %p, operation %p stub.\n", iface, ssml, operation);
+ TRACE("iface %p, ssml %p, operation %p.\n", iface, ssml, operation);
return async_operation_inspectable_create(&IID_IAsyncOperation_SpeechSynthesisStream, NULL,
ssml_to_stream_operation, (IAsyncOperation_IInspectable **)operation);
}
diff --git a/dlls/windows.media.speech/tests/speech.c b/dlls/windows.media.speech/tests/speech.c
index bea3c5104b1..0d67c8b7cdb 100644
--- a/dlls/windows.media.speech/tests/speech.c
+++ b/dlls/windows.media.speech/tests/speech.c
@@ -947,22 +947,19 @@ static void test_SpeechSynthesizer(void)
check_interface(operation_ss_stream, &IID_IAgileObject, TRUE);
hr = IAsyncOperation_SpeechSynthesisStream_GetResults(operation_ss_stream, &ss_stream);
- todo_wine ok(hr == S_OK, "IAsyncOperation_SpeechSynthesisStream_GetResults failed, hr %#lx\n", hr);
+ ok(hr == S_OK, "IAsyncOperation_SpeechSynthesisStream_GetResults failed, hr %#lx\n", hr);
- if (hr == S_OK)
- {
- hr = ISpeechSynthesisStream_get_Markers(ss_stream, &media_markers);
- todo_wine ok(hr == S_OK, "ISpeechSynthesisStream_get_Markers failed, hr %#lx\n", hr);
- check_interface(media_markers, &IID_IVectorView_IMediaMarker, TRUE);
- check_interface(media_markers, &IID_IIterable_IMediaMarker, TRUE);
- check_interface(media_markers, &IID_IAgileObject, TRUE);
+ hr = ISpeechSynthesisStream_get_Markers(ss_stream, &media_markers);
+ ok(hr == S_OK, "ISpeechSynthesisStream_get_Markers failed, hr %#lx\n", hr);
+ check_interface(media_markers, &IID_IVectorView_IMediaMarker, TRUE);
+ check_interface(media_markers, &IID_IIterable_IMediaMarker, TRUE);
+ check_interface(media_markers, &IID_IAgileObject, TRUE);
- ref = IVectorView_IMediaMarker_Release(media_markers);
- todo_wine ok(ref == 0, "Got unexpected ref %lu.\n", ref);
+ ref = IVectorView_IMediaMarker_Release(media_markers);
+ ok(ref == 0, "Got unexpected ref %lu.\n", ref);
- ref = ISpeechSynthesisStream_Release(ss_stream);
- todo_wine ok(ref == 0, "Got unexpected ref %lu.\n", ref);
- }
+ ref = ISpeechSynthesisStream_Release(ss_stream);
+ ok(ref == 0, "Got unexpected ref %lu.\n", ref);
IAsyncOperation_SpeechSynthesisStream_Release(operation_ss_stream);
@@ -981,16 +978,12 @@ static void test_SpeechSynthesizer(void)
check_interface(operation_ss_stream, &IID_IAgileObject, TRUE);
hr = IAsyncOperation_SpeechSynthesisStream_GetResults(operation_ss_stream, &ss_stream);
- todo_wine ok(hr == S_OK, "IAsyncOperation_SpeechSynthesisStream_GetResults failed, hr %#lx\n", hr);
+ ok(hr == S_OK, "IAsyncOperation_SpeechSynthesisStream_GetResults failed, hr %#lx\n", hr);
+ check_interface(ss_stream, &IID_ISpeechSynthesisStream, TRUE);
+ check_interface(ss_stream, &IID_IAgileObject, TRUE);
- if (hr == S_OK)
- {
- check_interface(ss_stream, &IID_ISpeechSynthesisStream, TRUE);
- check_interface(ss_stream, &IID_IAgileObject, TRUE);
-
- ref = ISpeechSynthesisStream_Release(ss_stream);
- ok(ref == 0, "Got unexpected ref %lu.\n", ref);
- }
+ ref = ISpeechSynthesisStream_Release(ss_stream);
+ ok(ref == 0, "Got unexpected ref %lu.\n", ref);
IAsyncOperation_SpeechSynthesisStream_Release(operation_ss_stream);
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/217
June 14, 2022
[PATCH v6 8/9] windows.media.speech: Return IAsyncOperation from synthesizer_SynthesizeSsmlToStreamAsync.
by Bernhard Kölbl
From: Bernhard Kölbl <besentv(a)gmail.com>
Based on a patch by Connor McAdams <cmcadams(a)codeweavers.com>
Signed-off-by: Bernhard Kölbl <besentv(a)gmail.com>
---
dlls/windows.media.speech/synthesizer.c | 8 +++++++-
dlls/windows.media.speech/tests/speech.c | 16 +++++++---------
2 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/dlls/windows.media.speech/synthesizer.c b/dlls/windows.media.speech/synthesizer.c
index 3a77fc62234..7e1d19cb4c1 100644
--- a/dlls/windows.media.speech/synthesizer.c
+++ b/dlls/windows.media.speech/synthesizer.c
@@ -254,11 +254,17 @@ static HRESULT WINAPI synthesizer_SynthesizeTextToStreamAsync( ISpeechSynthesize
text_to_stream_operation, (IAsyncOperation_IInspectable **)operation);
}
+static HRESULT CALLBACK ssml_to_stream_operation( IInspectable *invoker, IInspectable **result )
+{
+ return S_OK;
+}
+
static HRESULT WINAPI synthesizer_SynthesizeSsmlToStreamAsync( ISpeechSynthesizer *iface, HSTRING ssml,
IAsyncOperation_SpeechSynthesisStream **operation )
{
FIXME("iface %p, text %p, operation %p stub.\n", iface, ssml, operation);
- return E_NOTIMPL;
+ return async_operation_inspectable_create(&IID_IAsyncOperation_SpeechSynthesisStream, NULL,
+ ssml_to_stream_operation, (IAsyncOperation_IInspectable **)operation);
}
static HRESULT WINAPI synthesizer_put_Voice( ISpeechSynthesizer *iface, IVoiceInformation *value )
diff --git a/dlls/windows.media.speech/tests/speech.c b/dlls/windows.media.speech/tests/speech.c
index c9898b2cc03..bea3c5104b1 100644
--- a/dlls/windows.media.speech/tests/speech.c
+++ b/dlls/windows.media.speech/tests/speech.c
@@ -971,8 +971,7 @@ static void test_SpeechSynthesizer(void)
ok(hr == S_OK, "WindowsCreateString failed, hr %#lx\n", hr);
hr = ISpeechSynthesizer_SynthesizeSsmlToStreamAsync(synthesizer, str2, &operation_ss_stream);
- todo_wine ok(hr == S_OK, "ISpeechSynthesizer_SynthesizeSsmlToStreamAsync failed, hr %#lx\n", hr);
- if(FAILED(hr)) goto skip_ss_stream;
+ ok(hr == S_OK, "ISpeechSynthesizer_SynthesizeSsmlToStreamAsync failed, hr %#lx\n", hr);
await_async_inspectable((IAsyncOperation_IInspectable *)operation_ss_stream,
&async_inspectable_handler,
@@ -998,28 +997,27 @@ static void test_SpeechSynthesizer(void)
operation_ss_stream = (void *)0xdeadbeef;
hr = ISpeechSynthesizer_SynthesizeSsmlToStreamAsync(synthesizer, NULL, &operation_ss_stream);
/* Broken on Win 8 + 8.1 */
- todo_wine ok(hr == S_OK || broken(hr == E_INVALIDARG), "ISpeechSynthesizer_SynthesizeSsmlToStreamAsync failed, hr %#lx\n", hr);
+ ok(hr == S_OK || broken(hr == E_INVALIDARG), "ISpeechSynthesizer_SynthesizeSsmlToStreamAsync failed, hr %#lx\n", hr);
if (hr == S_OK)
{
- todo_wine ok(!!operation_ss_stream, "operation_ss_stream had value %p.\n", operation_ss_stream);
+ ok(!!operation_ss_stream, "operation_ss_stream had value %p.\n", operation_ss_stream);
IAsyncOperation_SpeechSynthesisStream_Release(operation_ss_stream);
}
- else todo_wine ok(operation_ss_stream == NULL, "operation_ss_stream had value %p.\n", operation_ss_stream);
+ else ok(operation_ss_stream == NULL, "operation_ss_stream had value %p.\n", operation_ss_stream);
operation_ss_stream = (void *)0xdeadbeef;
hr = ISpeechSynthesizer_SynthesizeSsmlToStreamAsync(synthesizer, str, &operation_ss_stream);
/* Broken on Win 8 + 8.1 */
- todo_wine ok(hr == S_OK || broken(hr == SPERR_WINRT_INCORRECT_FORMAT), "ISpeechSynthesizer_SynthesizeSsmlToStreamAsync failed, hr %#lx\n", hr);
+ ok(hr == S_OK || broken(hr == SPERR_WINRT_INCORRECT_FORMAT), "ISpeechSynthesizer_SynthesizeSsmlToStreamAsync failed, hr %#lx\n", hr);
if (hr == S_OK)
{
- todo_wine ok(!!operation_ss_stream, "operation_ss_stream had value %p.\n", operation_ss_stream);
+ ok(!!operation_ss_stream, "operation_ss_stream had value %p.\n", operation_ss_stream);
IAsyncOperation_SpeechSynthesisStream_Release(operation_ss_stream);
}
- else todo_wine ok(operation_ss_stream == NULL, "operation_ss_stream had value %p.\n", operation_ss_stream);
+ else ok(operation_ss_stream == NULL, "operation_ss_stream had value %p.\n", operation_ss_stream);
-skip_ss_stream:
WindowsDeleteString(str2);
WindowsDeleteString(str);
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/217
June 14, 2022