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
November 2021
- 83 participants
- 2620 messages
[PATCH 5/5] winegstreamer: Implement IWMOutputMediaProps::GetType().
by Zebediah Figura
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
dlls/winegstreamer/wm_reader.c | 8 ++++++--
dlls/wmvcore/tests/wmvcore.c | 30 +++++++++++++++++++++++++++---
2 files changed, 33 insertions(+), 5 deletions(-)
diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c
index b9e1a1b3d03..bcae50e5d1e 100644
--- a/dlls/winegstreamer/wm_reader.c
+++ b/dlls/winegstreamer/wm_reader.c
@@ -85,8 +85,12 @@ static ULONG WINAPI output_props_Release(IWMOutputMediaProps *iface)
static HRESULT WINAPI output_props_GetType(IWMOutputMediaProps *iface, GUID *major_type)
{
- FIXME("iface %p, major_type %p, stub!\n", iface, major_type);
- return E_NOTIMPL;
+ const struct output_props *props = impl_from_IWMOutputMediaProps(iface);
+
+ TRACE("iface %p, major_type %p.\n", iface, major_type);
+
+ *major_type = props->mt.majortype;
+ return S_OK;
}
static HRESULT WINAPI output_props_GetMediaType(IWMOutputMediaProps *iface, WM_MEDIA_TYPE *mt, DWORD *size)
diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c
index 12f8cbf53a2..dc479be0d57 100644
--- a/dlls/wmvcore/tests/wmvcore.c
+++ b/dlls/wmvcore/tests/wmvcore.c
@@ -861,12 +861,12 @@ static void test_sync_reader_types(void)
bool got_video = false, got_audio = false;
DWORD size, ret_size, output_number;
WORD stream_number, stream_number2;
+ GUID majortype, majortype2;
struct teststream stream;
IWMStreamConfig *config;
ULONG count, ref, i, j;
IWMSyncReader *reader;
IWMProfile *profile;
- GUID majortype;
HANDLE file;
HRESULT hr;
BOOL ret;
@@ -923,6 +923,12 @@ static void test_sync_reader_types(void)
hr = IWMOutputMediaProps_GetMediaType(output_props, mt, &ret_size);
ok(hr == S_OK, "Got hr %#x.\n", hr);
+ memset(&majortype2, 0xcc, sizeof(majortype2));
+ hr = IWMOutputMediaProps_GetType(output_props, &majortype2);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(IsEqualGUID(&majortype2, &majortype), "Expected major type %s, got %s.\n",
+ debugstr_guid(&majortype), debugstr_guid(&majortype2));
+
ref = IWMOutputMediaProps_Release(output_props);
ok(!ref, "Got outstanding refcount %d.\n", ref);
@@ -981,6 +987,12 @@ static void test_sync_reader_types(void)
else
check_video_type(mt);
+ memset(&majortype2, 0xcc, sizeof(majortype2));
+ hr = IWMOutputMediaProps_GetType(output_props, &majortype2);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(IsEqualGUID(&majortype2, &majortype), "Expected major type %s, got %s.\n",
+ debugstr_guid(&majortype), debugstr_guid(&majortype2));
+
hr = IWMSyncReader_SetOutputProps(reader, output_number, output_props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IWMSyncReader_SetOutputProps(reader, 1 - output_number, output_props);
@@ -1398,13 +1410,13 @@ static void test_async_reader_types(void)
bool got_video = false, got_audio = false;
DWORD size, ret_size, output_number;
IWMReaderAdvanced2 *advanced;
+ GUID majortype, majortype2;
struct teststream stream;
struct callback callback;
IWMStreamConfig *config;
ULONG count, ref, i, j;
IWMProfile *profile;
IWMReader *reader;
- GUID majortype;
HANDLE file;
HRESULT hr;
BOOL ret;
@@ -1458,11 +1470,17 @@ static void test_async_reader_types(void)
ret_size = sizeof(mt_buffer);
hr = IWMOutputMediaProps_GetMediaType(output_props, mt, &ret_size);
ok(hr == S_OK, "Got hr %#x.\n", hr);
+ majortype = mt->majortype;
+
+ memset(&majortype2, 0xcc, sizeof(majortype2));
+ hr = IWMOutputMediaProps_GetType(output_props, &majortype2);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(IsEqualGUID(&majortype2, &majortype), "Expected major type %s, got %s.\n",
+ debugstr_guid(&majortype), debugstr_guid(&majortype2));
ref = IWMOutputMediaProps_Release(output_props);
ok(!ref, "Got outstanding refcount %d.\n", ref);
- majortype = mt->majortype;
if (IsEqualGUID(&majortype, &MEDIATYPE_Audio))
{
got_audio = true;
@@ -1538,6 +1556,12 @@ static void test_async_reader_types(void)
else
check_video_type(mt);
+ memset(&majortype2, 0xcc, sizeof(majortype2));
+ hr = IWMOutputMediaProps_GetType(output_props, &majortype2);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(IsEqualGUID(&majortype2, &majortype), "Expected major type %s, got %s.\n",
+ debugstr_guid(&majortype), debugstr_guid(&majortype2));
+
hr = IWMReader_SetOutputProps(reader, output_number, output_props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IWMReader_SetOutputProps(reader, 1 - output_number, output_props);
--
2.33.0
Nov. 8, 2021
[PATCH 4/5] winegstreamer: Implement IWMReader::Open().
by Zebediah Figura
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
dlls/winegstreamer/wm_asyncreader.c | 19 +++++++---
dlls/wmvcore/tests/wmvcore.c | 55 +++++++++++++++++++++++++++++
2 files changed, 70 insertions(+), 4 deletions(-)
diff --git a/dlls/winegstreamer/wm_asyncreader.c b/dlls/winegstreamer/wm_asyncreader.c
index 4193d7d75de..b7b96c8b884 100644
--- a/dlls/winegstreamer/wm_asyncreader.c
+++ b/dlls/winegstreamer/wm_asyncreader.c
@@ -188,11 +188,22 @@ static ULONG WINAPI WMReader_Release(IWMReader *iface)
return IWMProfile3_Release(&reader->reader.IWMProfile3_iface);
}
-static HRESULT WINAPI WMReader_Open(IWMReader *iface, const WCHAR *url, IWMReaderCallback *callback, void *context)
+static HRESULT WINAPI WMReader_Open(IWMReader *iface, const WCHAR *url,
+ IWMReaderCallback *callback, void *context)
{
- struct async_reader *This = impl_from_IWMReader(iface);
- FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(url), callback, context);
- return E_NOTIMPL;
+ struct async_reader *reader = impl_from_IWMReader(iface);
+ HRESULT hr;
+
+ TRACE("reader %p, url %s, callback %p, context %p.\n",
+ reader, debugstr_w(url), callback, context);
+
+ EnterCriticalSection(&reader->reader.cs);
+
+ if (SUCCEEDED(hr = wm_reader_open_file(&reader->reader, url)))
+ open_stream(reader, callback, context);
+
+ LeaveCriticalSection(&reader->reader.cs);
+ return hr;
}
static HRESULT WINAPI WMReader_Close(IWMReader *iface)
diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c
index f8962b784ac..12f8cbf53a2 100644
--- a/dlls/wmvcore/tests/wmvcore.c
+++ b/dlls/wmvcore/tests/wmvcore.c
@@ -1613,6 +1613,60 @@ static void test_async_reader_types(void)
ok(ret, "Failed to delete %s, error %u.\n", debugstr_w(filename), GetLastError());
}
+static void test_async_reader_file(void)
+{
+ const WCHAR *filename = load_resource(L"test.wmv");
+ struct callback callback;
+ IWMReader *reader;
+ DWORD count;
+ HRESULT hr;
+ ULONG ref;
+ BOOL ret;
+
+ callback_init(&callback);
+
+ hr = WMCreateReader(NULL, 0, &reader);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IWMReader_Open(reader, filename, &callback.IWMReaderCallback_iface, (void **)0xdeadbeef);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(callback.refcount > 1, "Got refcount %d.\n", callback.refcount);
+ ret = WaitForSingleObject(callback.got_opened, 1000);
+ ok(!ret, "Wait timed out.\n");
+
+ count = 0xdeadbeef;
+ hr = IWMReader_GetOutputCount(reader, &count);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(count == 2, "Got count %u.\n", count);
+
+ hr = IWMReader_Start(reader, 0, 0, 1.0f, (void *)0xfacade);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IWMReader_Close(reader);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(callback.got_closed == 1, "Got %u WMT_CLOSED callbacks.\n", callback.got_closed);
+ ok(callback.refcount == 1, "Got outstanding refcount %d.\n", callback.refcount);
+ callback_cleanup(&callback);
+
+ hr = IWMReader_Close(reader);
+ ok(hr == NS_E_INVALID_REQUEST, "Got hr %#x.\n", hr);
+
+ hr = IWMReader_Open(reader, filename, &callback.IWMReaderCallback_iface, (void **)0xdeadbeef);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(callback.refcount > 1, "Got refcount %d.\n", callback.refcount);
+ ret = WaitForSingleObject(callback.got_opened, 1000);
+ ok(!ret, "Wait timed out.\n");
+
+ ref = IWMReader_Release(reader);
+ ok(!ref, "Got outstanding refcount %d.\n", ref);
+ ok(callback.got_closed == 1, "Got %u WMT_CLOSED callbacks.\n", callback.got_closed);
+ ok(callback.refcount == 1, "Got outstanding refcount %d.\n", callback.refcount);
+ callback_cleanup(&callback);
+
+ ret = DeleteFileW(filename);
+ ok(ret, "Failed to delete %s, error %u.\n", debugstr_w(filename), GetLastError());
+}
+
START_TEST(wmvcore)
{
HRESULT hr;
@@ -1634,6 +1688,7 @@ START_TEST(wmvcore)
test_sync_reader_file();
test_async_reader_streaming();
test_async_reader_types();
+ test_async_reader_file();
CoUninitialize();
}
--
2.33.0
Nov. 8, 2021
[PATCH 3/5] winegstreamer: Implement INSSBuffer::SetLength().
by Zebediah Figura
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
dlls/winegstreamer/wm_reader.c | 17 ++++++++++++-----
dlls/wmvcore/tests/wmvcore.c | 22 ++++++++++++++++++++++
2 files changed, 34 insertions(+), 5 deletions(-)
diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c
index 2c0f89e29a9..b9e1a1b3d03 100644
--- a/dlls/winegstreamer/wm_reader.c
+++ b/dlls/winegstreamer/wm_reader.c
@@ -172,7 +172,7 @@ struct buffer
INSSBuffer INSSBuffer_iface;
LONG refcount;
- DWORD size;
+ DWORD size, capacity;
BYTE data[1];
};
@@ -231,8 +231,15 @@ static HRESULT WINAPI buffer_GetLength(INSSBuffer *iface, DWORD *size)
static HRESULT WINAPI buffer_SetLength(INSSBuffer *iface, DWORD size)
{
- FIXME("iface %p, size %u, stub!\n", iface, size);
- return E_NOTIMPL;
+ struct buffer *buffer = impl_from_INSSBuffer(iface);
+
+ TRACE("iface %p, size %u.\n", buffer, size);
+
+ if (size > buffer->capacity)
+ return E_INVALIDARG;
+
+ buffer->size = size;
+ return S_OK;
}
static HRESULT WINAPI buffer_GetMaxLength(INSSBuffer *iface, DWORD *size)
@@ -241,7 +248,7 @@ static HRESULT WINAPI buffer_GetMaxLength(INSSBuffer *iface, DWORD *size)
TRACE("buffer %p, size %p.\n", buffer, size);
- *size = buffer->size;
+ *size = buffer->capacity;
return S_OK;
}
@@ -1754,7 +1761,7 @@ HRESULT wm_reader_get_stream_sample(struct wm_stream *stream,
object->INSSBuffer_iface.lpVtbl = &buffer_vtbl;
object->refcount = 1;
- object->size = event.u.buffer.size;
+ object->capacity = object->size = event.u.buffer.size;
if (!wg_parser_stream_copy_buffer(wg_stream, object->data, 0, object->size))
{
diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c
index 0347195ba10..f8962b784ac 100644
--- a/dlls/wmvcore/tests/wmvcore.c
+++ b/dlls/wmvcore/tests/wmvcore.c
@@ -686,6 +686,17 @@ static void test_sync_reader_streaming(void)
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(size <= capacity, "Size %u exceeds capacity %u.\n", size, capacity);
+ hr = INSSBuffer_SetLength(sample, capacity + 1);
+ ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
+
+ hr = INSSBuffer_SetLength(sample, capacity - 1);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = INSSBuffer_GetBufferAndLength(sample, &data2, &size);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(data2 == data, "Data pointers didn't match.\n");
+ ok(size == capacity - 1, "Expected size %u, got %u.\n", capacity - 1, size);
+
ref = INSSBuffer_Release(sample);
ok(!ref, "Got outstanding refcount %d.\n", ref);
@@ -1222,6 +1233,17 @@ static HRESULT WINAPI callback_OnSample(IWMReaderCallback *iface, DWORD output,
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(size <= capacity, "Size %u exceeds capacity %u.\n", size, capacity);
+ hr = INSSBuffer_SetLength(sample, capacity + 1);
+ ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
+
+ hr = INSSBuffer_SetLength(sample, capacity - 1);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = INSSBuffer_GetBufferAndLength(sample, &data2, &size);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(data2 == data, "Data pointers didn't match.\n");
+ ok(size == capacity - 1, "Expected size %u, got %u.\n", capacity - 1, size);
+
ok(callback->got_started > 0, "Got %u WMT_STARTED callbacks.\n", callback->got_started);
ok(!callback->got_eof, "Got %u WMT_EOF callbacks.\n", callback->got_eof);
++callback->got_sample;
--
2.33.0
Nov. 8, 2021
[PATCH 2/5] winegstreamer: Implement INSSBuffer::GetMaxLength().
by Zebediah Figura
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
dlls/winegstreamer/wm_reader.c | 8 ++++++--
dlls/wmvcore/tests/wmvcore.c | 16 ++++++++++++++--
2 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c
index 2de0610165d..2c0f89e29a9 100644
--- a/dlls/winegstreamer/wm_reader.c
+++ b/dlls/winegstreamer/wm_reader.c
@@ -237,8 +237,12 @@ static HRESULT WINAPI buffer_SetLength(INSSBuffer *iface, DWORD size)
static HRESULT WINAPI buffer_GetMaxLength(INSSBuffer *iface, DWORD *size)
{
- FIXME("iface %p, size %p, stub!\n", iface, size);
- return E_NOTIMPL;
+ struct buffer *buffer = impl_from_INSSBuffer(iface);
+
+ TRACE("buffer %p, size %p.\n", buffer, size);
+
+ *size = buffer->size;
+ return S_OK;
}
static HRESULT WINAPI buffer_GetBuffer(INSSBuffer *iface, BYTE **data)
diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c
index 685dd92e27e..0347195ba10 100644
--- a/dlls/wmvcore/tests/wmvcore.c
+++ b/dlls/wmvcore/tests/wmvcore.c
@@ -591,7 +591,7 @@ static void test_reader_attributes(IWMProfile *profile)
static void test_sync_reader_streaming(void)
{
- DWORD size, flags, output_number, expect_output_number;
+ DWORD size, capacity, flags, output_number, expect_output_number;
const WCHAR *filename = load_resource(L"test.wmv");
WORD stream_numbers[2], stream_number;
IWMStreamConfig *config, *config2;
@@ -682,6 +682,10 @@ static void test_sync_reader_streaming(void)
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(data2 == data, "Data pointers didn't match.\n");
+ hr = INSSBuffer_GetMaxLength(sample, &capacity);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(size <= capacity, "Size %u exceeds capacity %u.\n", size, capacity);
+
ref = INSSBuffer_Release(sample);
ok(!ref, "Got outstanding refcount %d.\n", ref);
@@ -747,6 +751,10 @@ static void test_sync_reader_streaming(void)
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(data2 == data, "Data pointers didn't match.\n");
+ hr = INSSBuffer_GetMaxLength(sample, &capacity);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(size <= capacity, "Size %u exceeds capacity %u.\n", size, capacity);
+
ref = INSSBuffer_Release(sample);
ok(!ref, "Got outstanding refcount %d.\n", ref);
}
@@ -1193,9 +1201,9 @@ static HRESULT WINAPI callback_OnSample(IWMReaderCallback *iface, DWORD output,
QWORD time, QWORD duration, DWORD flags, INSSBuffer *sample, void *context)
{
struct callback *callback = impl_from_IWMReaderCallback(iface);
+ DWORD size, capacity;
BYTE *data, *data2;
HRESULT hr;
- DWORD size;
if (winetest_debug > 1)
trace("%u: %04x: IWMReaderCallback::OnSample(output %u, time %I64u, duration %I64u, flags %#x)\n",
@@ -1210,6 +1218,10 @@ static HRESULT WINAPI callback_OnSample(IWMReaderCallback *iface, DWORD output,
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(data2 == data, "Data pointers didn't match.\n");
+ hr = INSSBuffer_GetMaxLength(sample, &capacity);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(size <= capacity, "Size %u exceeds capacity %u.\n", size, capacity);
+
ok(callback->got_started > 0, "Got %u WMT_STARTED callbacks.\n", callback->got_started);
ok(!callback->got_eof, "Got %u WMT_EOF callbacks.\n", callback->got_eof);
++callback->got_sample;
--
2.33.0
Nov. 8, 2021
[PATCH 1/5] winegstreamer: Implement INSSBuffer::GetBuffer().
by Zebediah Figura
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
dlls/winegstreamer/wm_reader.c | 8 ++++++--
dlls/wmvcore/tests/wmvcore.c | 18 ++++++++++++++++--
2 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c
index 12d1f04c270..2de0610165d 100644
--- a/dlls/winegstreamer/wm_reader.c
+++ b/dlls/winegstreamer/wm_reader.c
@@ -243,8 +243,12 @@ static HRESULT WINAPI buffer_GetMaxLength(INSSBuffer *iface, DWORD *size)
static HRESULT WINAPI buffer_GetBuffer(INSSBuffer *iface, BYTE **data)
{
- FIXME("iface %p, data %p, stub!\n", iface, data);
- return E_NOTIMPL;
+ struct buffer *buffer = impl_from_INSSBuffer(iface);
+
+ TRACE("buffer %p, data %p.\n", buffer, data);
+
+ *data = buffer->data;
+ return S_OK;
}
static HRESULT WINAPI buffer_GetBufferAndLength(INSSBuffer *iface, BYTE **data, DWORD *size)
diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c
index 0e7c6380c92..685dd92e27e 100644
--- a/dlls/wmvcore/tests/wmvcore.c
+++ b/dlls/wmvcore/tests/wmvcore.c
@@ -602,9 +602,9 @@ static void test_sync_reader_streaming(void)
IWMProfile *profile;
QWORD pts, duration;
INSSBuffer *sample;
+ BYTE *data, *data2;
HANDLE file;
HRESULT hr;
- BYTE *data;
BOOL ret;
file = CreateFileW(filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, 0);
@@ -677,6 +677,11 @@ static void test_sync_reader_streaming(void)
{
hr = INSSBuffer_GetBufferAndLength(sample, &data, &size);
ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = INSSBuffer_GetBuffer(sample, &data2);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(data2 == data, "Data pointers didn't match.\n");
+
ref = INSSBuffer_Release(sample);
ok(!ref, "Got outstanding refcount %d.\n", ref);
@@ -737,6 +742,11 @@ static void test_sync_reader_streaming(void)
{
hr = INSSBuffer_GetBufferAndLength(sample, &data, &size);
ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = INSSBuffer_GetBuffer(sample, &data2);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(data2 == data, "Data pointers didn't match.\n");
+
ref = INSSBuffer_Release(sample);
ok(!ref, "Got outstanding refcount %d.\n", ref);
}
@@ -1183,9 +1193,9 @@ static HRESULT WINAPI callback_OnSample(IWMReaderCallback *iface, DWORD output,
QWORD time, QWORD duration, DWORD flags, INSSBuffer *sample, void *context)
{
struct callback *callback = impl_from_IWMReaderCallback(iface);
+ BYTE *data, *data2;
HRESULT hr;
DWORD size;
- BYTE *data;
if (winetest_debug > 1)
trace("%u: %04x: IWMReaderCallback::OnSample(output %u, time %I64u, duration %I64u, flags %#x)\n",
@@ -1196,6 +1206,10 @@ static HRESULT WINAPI callback_OnSample(IWMReaderCallback *iface, DWORD output,
hr = INSSBuffer_GetBufferAndLength(sample, &data, &size);
ok(hr == S_OK, "Got hr %#x.\n", hr);
+ hr = INSSBuffer_GetBuffer(sample, &data2);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(data2 == data, "Data pointers didn't match.\n");
+
ok(callback->got_started > 0, "Got %u WMT_STARTED callbacks.\n", callback->got_started);
ok(!callback->got_eof, "Got %u WMT_EOF callbacks.\n", callback->got_eof);
++callback->got_sample;
--
2.33.0
Nov. 8, 2021
Re: [PATCH v3 2/3] mshtml: Implement inline attributes parsing for createElement.
by Jacek Caban
On 11/7/21 2:38 PM, Gabriel Ivăncescu wrote:
> On 06/11/2021 21:19, Jacek Caban wrote:
>> On 11/6/21 2:46 PM, Gabriel Ivăncescu wrote:
>>> I thought of another idea, which I don't think is necessarily
>>> better, but maybe it's worth a thought.
>>>
>>> We could iterate through a bunch of root context tags, namely
>>> <template>, <head> and <html> in that order, then use setInnerHTML
>>> on them and retrieve the first child, until we get a child and then
>>> use that if we did.
>>>
>>> I guess <html> context might be tricky here, since it can be either
>>> <head> or <body> tag that is parsed, might need some special casing
>>> (and retrieve either first or second child in such case, perhaps we
>>> can just check the first letter since other tags should already work
>>> in either <template> or <head> themselves—so would have been
>>> filtered already).
>>>
>>> Just an idea. Is it worth pursuing?
>>
>>
>> The whole thing is still too hacky, in my opinion. If we can't get
>> Gecko to do what we need, maybe we need to do parsing ourselves.
>> Given that we only need to parse a small subset of HTML, it shouldn't
>> be too bad and all we need from Gecko is createElement() and
>> setAttribute().
>>
>>
>> Thanks,
>>
>> Jacek
>>
>
> Hi Jacek,
>
> I think parsing it ourselves might be somewhat complicated, because of
> stuff like the HTML escapes (e.g. " " & and so on), which
> would have to be handled as the tests show.
>
> A mixed way would be a simpler version of the first patch that goes
> roughly like the following. For this case, let's assume we want to
> create the <body a="b"> element, so:
>
> The first two steps are needed regardless of whether we parse it
> ourselves or not:
>
> 1) Parse its tag name ("body")
> 2) Create a <body> element
>
> Then:
>
> 3) Create a <template> element, and setInnerHTML to <foo a="b">
> 4) Get its first child
> 5) Loop through all attributes on the child and set them on the
> element we created in (2)
>
> This is pretty much like first patch but simplified to <template> and
> allows gecko to parse it for us.
>
> Do you think it's feasible? If not, do you have some suggestions how I
> should implement the escapes? I guess a table?
Yeah, it's a bit better. It's not perfect, but it should work.
Thanks,
Jacek
Nov. 8, 2021
Re: [PATCH 2/5] win32u: Move NtUserSetProp implementation from user32.
by Jacek Caban
On 11/8/21 5:45 PM, Zebediah Figura wrote:
> Any particular reason that 1/5 uses a specfile import, but none of the
> rest of these functions do?
>
Function's signatures don't match on Windows. As mentioned by the
comment, Windows accepts only ATOMs. As such, when calling from user32,
I think that using user32 names is better.
Thanks,
Jacek
Nov. 8, 2021
Re: [PATCH 2/2] winegstreamer: Allow some audio resampling in the default pipeline.
by Rémi Bernon
On 11/8/21 17:36, Rémi Bernon wrote:
> On 10/27/21 22:34, Zebediah Figura (she/her) wrote:
>> On 10/27/21 10:25, Rémi Bernon wrote:
>>> Planet Coaster requests an output format with 44100 rate for user
>>> provided music, which may not match what the files are decoded to.
>>>
>>> Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
>>
>> This one looks good, although it'd be nice for this description to be
>> in the code itself.
>>
>> It could also be split into front and backend parts.
>>
>
> So it ends up being a little bit more complicated than that, and I don't
> think hardcoding a list of supported audio format is the right way to do
> it. In order to support all possible user music formats, we would have
> to hardcode all possible variations of media types.
>
> As far as I could see (and with tests from
> https://source.winehq.org/patches/data/219024) native streams only
> enumerate their native media types. Then, more media types are supported
> by the IMFSourceReader, but probably using a dynamically allocated
> decoder / converter MF transforms, or using MF topology elements which I
> believe are doing more advanced logic than what
> src_reader_SetCurrentMediaType does.
>
> Doing it this way would mean instantiating an audio_converter MF
> transform for instance, and would then make the audioresampler element
> useless. This seems to be the direction existing code is generally
> going, but it kind of defeat the idea of using GStreamer and its
> dynamically created pipelines.
>
> Another way I can see to make this dynamic, using an always present
> audioresampler element, would be instead to change the way we match
> IMFSourceReader stream media types, by delegating the type matching to
> winegstreamer, and GStreamer through gst_pad_query_caps calls. I'm not
> sure how we can do that, maybe with a custom IMFMediaTypeHandler, but
> it's not supposed to do this.
Actually it should be possible to do something not too ugly, with an
audioresampler element, allowing audio conversion by accepting media
types directly in source_reader_set_compatible_media_type, as MSDN seems
to suggest [1] is done since Win8 (and as the test confirm).
[1]
https://docs.microsoft.com/en-us/windows/win32/api/mfreadwrite/nf-mfreadwri…
--
Rémi Bernon <rbernon(a)codeweavers.com>
Nov. 8, 2021
[PATCH 2/2] ucrtbase/tests: Test for FreeLibrary() vs _beginthread[ex]() race condition.
by Arkadiusz Hiler
Signed-off-by: Arkadiusz Hiler <ahiler(a)codeweavers.com>
---
dlls/ucrtbase/tests/thread.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/ucrtbase/tests/thread.c b/dlls/ucrtbase/tests/thread.c
index 8fffbffb38e..7693304e612 100644
--- a/dlls/ucrtbase/tests/thread.c
+++ b/dlls/ucrtbase/tests/thread.c
@@ -105,11 +105,11 @@ static void test_thread_library_reference(char *thread_dll,
ok(thread_handle != -1 && thread_handle != 0, "Failed to begin thread: %u\n", errno);
+ ok(FreeLibrary(dll), "Failed to free the library: %u\n", GetLastError());
+
ret = WaitForSingleObject(args.confirm_running, 200);
ok(ret == WAIT_OBJECT_0, "Event was not signaled, ret: %u, err: %u\n", ret, GetLastError());
- ok(FreeLibrary(dll), "Failed to free the library: %u\n", GetLastError());
-
ret = WaitForSingleObject(detach_event, 0);
ok(ret == WAIT_TIMEOUT, "Thread detach happened unexpectedly signaling an event, ret: %d, err: %u\n", ret, GetLastError());
--
2.33.1
Nov. 8, 2021
[PATCH 1/2] msvcrt: Increase module's reference count before returning from _beginthread[ex]().
by Arkadiusz Hiler
Increasing DLL's reference count from the trampoline function makes it
prone to race conditions. The thread can start executing after we have
already returned from _beginthread[ex]() and the DLL might have been
freed.
Fixes rare crash on launch with Baldur's Gate 3.
Signed-off-by: Arkadiusz Hiler <ahiler(a)codeweavers.com>
---
dlls/msvcrt/thread.c | 50 +++++++++++++++++++++++++++-----------------
1 file changed, 31 insertions(+), 19 deletions(-)
diff --git a/dlls/msvcrt/thread.c b/dlls/msvcrt/thread.c
index 01500d93d91..173763d0eb1 100644
--- a/dlls/msvcrt/thread.c
+++ b/dlls/msvcrt/thread.c
@@ -32,6 +32,9 @@ typedef struct {
_beginthreadex_start_routine_t start_address_ex;
};
void *arglist;
+#if _MSVCR_VER >= 140
+ HMODULE module;
+#endif
} _beginthread_trampoline_t;
/*********************************************************************
@@ -113,16 +116,10 @@ static DWORD CALLBACK _beginthread_trampoline(LPVOID arg)
thread_data_t *data = msvcrt_get_thread_data();
memcpy(&local_trampoline,arg,sizeof(local_trampoline));
- data->handle = local_trampoline.thread;
free(arg);
-
+ data->handle = local_trampoline.thread;
#if _MSVCR_VER >= 140
- if (!GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS,
- (void*)local_trampoline.start_address, &data->module))
- {
- data->module = NULL;
- WARN("failed to get module for the start_address: %d\n", GetLastError());
- }
+ data->module = local_trampoline.module;
#endif
local_trampoline.start_address(local_trampoline.arglist);
@@ -162,7 +159,19 @@ uintptr_t CDECL _beginthread(
trampoline->start_address = start_address;
trampoline->arglist = arglist;
+#if _MSVCR_VER >= 140
+ if(!GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS,
+ (void*)start_address, &trampoline->module))
+ {
+ trampoline->module = NULL;
+ WARN("failed to get module for the start_address: %d\n", GetLastError());
+ }
+#endif
+
if(ResumeThread(thread) == -1) {
+#if _MSVCR_VER >= 140
+ FreeLibrary(trampoline->module);
+#endif
free(trampoline);
*_errno() = EAGAIN;
return -1;
@@ -181,19 +190,10 @@ static DWORD CALLBACK _beginthreadex_trampoline(LPVOID arg)
thread_data_t *data = msvcrt_get_thread_data();
memcpy(&local_trampoline, arg, sizeof(local_trampoline));
- data->handle = local_trampoline.thread;
free(arg);
-
+ data->handle = local_trampoline.thread;
#if _MSVCR_VER >= 140
- {
- thread_data_t *data = msvcrt_get_thread_data();
- if (!GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS,
- (void*)local_trampoline.start_address_ex, &data->module))
- {
- data->module = NULL;
- WARN("failed to get module for the start_address: %d\n", GetLastError());
- }
- }
+ data->module = local_trampoline.module;
#endif
retval = local_trampoline.start_address_ex(local_trampoline.arglist);
@@ -225,9 +225,21 @@ uintptr_t CDECL _beginthreadex(
trampoline->start_address_ex = start_address;
trampoline->arglist = arglist;
+#if _MSVCR_VER >= 140
+ if(!GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS,
+ (void*)start_address, &trampoline->module))
+ {
+ trampoline->module = NULL;
+ WARN("failed to get module for the start_address: %d\n", GetLastError());
+ }
+#endif
+
thread = CreateThread(security, stack_size, _beginthreadex_trampoline,
trampoline, initflag, thrdaddr);
if(!thread) {
+#if _MSVCR_VER >= 140
+ FreeLibrary(trampoline->module);
+#endif
free(trampoline);
msvcrt_set_errno(GetLastError());
return 0;
--
2.33.1
Nov. 8, 2021