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
January 2022
- 86 participants
- 2418 messages
[PATCH v2 1/5] mf/tests: Add some WMA decoder GetInputStreamInfo tests.
by Rémi Bernon
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51931
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52391
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
v2: Strip Proton CW-Bug-Id, sorry.
dlls/mf/tests/mf.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c
index 8b3e0dd65b2..5b2f5e60d4b 100644
--- a/dlls/mf/tests/mf.c
+++ b/dlls/mf/tests/mf.c
@@ -5726,6 +5726,7 @@ static void test_wma_decoder(void)
MFT_REGISTER_TYPE_INFO input_type = {MFMediaType_Audio, MFAudioFormat_WMAudioV8};
MFT_REGISTER_TYPE_INFO output_type = {MFMediaType_Audio, MFAudioFormat_Float};
+ MFT_INPUT_STREAM_INFO input_info;
IMFMediaType *media_type;
IMFTransform *transform;
GUID class_id;
@@ -5745,6 +5746,9 @@ static void test_wma_decoder(void)
/* check default media types */
+ hr = IMFTransform_GetInputStreamInfo(transform, 0, &input_info);
+ todo_wine
+ ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "GetInputStreamInfo returned %#x\n", hr);
hr = IMFTransform_GetOutputAvailableType(transform, 0, 0, &media_type);
todo_wine
ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "GetOutputAvailableType returned %#x\n", hr);
@@ -5802,6 +5806,10 @@ static void test_wma_decoder(void)
ret = IMFMediaType_Release(media_type);
ok(ret == 0, "Release returned %u\n", ret);
+ hr = IMFTransform_GetInputStreamInfo(transform, 0, &input_info);
+ todo_wine
+ ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "GetInputStreamInfo returned %#x\n", hr);
+
/* check new output media types */
i = -1;
@@ -5844,6 +5852,21 @@ static void test_wma_decoder(void)
ret = IMFMediaType_Release(media_type);
ok(ret == 0, "Release returned %u\n", ret);
+ memset(&input_info, 0xcd, sizeof(input_info));
+ hr = IMFTransform_GetInputStreamInfo(transform, 0, &input_info);
+ todo_wine
+ ok(hr == S_OK, "GetInputStreamInfo returned %#x\n", hr);
+ todo_wine
+ ok(input_info.hnsMaxLatency == 0, "got hnsMaxLatency %s\n", wine_dbgstr_longlong(input_info.hnsMaxLatency));
+ todo_wine
+ ok(input_info.dwFlags == 0, "got dwFlags %#x\n", input_info.dwFlags);
+ todo_wine
+ ok(input_info.cbSize == wma_block_size, "got cbSize %u\n", input_info.cbSize);
+ todo_wine
+ ok(input_info.cbMaxLookahead == 0, "got cbMaxLookahead %#x\n", input_info.cbMaxLookahead);
+ todo_wine
+ ok(input_info.cbAlignment == 1, "got cbAlignment %#x\n", input_info.cbAlignment);
+
ret = IMFTransform_Release(transform);
ok(ret == 0, "Release returned %u\n", ret);
--
2.34.1
Jan. 26, 2022
[PATCH 5/5] mf/tests: Add some WMA decoder ProcessOutput tests.
by Rémi Bernon
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51931
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52391
CW-Bug-Id: #19854
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
dlls/mf/tests/mf.c | 121 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 121 insertions(+)
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c
index 6289bfbd993..72cd2e6860a 100644
--- a/dlls/mf/tests/mf.c
+++ b/dlls/mf/tests/mf.c
@@ -5858,11 +5858,13 @@ static void test_wma_decoder(void)
MFT_REGISTER_TYPE_INFO output_type = {MFMediaType_Audio, MFAudioFormat_Float};
MFT_OUTPUT_STREAM_INFO output_info;
MFT_INPUT_STREAM_INFO input_info;
+ MFT_OUTPUT_DATA_BUFFER output;
IMFMediaType *media_type;
IMFTransform *transform;
IMFSample *sample;
GUID class_id;
ULONG i, ret;
+ DWORD status;
HRESULT hr;
hr = CoInitialize(NULL);
@@ -6072,6 +6074,125 @@ static void test_wma_decoder(void)
todo_wine
ok(ret == 1, "Release returned %u\n", ret);
+ /* As output_info.dwFlags doesn't have MFT_OUTPUT_STREAM_CAN_PROVIDE_SAMPLES
+ * IMFTransform_ProcessOutput needs a sample or returns MF_E_TRANSFORM_NEED_MORE_INPUT */
+
+ status = 0xdeadbeef;
+ memset(&output, 0, sizeof(output));
+ hr = IMFTransform_ProcessOutput(transform, 0, 1, &output, &status);
+ todo_wine
+ ok(hr == MF_E_TRANSFORM_NEED_MORE_INPUT, "ProcessOutput returned %#x\n", hr);
+ ok(output.dwStreamID == 0, "got dwStreamID %u\n", output.dwStreamID);
+ ok(!output.pSample, "got pSample %p\n", output.pSample);
+ todo_wine
+ ok(output.dwStatus == MFT_OUTPUT_DATA_BUFFER_NO_SAMPLE,
+ "got dwStatus %#x\n", output.dwStatus);
+ ok(!output.pEvents, "got pEvents %p\n", output.pEvents);
+ todo_wine
+ ok(status == 0, "got status %#x\n", status);
+
+ sample = create_sample(wma_encoded_data[0], wma_block_size);
+ hr = IMFTransform_ProcessInput(transform, 0, sample, 0);
+ todo_wine
+ ok(hr == MF_E_NOTACCEPTING, "ProcessInput returned %#x\n", hr);
+ ret = IMFSample_Release(sample);
+ ok(ret == 0, "Release returned %u\n", ret);
+
+ status = 0xdeadbeef;
+ memset(&output, 0, sizeof(output));
+ hr = IMFTransform_ProcessOutput(transform, 0, 1, &output, &status);
+ todo_wine
+ ok(hr == MF_E_TRANSFORM_NEED_MORE_INPUT, "ProcessOutput returned %#x\n", hr);
+ ok(!output.pSample, "got pSample %p\n", output.pSample);
+ todo_wine
+ ok(output.dwStatus == MFT_OUTPUT_DATA_BUFFER_NO_SAMPLE,
+ "got dwStatus %#x\n", output.dwStatus);
+ todo_wine
+ ok(status == 0, "got status %#x\n", status);
+
+ status = 0xdeadbeef;
+ output_info.cbSize = sizeof(wma_decoded_data);
+ sample = create_sample(NULL, output_info.cbSize);
+ memset(&output, 0, sizeof(output));
+ output.pSample = sample;
+ hr = IMFTransform_ProcessOutput(transform, 0, 1, &output, &status);
+ while (hr == MF_E_TRANSFORM_NEED_MORE_INPUT)
+ {
+ ok(hr == MF_E_TRANSFORM_NEED_MORE_INPUT, "ProcessOutput returned %#x\n", hr);
+ ok(output.pSample == sample, "got pSample %p\n", output.pSample);
+ ok(output.dwStatus == 0, "got dwStatus %#x\n", output.dwStatus);
+ ok(status == 0, "got status %#x\n", status);
+ check_sample(sample, NULL, 0);
+ ret = IMFSample_Release(sample);
+ ok(ret == 0, "Release returned %u\n", ret);
+
+ sample = create_sample(wma_encoded_data[0], wma_block_size);
+ hr = IMFTransform_ProcessInput(transform, 0, sample, 0);
+ ok(hr == S_OK, "ProcessInput returned %#x\n", hr);
+ ret = IMFSample_Release(sample);
+ ok(ret == 1, "Release returned %u\n", ret);
+
+ status = 0xdeadbeef;
+ sample = create_sample(NULL, output_info.cbSize);
+ memset(&output, 0, sizeof(output));
+ output.pSample = sample;
+ hr = IMFTransform_ProcessOutput(transform, 0, 1, &output, &status);
+ }
+
+ todo_wine
+ ok(hr == S_OK, "ProcessOutput returned %#x\n", hr);
+ ok(output.pSample == sample, "got pSample %p\n", output.pSample);
+
+ i = 0;
+ while (output.dwStatus == MFT_OUTPUT_DATA_BUFFER_INCOMPLETE)
+ {
+ ok(hr == S_OK, "ProcessOutput returned %#x\n", hr);
+ ok(output.pSample == sample, "got pSample %p\n", output.pSample);
+ ok(output.dwStatus == MFT_OUTPUT_DATA_BUFFER_INCOMPLETE, "got dwStatus %#x\n",
+ output.dwStatus);
+ ok(status == 0, "got status %#x\n", status);
+ check_sample(sample, wma_decoded_data, sizeof(wma_decoded_data));
+ i += sizeof(wma_decoded_data);
+ ret = IMFSample_Release(sample);
+ ok(ret == 0, "Release returned %u\n", ret);
+
+ status = 0xdeadbeef;
+ sample = create_sample(NULL, output_info.cbSize);
+ memset(&output, 0, sizeof(output));
+ output.pSample = sample;
+ hr = IMFTransform_ProcessOutput(transform, 0, 1, &output, &status);
+ }
+
+ todo_wine
+ ok(hr == S_OK, "ProcessOutput returned %#x\n", hr);
+ ok(output.pSample == sample, "got pSample %p\n", output.pSample);
+ ok(output.dwStatus == 0, "got dwStatus %#x\n", output.dwStatus);
+ todo_wine
+ ok(status == 0, "got status %#x\n", status);
+ if (hr == S_OK)
+ {
+ check_sample(sample, wma_decoded_data, sizeof(wma_decoded_data) / 2);
+ i += sizeof(wma_decoded_data) / 2;
+ ok(i == 0xe000, "ProcessOutput produced %#x bytes\n", i);
+ }
+ ret = IMFSample_Release(sample);
+ ok(ret == 0, "Release returned %u\n", ret);
+
+ status = 0xdeadbeef;
+ sample = create_sample(NULL, output_info.cbSize);
+ memset(&output, 0, sizeof(output));
+ output.pSample = sample;
+ hr = IMFTransform_ProcessOutput(transform, 0, 1, &output, &status);
+ todo_wine
+ ok(hr == MF_E_TRANSFORM_NEED_MORE_INPUT, "ProcessOutput returned %#x\n", hr);
+ ok(output.pSample == sample, "got pSample %p\n", output.pSample);
+ ok(output.dwStatus == 0, "got dwStatus %#x\n", output.dwStatus);
+ todo_wine
+ ok(status == 0, "got status %#x\n", status);
+ check_sample(sample, NULL, 0);
+ ret = IMFSample_Release(sample);
+ ok(ret == 0, "Release returned %u\n", ret);
+
sample = create_sample(wma_encoded_data[0], wma_block_size);
hr = IMFTransform_ProcessInput(transform, 0, sample, 0);
todo_wine
--
2.34.1
Jan. 26, 2022
[PATCH 4/5] mf/tests: Add some WMA decoder ProcessInput tests.
by Rémi Bernon
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51931
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52391
CW-Bug-Id: #19854
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
dlls/mf/tests/mf.c | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c
index 4a8644bff4f..6289bfbd993 100644
--- a/dlls/mf/tests/mf.c
+++ b/dlls/mf/tests/mf.c
@@ -5860,6 +5860,7 @@ static void test_wma_decoder(void)
MFT_INPUT_STREAM_INFO input_info;
IMFMediaType *media_type;
IMFTransform *transform;
+ IMFSample *sample;
GUID class_id;
ULONG i, ret;
HRESULT hr;
@@ -6048,8 +6049,38 @@ static void test_wma_decoder(void)
todo_wine
ok(output_info.cbAlignment == 1, "got cbAlignment %#x\n", output_info.cbAlignment);
+ sample = create_sample(wma_encoded_data[0], wma_block_size / 2);
+ hr = IMFTransform_ProcessInput(transform, 0, sample, 0);
+ todo_wine
+ ok(hr == S_OK, "ProcessInput returned %#x\n", hr);
+ ret = IMFSample_Release(sample);
+ ok(ret == 0, "Release returned %u\n", ret);
+ sample = create_sample(wma_encoded_data[0] + wma_block_size, wma_block_size - wma_block_size / 2);
+ hr = IMFTransform_ProcessInput(transform, 0, sample, 0);
+ todo_wine
+ ok(hr == S_OK, "ProcessInput returned %#x\n", hr);
+ ret = IMFSample_Release(sample);
+ ok(ret == 0, "Release returned %u\n", ret);
+ sample = create_sample(wma_encoded_data[0], wma_block_size);
+ hr = IMFTransform_ProcessInput(transform, 0, sample, 0);
+ todo_wine
+ ok(hr == S_OK, "ProcessInput returned %#x\n", hr);
+ hr = IMFTransform_ProcessInput(transform, 0, sample, 0);
+ todo_wine
+ ok(hr == MF_E_NOTACCEPTING, "ProcessInput returned %#x\n", hr);
+ ret = IMFSample_Release(sample);
+ todo_wine
+ ok(ret == 1, "Release returned %u\n", ret);
+
+ sample = create_sample(wma_encoded_data[0], wma_block_size);
+ hr = IMFTransform_ProcessInput(transform, 0, sample, 0);
+ todo_wine
+ ok(hr == S_OK, "ProcessInput returned %#x\n", hr);
+
ret = IMFTransform_Release(transform);
ok(ret == 0, "Release returned %u\n", ret);
+ ret = IMFSample_Release(sample);
+ ok(ret == 0, "Release returned %u\n", ret);
failed:
CoUninitialize();
--
2.34.1
Jan. 26, 2022
[PATCH 3/5] mf/tests: Add some WMA encoder ProcessOutput tests.
by Rémi Bernon
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51931
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52391
CW-Bug-Id: #19854
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
dlls/mf/tests/mf.c | 130 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 130 insertions(+)
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c
index a9467a7fdb6..4a8644bff4f 100644
--- a/dlls/mf/tests/mf.c
+++ b/dlls/mf/tests/mf.c
@@ -5491,9 +5491,103 @@ static IMFSample *create_sample(const BYTE *data, ULONG size)
return sample;
}
+#define check_sample(a, b, c) check_sample_(__LINE__, a, b, c)
+static void check_sample_(int line, IMFSample *sample, const void *expect_buf, ULONG expect_len)
+{
+ IMFMediaBuffer *media_buffer;
+ DWORD length;
+ BYTE *buffer;
+ HRESULT hr;
+ ULONG ret;
+
+ hr = IMFSample_ConvertToContiguousBuffer(sample, &media_buffer);
+ ok_(__FILE__, line)(hr == S_OK, "ConvertToContiguousBuffer returned %#x\n", hr);
+ hr = IMFMediaBuffer_Lock(media_buffer, &buffer, NULL, &length);
+ ok_(__FILE__, line)(hr == S_OK, "Lock returned %#x\n", hr);
+ ok_(__FILE__, line)(expect_len == length, "got length %u\n", length);
+ if (length && length == expect_len)
+ {
+ ok_(__FILE__, line)(!memcmp(expect_buf, buffer, expect_len),
+ "unexpected buffer data\n");
+ }
+ hr = IMFMediaBuffer_Unlock(media_buffer);
+ ok_(__FILE__, line)(hr == S_OK, "Unlock returned %#x\n", hr);
+ ret = IMFMediaBuffer_Release(media_buffer);
+ ok_(__FILE__, line)(ret == 1, "Release returned %u\n", ret);
+}
+
static const BYTE wma_codec_data[10] = {0, 0x44, 0, 0, 0x17, 0, 0, 0, 0, 0};
static const BYTE wma_decoded_data[0x4000] = {0};
static const ULONG wma_block_size = 1487;
+static const BYTE wma_encoded_data[][1487] =
+{
+ {0x09,0x00,0x00,0x77,0xe9,0x48,0x0c,0x84,0x44,0x88,0x4a,0x40,0x64,0x22,0x24,0x43,
+ 0xd6,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+ {0x18,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+ {0x28,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+ {0x38,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+ {0x48,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+ {0x58,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x44,0x88,0x4a,0x40,0x64,0x22,0x24,0x43,
+ 0xd6,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+ {0x68,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+ {0x78,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+ {0x88,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+ {0x98,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+ {0xa8,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x44,0x88,0x4a,0x40,0x64,0x22,0x24,0x43,
+ 0xd6,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+ {0xb8,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+ {0xc8,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+ {0xd8,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+ {0xe8,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+ {0xf8,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x44,0x88,0x4a,0x40,0x64,0x22,0x24,0x43,
+ 0xd6,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+ {0x08,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+ {0x18,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+ {0x28,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+ {0x38,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+ {0x48,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x44,0x88,0x4a,0x40,0x64,0x22,0x24,0x43,
+ 0xd6,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+ {0x58,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+ {0x68,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+ {0x78,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+ {0x88,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+ {0x98,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x44,0x88,0x4a,0x40,0x64,0x22,0x24,0x43,
+ 0xd6,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+ {0xa8,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+ {0xb8,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+ {0xc8,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+ {0xd8,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+ {0xe8,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x44,0x88,0x4a,0x40,0x64,0x22,0x24,0x43,
+ 0xd6,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+ {0xf8,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+ {0x03,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
+};
static void test_wma_encoder(void)
{
@@ -5551,10 +5645,12 @@ static void test_wma_encoder(void)
MFT_REGISTER_TYPE_INFO input_type = {MFMediaType_Audio, MFAudioFormat_Float};
MFT_OUTPUT_STREAM_INFO output_info;
MFT_INPUT_STREAM_INFO input_info;
+ MFT_OUTPUT_DATA_BUFFER output;
IMFMediaType *media_type;
IMFTransform *transform;
IMFSample *sample;
GUID class_id;
+ DWORD status;
ULONG i, ret;
HRESULT hr;
@@ -5611,6 +5707,40 @@ static void test_wma_encoder(void)
hr = IMFTransform_ProcessInput(transform, 0, sample, 0);
ok(hr == MF_E_NOTACCEPTING, "ProcessInput returned %#x\n", hr);
+ status = 0xdeadbeef;
+ sample = create_sample(NULL, output_info.cbSize);
+ memset(&output, 0, sizeof(output));
+ output.pSample = sample;
+
+ i = 0;
+ while (SUCCEEDED(hr = IMFTransform_ProcessOutput(transform, 0, 1, &output, &status)))
+ {
+ winetest_push_context("%u", i);
+ ok(hr == S_OK, "ProcessOutput returned %#x\n", hr);
+ ok(output.pSample == sample, "got pSample %p\n", output.pSample);
+ ok(output.dwStatus == MFT_OUTPUT_DATA_BUFFER_INCOMPLETE, "got dwStatus %#x\n", output.dwStatus);
+ ok(status == 0, "got status %#x\n", status);
+ check_sample(sample, wma_encoded_data + i, wma_block_size);
+ winetest_pop_context();
+ i++;
+ }
+
+ ret = IMFSample_Release(sample);
+ ok(ret == 0, "Release returned %u\n", ret);
+
+ status = 0xdeadbeef;
+ sample = create_sample(NULL, output_info.cbSize);
+ memset(&output, 0, sizeof(output));
+ output.pSample = sample;
+ hr = IMFTransform_ProcessOutput(transform, 0, 1, &output, &status);
+ ok(hr == MF_E_TRANSFORM_NEED_MORE_INPUT, "ProcessOutput returned %#x\n", hr);
+ ok(output.pSample == sample, "got pSample %p\n", output.pSample);
+ ok(output.dwStatus == 0, "got dwStatus %#x\n", output.dwStatus);
+ ok(status == 0, "got status %#x\n", status);
+ check_sample(sample, NULL, 0);
+ ret = IMFSample_Release(sample);
+ ok(ret == 0, "Release returned %u\n", ret);
+
ret = IMFTransform_Release(transform);
ok(ret == 0, "Release returned %u\n", ret);
--
2.34.1
Jan. 26, 2022
[PATCH 2/5] mf/tests: Add some WMA decoder GetOutputStreamInfo tests.
by Rémi Bernon
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51931
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52391
CW-Bug-Id: #19854
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
dlls/mf/tests/mf.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 51 insertions(+)
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c
index 5b2f5e60d4b..a9467a7fdb6 100644
--- a/dlls/mf/tests/mf.c
+++ b/dlls/mf/tests/mf.c
@@ -5726,6 +5726,7 @@ static void test_wma_decoder(void)
MFT_REGISTER_TYPE_INFO input_type = {MFMediaType_Audio, MFAudioFormat_WMAudioV8};
MFT_REGISTER_TYPE_INFO output_type = {MFMediaType_Audio, MFAudioFormat_Float};
+ MFT_OUTPUT_STREAM_INFO output_info;
MFT_INPUT_STREAM_INFO input_info;
IMFMediaType *media_type;
IMFTransform *transform;
@@ -5749,6 +5750,9 @@ static void test_wma_decoder(void)
hr = IMFTransform_GetInputStreamInfo(transform, 0, &input_info);
todo_wine
ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "GetInputStreamInfo returned %#x\n", hr);
+ hr = IMFTransform_GetOutputStreamInfo(transform, 0, &output_info);
+ todo_wine
+ ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "GetOutputStreamInfo returned %#x\n", hr);
hr = IMFTransform_GetOutputAvailableType(transform, 0, 0, &media_type);
todo_wine
ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "GetOutputAvailableType returned %#x\n", hr);
@@ -5809,6 +5813,9 @@ static void test_wma_decoder(void)
hr = IMFTransform_GetInputStreamInfo(transform, 0, &input_info);
todo_wine
ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "GetInputStreamInfo returned %#x\n", hr);
+ hr = IMFTransform_GetOutputStreamInfo(transform, 0, &output_info);
+ todo_wine
+ ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "GetOutputStreamInfo returned %#x\n", hr);
/* check new output media types */
@@ -5867,6 +5874,50 @@ static void test_wma_decoder(void)
todo_wine
ok(input_info.cbAlignment == 1, "got cbAlignment %#x\n", input_info.cbAlignment);
+ memset(&output_info, 0xcd, sizeof(output_info));
+ hr = IMFTransform_GetOutputStreamInfo(transform, 0, &output_info);
+ todo_wine
+ ok(hr == S_OK, "GetOutputStreamInfo returned %#x\n", hr);
+ todo_wine
+ ok(output_info.dwFlags == 0, "got dwFlags %#x\n", output_info.dwFlags);
+ todo_wine
+ ok(output_info.cbSize == 0, "got cbSize %#x\n", output_info.cbSize);
+ todo_wine
+ ok(output_info.cbAlignment == 1, "got cbAlignment %#x\n", output_info.cbAlignment);
+
+ /* MF_MT_AUDIO_AVG_BYTES_PER_SECOND isn't required by SetInputType, but is needed for the transform to work */
+
+ hr = MFCreateMediaType(&media_type);
+ ok(hr == S_OK, "MFCreateMediaType returned %#x\n", hr);
+ init_media_type(media_type, input_type_desc, -1);
+ hr = IMFMediaType_SetUINT32(media_type, &MF_MT_AUDIO_AVG_BYTES_PER_SECOND, 4003);
+ ok(hr == S_OK, "SetUINT32 returned %#x\n", hr);
+ hr = IMFTransform_SetInputType(transform, 0, media_type, 0);
+ todo_wine
+ ok(hr == S_OK, "SetInputType returned %#x.\n", hr);
+
+ hr = IMFTransform_GetOutputStreamInfo(transform, 0, &output_info);
+ todo_wine
+ ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "GetOutputStreamInfo returned %#x\n", hr);
+
+ init_media_type(media_type, output_type_desc, -1);
+ hr = IMFTransform_SetOutputType(transform, 0, media_type, 0);
+ todo_wine
+ ok(hr == S_OK, "SetInputType returned %#x.\n", hr);
+ ret = IMFMediaType_Release(media_type);
+ ok(ret == 0, "Release returned %u\n", ret);
+
+ memset(&output_info, 0xcd, sizeof(output_info));
+ hr = IMFTransform_GetOutputStreamInfo(transform, 0, &output_info);
+ todo_wine
+ ok(hr == S_OK, "GetOutputStreamInfo returned %#x\n", hr);
+ todo_wine
+ ok(output_info.dwFlags == 0, "got dwFlags %#x\n", output_info.dwFlags);
+ todo_wine
+ ok(output_info.cbSize == sizeof(wma_decoded_data), "got cbSize %#x\n", output_info.cbSize);
+ todo_wine
+ ok(output_info.cbAlignment == 1, "got cbAlignment %#x\n", output_info.cbAlignment);
+
ret = IMFTransform_Release(transform);
ok(ret == 0, "Release returned %u\n", ret);
--
2.34.1
Jan. 26, 2022
[PATCH 1/5] mf/tests: Add some WMA decoder GetInputStreamInfo tests.
by Rémi Bernon
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51931
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52391
CW-Bug-Id: #19854
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
dlls/mf/tests/mf.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c
index 8b3e0dd65b2..5b2f5e60d4b 100644
--- a/dlls/mf/tests/mf.c
+++ b/dlls/mf/tests/mf.c
@@ -5726,6 +5726,7 @@ static void test_wma_decoder(void)
MFT_REGISTER_TYPE_INFO input_type = {MFMediaType_Audio, MFAudioFormat_WMAudioV8};
MFT_REGISTER_TYPE_INFO output_type = {MFMediaType_Audio, MFAudioFormat_Float};
+ MFT_INPUT_STREAM_INFO input_info;
IMFMediaType *media_type;
IMFTransform *transform;
GUID class_id;
@@ -5745,6 +5746,9 @@ static void test_wma_decoder(void)
/* check default media types */
+ hr = IMFTransform_GetInputStreamInfo(transform, 0, &input_info);
+ todo_wine
+ ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "GetInputStreamInfo returned %#x\n", hr);
hr = IMFTransform_GetOutputAvailableType(transform, 0, 0, &media_type);
todo_wine
ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "GetOutputAvailableType returned %#x\n", hr);
@@ -5802,6 +5806,10 @@ static void test_wma_decoder(void)
ret = IMFMediaType_Release(media_type);
ok(ret == 0, "Release returned %u\n", ret);
+ hr = IMFTransform_GetInputStreamInfo(transform, 0, &input_info);
+ todo_wine
+ ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "GetInputStreamInfo returned %#x\n", hr);
+
/* check new output media types */
i = -1;
@@ -5844,6 +5852,21 @@ static void test_wma_decoder(void)
ret = IMFMediaType_Release(media_type);
ok(ret == 0, "Release returned %u\n", ret);
+ memset(&input_info, 0xcd, sizeof(input_info));
+ hr = IMFTransform_GetInputStreamInfo(transform, 0, &input_info);
+ todo_wine
+ ok(hr == S_OK, "GetInputStreamInfo returned %#x\n", hr);
+ todo_wine
+ ok(input_info.hnsMaxLatency == 0, "got hnsMaxLatency %s\n", wine_dbgstr_longlong(input_info.hnsMaxLatency));
+ todo_wine
+ ok(input_info.dwFlags == 0, "got dwFlags %#x\n", input_info.dwFlags);
+ todo_wine
+ ok(input_info.cbSize == wma_block_size, "got cbSize %u\n", input_info.cbSize);
+ todo_wine
+ ok(input_info.cbMaxLookahead == 0, "got cbMaxLookahead %#x\n", input_info.cbMaxLookahead);
+ todo_wine
+ ok(input_info.cbAlignment == 1, "got cbAlignment %#x\n", input_info.cbAlignment);
+
ret = IMFTransform_Release(transform);
ok(ret == 0, "Release returned %u\n", ret);
--
2.34.1
Jan. 26, 2022
Re: [PATCH 1/2] ddraw/tests: Treat refresh rates with 1 hz difference as equal.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=106024
Your paranoid android.
=== w8 (32 bit report) ===
ddraw:
ddraw7.c:18858: Test failed: Got unexpected color 0x0000ff00.
=== w8adm (32 bit report) ===
ddraw:
ddraw7.c:18858: Test failed: Got unexpected color 0x00000040.
=== debian11 (32 bit report) ===
ddraw:
ddraw4.c:3693: Test failed: Expected resolution 1024x768, got 640x480.
ddraw4.c:3710: Test failed: Expected surface width 1024, got 640.
ddraw4.c:3712: Test failed: Expected surface height 768, got 480.
ddraw4.c:3726: Test failed: Expected (0,0)-(1024,768), got (0,0)-(640,480).
ddraw4.c:3731: Test failed: Expected surface width 1024, got 640.
ddraw4.c:3733: Test failed: Expected surface height 768, got 480.
ddraw4.c:3746: Test failed: Expected surface width 1024, got 640.
ddraw4.c:3748: Test failed: Expected surface height 768, got 480.
ddraw4.c:3752: Test failed: Expected (0,0)-(1024,768), got (0,0)-(640,480).
ddraw4.c:3775: Test failed: Expected (0,0)-(1024,768), got (0,0)-(640,480).
ddraw4.c:3797: Test failed: Expected (0,0)-(1024,768), got (0,0)-(640,480).
ddraw4.c:3802: Test failed: Expected surface width 1024, got 640.
ddraw4.c:3804: Test failed: Expected surface height 768, got 480.
ddraw4.c:3823: Test failed: Expected (0,0)-(1024,768), got (0,0)-(640,480).
ddraw4.c:3843: Test failed: Expected (0,0)-(1024,768), got (0,0)-(640,480).
ddraw4.c:3856: Test failed: Expected resolution 1024x768, got 640x480.
ddraw4.c:3873: Test failed: Expected surface width 1024, got 640.
ddraw4.c:3875: Test failed: Expected surface height 768, got 480.
ddraw4.c:3880: Test failed: Expected (0,0)-(1024,768), got (0,0)-(640,480).
ddraw4.c:3897: Test failed: Expected message 0x5, but didn't receive it.
ddraw4.c:3899: Test failed: Expected screen size 1024x768, got 0x0.
ddraw4.c:3906: Test failed: Expected (0,0)-(1024,768), got (0,0)-(640,480).
ddraw4.c:3918: Test failed: Expected surface width 1024, got 640.
ddraw4.c:3920: Test failed: Expected surface height 768, got 480.
ddraw4.c:3971: Test failed: Expected screen size 2 1024x768, got 640x480.
ddraw4.c:3979: Test failed: Expected (0,0)-(1024,768), got (0,0)-(640,480).
ddraw4.c:3991: Test failed: Expected surface width 1024, got 640.
ddraw4.c:3993: Test failed: Expected surface height 768, got 480.
=== debian11 (32 bit Arabic:Morocco report) ===
ddraw:
ddraw4.c:4458: Test failed: Got a different mode.
ddraw4.c:4489: Test failed: Got a different mode.
=== debian11 (32 bit Hebrew:Israel report) ===
ddraw:
ddraw2.c:4070: Test failed: Got unexpected screen width 800.
ddraw2.c:4072: Test failed: Got unexpected screen height 600.
=== debian11 (32 bit Japanese:Japan report) ===
ddraw:
ddraw2.c:6805: Test failed: Failed to attach surface, hr 0x8876000a.
ddraw2.c:6808: Test failed: Got unexpected hr 0x8876000a.
ddraw2.c:6810: Test failed: Failed to detach surface, hr 0x88760014.
ddraw2.c:6813: Test failed: Failed to attach surface, hr 0x8876000a.
ddraw2.c:6818: Test failed: Failed to detach surface, hr 0x88760014.
ddraw4.c:2956: Test failed: Expected window style 0x4cf0000, got 0xa40b0000.
ddraw4.c:2958: Test failed: Expected window extended style 0x100, got 0.
ddraw4.c:2989: Test failed: Expected window style 0x4cf0000, got 0xa40b0000.
ddraw4.c:2992: Test failed: Expected window extended style 0x108, got 0x8.
ddraw4.c:2998: Test failed: Expected window style 0x4cf0000, got 0xa40b0000.
ddraw4.c:3001: Test failed: Expected window extended style 0x108, got 0x8.
ddraw4.c:3021: Test failed: Expected window style 0x4cf0000, got 0xa40b0000.
ddraw4.c:3023: Test failed: Expected window extended style 0x100, got 0.
ddraw4.c:3040: Test failed: Expected (0,0)-(640,480), got (-32000,-32000)-(-31840,-31976).
ddraw4.c:3063: Test failed: Expected (0,0)-(640,480), got (-32000,-32000)-(-31840,-31976).
ddraw4.c:3083: Test failed: Expected window style 0x4cf0000, got 0xa40b0000.
=== debian11 (64 bit WoW report) ===
ddraw:
ddraw2.c:3665: Test failed: Expected message 0x5, but didn't receive it.
Jan. 26, 2022
[PATCH v2 4/4] plugplay: Use ncacn_np instead of ncalrpc transport.
by Rémi Bernon
The ncacn_np should be used when the endpoint is a pipe, ncalrpc should
only be used with arbitrary named ports, which we translate into
\\pipe\lrpc\xxx pipe names.
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
dlls/ntoskrnl.exe/pnp.c | 2 +-
dlls/sechost/service.c | 2 +-
include/wine/plugplay.idl | 1 +
programs/plugplay/main.c | 2 +-
4 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/dlls/ntoskrnl.exe/pnp.c b/dlls/ntoskrnl.exe/pnp.c
index 6d53d79267e..8d3481b2a72 100644
--- a/dlls/ntoskrnl.exe/pnp.c
+++ b/dlls/ntoskrnl.exe/pnp.c
@@ -1084,7 +1084,7 @@ void pnp_manager_start(void)
{
static const WCHAR driver_nameW[] = {'\\','D','r','i','v','e','r','\\','P','n','p','M','a','n','a','g','e','r',0};
WCHAR endpoint[] = L"\\pipe\\wine_plugplay";
- WCHAR protseq[] = L"ncalrpc";
+ WCHAR protseq[] = L"ncacn_np";
UNICODE_STRING driver_nameU;
RPC_WSTR binding_str;
NTSTATUS status;
diff --git a/dlls/sechost/service.c b/dlls/sechost/service.c
index e6f4eb75db0..4dfb40b4bac 100644
--- a/dlls/sechost/service.c
+++ b/dlls/sechost/service.c
@@ -1988,7 +1988,7 @@ struct device_notify_registration
static DWORD WINAPI device_notify_proc( void *arg )
{
WCHAR endpoint[] = L"\\pipe\\wine_plugplay";
- WCHAR protseq[] = L"ncalrpc";
+ WCHAR protseq[] = L"ncacn_np";
RPC_WSTR binding_str;
DWORD err = ERROR_SUCCESS;
struct device_notify_registration *registration;
diff --git a/include/wine/plugplay.idl b/include/wine/plugplay.idl
index 8123b733ad1..a3e7b04bf30 100644
--- a/include/wine/plugplay.idl
+++ b/include/wine/plugplay.idl
@@ -20,6 +20,7 @@ import "wtypes.idl";
[
uuid(57c680ac-7bce-4f39-97fd-ffea566754d5),
+ endpoint("ncacn_np:[\\pipe\\wine_plugplay]"),
implicit_handle(handle_t plugplay_binding_handle)
]
interface plugplay
diff --git a/programs/plugplay/main.c b/programs/plugplay/main.c
index 1156cb9f036..366be9c2b46 100644
--- a/programs/plugplay/main.c
+++ b/programs/plugplay/main.c
@@ -200,7 +200,7 @@ static DWORD WINAPI service_handler( DWORD ctrl, DWORD event_type, LPVOID event_
static void WINAPI ServiceMain( DWORD argc, LPWSTR *argv )
{
unsigned char endpoint[] = "\\pipe\\wine_plugplay";
- unsigned char protseq[] = "ncalrpc";
+ unsigned char protseq[] = "ncacn_np";
SERVICE_STATUS status;
RPC_STATUS err;
--
2.34.1
Jan. 26, 2022
[PATCH v2 3/4] wine.inf: Start EventLogService on prefix initialization.
by Rémi Bernon
The service has StartType=2, and should start automatically.
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
loader/wine.inf.in | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/loader/wine.inf.in b/loader/wine.inf.in
index 3af8dabca64..2fd4fbd22ea 100644
--- a/loader/wine.inf.in
+++ b/loader/wine.inf.in
@@ -171,7 +171,7 @@ WineFakeDlls=FakeDllsWin32
[DefaultInstall.Services]
AddService=BITS,0,BITSService
-AddService=EventLog,0,EventLogService
+AddService=EventLog,0x800,EventLogService
AddService=HTTP,0,HTTPService
AddService=MSIServer,0,MSIService
AddService=RpcSs,0,RpcSsService
@@ -190,7 +190,7 @@ AddService=nsiproxy,0x800,NsiProxyService
[DefaultInstall.NT.Services]
AddService=BITS,0,BITSService
-AddService=EventLog,0,EventLogService
+AddService=EventLog,0x800,EventLogService
AddService=HTTP,0,HTTPService
AddService=MSIServer,0,MSIService
AddService=RpcSs,0,RpcSsService
@@ -209,7 +209,7 @@ AddService=nsiproxy,0x800,NsiProxyService
[DefaultInstall.ntamd64.Services]
AddService=BITS,0,BITSService
-AddService=EventLog,0,EventLogService
+AddService=EventLog,0x800,EventLogService
AddService=HTTP,0,HTTPService
AddService=MSIServer,0,MSIService
AddService=RpcSs,0,RpcSsService
@@ -228,7 +228,7 @@ AddService=nsiproxy,0x800,NsiProxyService
[DefaultInstall.ntarm64.Services]
AddService=BITS,0,BITSService
-AddService=EventLog,0,EventLogService
+AddService=EventLog,0x800,EventLogService
AddService=HTTP,0,HTTPService
AddService=MSIServer,0,MSIService
AddService=RpcSs,0,RpcSsService
--
2.34.1
Jan. 26, 2022
[PATCH v2 2/4] dinput/tests: Add some RegisterDeviceNotificationA and hotplug tests.
by Rémi Bernon
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
dlls/dinput/tests/dinput_test.h | 1 +
dlls/dinput/tests/hid.c | 86 ++++++++++
dlls/dinput/tests/hotplug.c | 283 +++++++++++++++++++++++++++++++-
3 files changed, 369 insertions(+), 1 deletion(-)
diff --git a/dlls/dinput/tests/dinput_test.h b/dlls/dinput/tests/dinput_test.h
index 0a4c9ba5fa4..97eed949a36 100644
--- a/dlls/dinput/tests/dinput_test.h
+++ b/dlls/dinput/tests/dinput_test.h
@@ -66,6 +66,7 @@ BOOL dinput_test_init_( const char *file, int line );
void dinput_test_exit(void);
HRESULT dinput_test_create_device( DWORD version, DIDEVICEINSTANCEW *devinst, IDirectInputDevice8W **device );
+DWORD WINAPI dinput_test_device_thread( void *stop_event );
#define check_member_( file, line, val, exp, fmt, member ) \
ok_(file, line)( (val).member == (exp).member, "got " #member " " fmt "\n", (val).member )
diff --git a/dlls/dinput/tests/hid.c b/dlls/dinput/tests/hid.c
index 0e94ce63aab..7e4ab3dc1f3 100644
--- a/dlls/dinput/tests/hid.c
+++ b/dlls/dinput/tests/hid.c
@@ -3478,6 +3478,92 @@ HRESULT dinput_test_create_device( DWORD version, DIDEVICEINSTANCEW *devinst, ID
return DI_OK;
}
+DWORD WINAPI dinput_test_device_thread( void *stop_event )
+{
+#include "psh_hid_macros.h"
+ static const unsigned char gamepad_desc[] =
+ {
+ USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC),
+ USAGE(1, HID_USAGE_GENERIC_GAMEPAD),
+ COLLECTION(1, Application),
+ USAGE(1, HID_USAGE_GENERIC_GAMEPAD),
+ COLLECTION(1, Physical),
+ USAGE(1, HID_USAGE_GENERIC_X),
+ USAGE(1, HID_USAGE_GENERIC_Y),
+ LOGICAL_MINIMUM(1, 0),
+ LOGICAL_MAXIMUM(1, 127),
+ PHYSICAL_MINIMUM(1, 0),
+ PHYSICAL_MAXIMUM(1, 127),
+ REPORT_SIZE(1, 8),
+ REPORT_COUNT(1, 2),
+ INPUT(1, Data|Var|Abs),
+
+ USAGE_PAGE(1, HID_USAGE_PAGE_BUTTON),
+ USAGE_MINIMUM(1, 1),
+ USAGE_MAXIMUM(1, 6),
+ LOGICAL_MINIMUM(1, 0),
+ LOGICAL_MAXIMUM(1, 1),
+ PHYSICAL_MINIMUM(1, 0),
+ PHYSICAL_MAXIMUM(1, 1),
+ REPORT_SIZE(1, 1),
+ REPORT_COUNT(1, 8),
+ INPUT(1, Data|Var|Abs),
+ END_COLLECTION,
+ END_COLLECTION,
+ };
+#include "pop_hid_macros.h"
+ static const HID_DEVICE_ATTRIBUTES attributes =
+ {
+ .Size = sizeof(HID_DEVICE_ATTRIBUTES),
+ .VendorID = LOWORD(EXPECT_VIDPID),
+ .ProductID = HIWORD(EXPECT_VIDPID),
+ .VersionNumber = 0x0100,
+ };
+ static const HIDP_CAPS caps =
+ {
+ .InputReportByteLength = 3,
+ };
+
+ WCHAR cwd[MAX_PATH], tempdir[MAX_PATH];
+ DWORD report_id = 1, polled = 0;
+ char context[64];
+ LSTATUS status;
+ HKEY hkey;
+
+ GetCurrentDirectoryW( ARRAY_SIZE(cwd), cwd );
+ GetTempPathW( ARRAY_SIZE(tempdir), tempdir );
+ SetCurrentDirectoryW( tempdir );
+
+ status = RegCreateKeyExW( HKEY_LOCAL_MACHINE, L"System\\CurrentControlSet\\Services\\winetest",
+ 0, NULL, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &hkey, NULL );
+ ok( !status, "RegCreateKeyExW returned %#x\n", status );
+ status = RegSetValueExW( hkey, L"ReportID", 0, REG_DWORD, (void *)&report_id, sizeof(report_id) );
+ ok( !status, "RegSetValueExW returned %#x\n", status );
+ status = RegSetValueExW( hkey, L"PolledMode", 0, REG_DWORD, (void *)&polled, sizeof(polled) );
+ ok( !status, "RegSetValueExW returned %#x\n", status );
+ status = RegSetValueExW( hkey, L"Descriptor", 0, REG_BINARY, (void *)gamepad_desc, sizeof(gamepad_desc) );
+ ok( !status, "RegSetValueExW returned %#x\n", status );
+ status = RegSetValueExW( hkey, L"Attributes", 0, REG_BINARY, (void *)&attributes, sizeof(attributes) );
+ ok( !status, "RegSetValueExW returned %#x\n", status );
+ status = RegSetValueExW( hkey, L"Caps", 0, REG_BINARY, (void *)&caps, sizeof(caps) );
+ ok( !status, "RegSetValueExW returned %#x\n", status );
+ status = RegSetValueExW( hkey, L"Expect", 0, REG_BINARY, (void *)NULL, 0 );
+ ok( !status, "RegSetValueExW returned %#x\n", status );
+ status = RegSetValueExW( hkey, L"Input", 0, REG_BINARY, NULL, 0 );
+ ok( !status, "RegSetValueExW returned %#x\n", status );
+ fill_context( __LINE__, context, ARRAY_SIZE(context) );
+ status = RegSetValueExW( hkey, L"Context", 0, REG_BINARY, (void *)context, sizeof(context) );
+ ok( !status, "RegSetValueExW returned %#x\n", status );
+
+ pnp_driver_start( L"driver_hid.dll" );
+ WaitForSingleObject( stop_event, INFINITE );
+ pnp_driver_stop();
+
+ SetCurrentDirectoryW( cwd );
+
+ return 0;
+}
+
START_TEST( hid )
{
if (!dinput_test_init()) return;
diff --git a/dlls/dinput/tests/hotplug.c b/dlls/dinput/tests/hotplug.c
index afe51cf0e97..d271d9bc1db 100644
--- a/dlls/dinput/tests/hotplug.c
+++ b/dlls/dinput/tests/hotplug.c
@@ -31,7 +31,7 @@
#include "dinput.h"
#include "dinputd.h"
#include "devguid.h"
-#include "mmsystem.h"
+#include "dbt.h"
#include "wine/hid.h"
@@ -154,6 +154,285 @@ done:
return device != NULL;
}
+static int device_change_count;
+static int device_change_expect;
+static HWND device_change_hwnd;
+static BOOL device_change_all;
+
+static BOOL all_upper( const WCHAR *str, const WCHAR *end )
+{
+ while (str++ != end) if (towupper( str[-1] ) != str[-1]) return FALSE;
+ return TRUE;
+}
+
+static BOOL all_lower( const WCHAR *str, const WCHAR *end )
+{
+ while (str++ != end) if (towlower( str[-1] ) != str[-1]) return FALSE;
+ return TRUE;
+}
+
+static LRESULT CALLBACK devnotify_wndproc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam )
+{
+ if (msg == WM_DEVICECHANGE)
+ {
+ DEV_BROADCAST_HDR *header = (DEV_BROADCAST_HDR *)lparam;
+ DEV_BROADCAST_DEVICEINTERFACE_W *iface = (DEV_BROADCAST_DEVICEINTERFACE_W *)lparam;
+ const WCHAR *upper_end, *name_end, *expect_prefix;
+ GUID expect_guid;
+
+ if (device_change_all && (device_change_count == 0 || device_change_count == 3))
+ {
+ expect_guid = control_class;
+ expect_prefix = L"\\\\?\\ROOT#";
+ }
+ else
+ {
+ expect_guid = GUID_DEVINTERFACE_HID;
+ expect_prefix = L"\\\\?\\HID#";
+ }
+
+ ok( hwnd == device_change_hwnd, "got hwnd %p\n", hwnd );
+ ok( header->dbch_devicetype == DBT_DEVTYP_DEVICEINTERFACE, "got dbch_devicetype %u\n",
+ header->dbch_devicetype );
+
+ winetest_push_context( "%u", device_change_count );
+
+ todo_wine_if( IsEqualGUID( &iface->dbcc_classguid, &control_class ) && !device_change_all )
+ ok( IsEqualGUID( &iface->dbcc_classguid, &expect_guid ), "got dbch_classguid %s\n",
+ debugstr_guid( &iface->dbcc_classguid ) );
+ ok( iface->dbcc_size >= offsetof( DEV_BROADCAST_DEVICEINTERFACE_W, dbcc_name[wcslen( iface->dbcc_name ) + 1] ),
+ "got dbcc_size %u\n", iface->dbcc_size );
+ todo_wine
+ ok( !wcsncmp( iface->dbcc_name, expect_prefix, wcslen( expect_prefix ) ),
+ "got dbcc_name %s\n", debugstr_w(iface->dbcc_name) );
+
+ upper_end = wcschr( iface->dbcc_name + wcslen( expect_prefix ), '#' );
+ name_end = iface->dbcc_name + wcslen( iface->dbcc_name ) + 1;
+ ok( !!upper_end, "got dbcc_name %s\n", debugstr_w(iface->dbcc_name) );
+ todo_wine
+ ok( all_upper( iface->dbcc_name, upper_end ), "got dbcc_name %s\n", debugstr_w(iface->dbcc_name) );
+ ok( all_lower( upper_end, name_end ), "got dbcc_name %s\n", debugstr_w(iface->dbcc_name) );
+
+ if (device_change_count++ >= device_change_expect / 2)
+ ok( wparam == DBT_DEVICEREMOVECOMPLETE, "got wparam %#x\n", (DWORD)wparam );
+ else
+ ok( wparam == DBT_DEVICEARRIVAL, "got wparam %#x\n", (DWORD)wparam );
+
+ winetest_pop_context();
+ }
+
+ return DefWindowProcW( hwnd, msg, wparam, lparam );
+}
+
+static void test_RegisterDeviceNotification(void)
+{
+ DEV_BROADCAST_DEVICEINTERFACE_A iface_filter_a =
+ {
+ .dbcc_size = sizeof(DEV_BROADCAST_DEVICEINTERFACE_A),
+ .dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE,
+ .dbcc_classguid = GUID_DEVINTERFACE_HID,
+ };
+ WNDCLASSEXW class =
+ {
+ .cbSize = sizeof(WNDCLASSEXW),
+ .hInstance = GetModuleHandleW( NULL ),
+ .lpszClassName = L"devnotify",
+ .lpfnWndProc = devnotify_wndproc,
+ };
+ char buffer[1024] = {0};
+ DEV_BROADCAST_HDR *header = (DEV_BROADCAST_HDR *)buffer;
+ HANDLE hwnd, thread, stop_event;
+ HDEVNOTIFY devnotify;
+ MSG msg;
+
+ RegisterClassExW( &class );
+
+ hwnd = CreateWindowW( class.lpszClassName, NULL, 0, 0, 0, 0, 0, HWND_MESSAGE, NULL, NULL, NULL );
+ ok( !!hwnd, "CreateWindowW failed, error %u\n", GetLastError() );
+
+ SetLastError( 0xdeadbeef );
+ devnotify = RegisterDeviceNotificationA( NULL, NULL, 0 );
+ todo_wine
+ ok( !devnotify, "RegisterDeviceNotificationA succeeded\n" );
+ todo_wine
+ ok( GetLastError() == ERROR_INVALID_PARAMETER, "got error %u\n", GetLastError() );
+ if (devnotify) UnregisterDeviceNotification( devnotify );
+
+ SetLastError( 0xdeadbeef );
+ devnotify = RegisterDeviceNotificationA( (HWND)0xdeadbeef, NULL, 0 );
+ todo_wine
+ ok( !devnotify, "RegisterDeviceNotificationA succeeded\n" );
+ todo_wine
+ ok( GetLastError() == ERROR_INVALID_PARAMETER, "got error %u\n", GetLastError() );
+ if (devnotify) UnregisterDeviceNotification( devnotify );
+
+ SetLastError( 0xdeadbeef );
+ devnotify = RegisterDeviceNotificationA( hwnd, NULL, 2 );
+ todo_wine
+ ok( !devnotify, "RegisterDeviceNotificationA succeeded\n" );
+ todo_wine
+ ok( GetLastError() == ERROR_INVALID_PARAMETER, "got error %u\n", GetLastError() );
+ if (devnotify) UnregisterDeviceNotification( devnotify );
+
+ SetLastError( 0xdeadbeef );
+ memset( header, 0, sizeof(DEV_BROADCAST_OEM) );
+ header->dbch_size = sizeof(DEV_BROADCAST_OEM);
+ header->dbch_devicetype = DBT_DEVTYP_OEM;
+ devnotify = RegisterDeviceNotificationA( hwnd, header, 0 );
+ todo_wine
+ ok( !devnotify, "RegisterDeviceNotificationA succeeded\n" );
+ todo_wine
+ ok( GetLastError() == ERROR_INVALID_DATA || GetLastError() == ERROR_SERVICE_SPECIFIC_ERROR,
+ "got error %u\n", GetLastError() );
+ if (devnotify) UnregisterDeviceNotification( devnotify );
+
+ SetLastError( 0xdeadbeef );
+ memset( header, 0, sizeof(DEV_BROADCAST_DEVNODE) );
+ header->dbch_size = sizeof(DEV_BROADCAST_DEVNODE);
+ header->dbch_devicetype = DBT_DEVTYP_DEVNODE;
+ devnotify = RegisterDeviceNotificationA( hwnd, header, 0 );
+ todo_wine
+ ok( !devnotify, "RegisterDeviceNotificationA succeeded\n" );
+ todo_wine
+ ok( GetLastError() == ERROR_INVALID_DATA || GetLastError() == ERROR_SERVICE_SPECIFIC_ERROR,
+ "got error %u\n", GetLastError() );
+ if (devnotify) UnregisterDeviceNotification( devnotify );
+
+ SetLastError( 0xdeadbeef );
+ memset( header, 0, sizeof(DEV_BROADCAST_VOLUME) );
+ header->dbch_size = sizeof(DEV_BROADCAST_VOLUME);
+ header->dbch_devicetype = DBT_DEVTYP_VOLUME;
+ devnotify = RegisterDeviceNotificationA( hwnd, header, 0 );
+ todo_wine
+ ok( !devnotify, "RegisterDeviceNotificationA succeeded\n" );
+ todo_wine
+ ok( GetLastError() == ERROR_INVALID_DATA || GetLastError() == ERROR_SERVICE_SPECIFIC_ERROR,
+ "got error %u\n", GetLastError() );
+ if (devnotify) UnregisterDeviceNotification( devnotify );
+
+ SetLastError( 0xdeadbeef );
+ memset( header, 0, sizeof(DEV_BROADCAST_PORT_A) );
+ header->dbch_size = sizeof(DEV_BROADCAST_PORT_A);
+ header->dbch_devicetype = DBT_DEVTYP_PORT;
+ devnotify = RegisterDeviceNotificationA( hwnd, header, 0 );
+ todo_wine
+ ok( !devnotify, "RegisterDeviceNotificationA succeeded\n" );
+ todo_wine
+ ok( GetLastError() == ERROR_INVALID_DATA || GetLastError() == ERROR_SERVICE_SPECIFIC_ERROR,
+ "got error %u\n", GetLastError() );
+ if (devnotify) UnregisterDeviceNotification( devnotify );
+
+ SetLastError( 0xdeadbeef );
+ memset( header, 0, sizeof(DEV_BROADCAST_NET) );
+ header->dbch_size = sizeof(DEV_BROADCAST_NET);
+ header->dbch_devicetype = DBT_DEVTYP_NET;
+ devnotify = RegisterDeviceNotificationA( hwnd, header, 0 );
+ todo_wine
+ ok( !devnotify, "RegisterDeviceNotificationA succeeded\n" );
+ todo_wine
+ ok( GetLastError() == ERROR_INVALID_DATA || GetLastError() == ERROR_SERVICE_SPECIFIC_ERROR,
+ "got error %u\n", GetLastError() );
+ if (devnotify) UnregisterDeviceNotification( devnotify );
+
+ devnotify = RegisterDeviceNotificationA( hwnd, &iface_filter_a, DEVICE_NOTIFY_WINDOW_HANDLE );
+ ok( !!devnotify, "RegisterDeviceNotificationA failed, error %u\n", GetLastError() );
+ while (PeekMessageW( &msg, hwnd, 0, 0, PM_REMOVE )) DispatchMessageW( &msg );
+
+ device_change_count = 0;
+ if (!strcmp( winetest_platform, "wine" )) device_change_expect = 4;
+ else device_change_expect = 2;
+ device_change_hwnd = hwnd;
+ device_change_all = FALSE;
+ stop_event = CreateEventW( NULL, FALSE, FALSE, NULL );
+ ok( !!stop_event, "CreateEventW failed, error %u\n", GetLastError() );
+ thread = CreateThread( NULL, 0, dinput_test_device_thread, stop_event, 0, NULL );
+ ok( !!thread, "CreateThread failed, error %u\n", GetLastError() );
+
+ while (device_change_count < device_change_expect)
+ {
+ while (PeekMessageW( &msg, hwnd, 0, 0, PM_REMOVE ))
+ {
+ TranslateMessage( &msg );
+ ok( msg.message != WM_DEVICECHANGE, "got WM_DEVICECHANGE\n" );
+ DispatchMessageW( &msg );
+ }
+ if (device_change_count == device_change_expect / 2) SetEvent( stop_event );
+ }
+
+ WaitForSingleObject( thread, INFINITE );
+ CloseHandle( thread );
+ CloseHandle( stop_event );
+
+ UnregisterDeviceNotification( devnotify );
+
+ memcpy( buffer, &iface_filter_a, sizeof(iface_filter_a) );
+ strcpy( ((DEV_BROADCAST_DEVICEINTERFACE_A *)buffer)->dbcc_name, "device name" );
+ ((DEV_BROADCAST_DEVICEINTERFACE_A *)buffer)->dbcc_size += strlen( "device name" ) + 1;
+ devnotify = RegisterDeviceNotificationA( hwnd, buffer, DEVICE_NOTIFY_WINDOW_HANDLE );
+ ok( !!devnotify, "RegisterDeviceNotificationA failed, error %u\n", GetLastError() );
+ while (PeekMessageW( &msg, hwnd, 0, 0, PM_REMOVE )) DispatchMessageW( &msg );
+
+ device_change_count = 0;
+ if (!strcmp( winetest_platform, "wine" )) device_change_expect = 4;
+ else device_change_expect = 2;
+ device_change_hwnd = hwnd;
+ device_change_all = FALSE;
+ stop_event = CreateEventW( NULL, FALSE, FALSE, NULL );
+ ok( !!stop_event, "CreateEventW failed, error %u\n", GetLastError() );
+ thread = CreateThread( NULL, 0, dinput_test_device_thread, stop_event, 0, NULL );
+ ok( !!thread, "CreateThread failed, error %u\n", GetLastError() );
+
+ while (device_change_count < device_change_expect)
+ {
+ while (PeekMessageW( &msg, hwnd, 0, 0, PM_REMOVE ))
+ {
+ TranslateMessage( &msg );
+ ok( msg.message != WM_DEVICECHANGE, "got WM_DEVICECHANGE\n" );
+ DispatchMessageW( &msg );
+ }
+ if (device_change_count == device_change_expect / 2) SetEvent( stop_event );
+ }
+
+ WaitForSingleObject( thread, INFINITE );
+ CloseHandle( thread );
+ CloseHandle( stop_event );
+
+ UnregisterDeviceNotification( devnotify );
+
+ devnotify = RegisterDeviceNotificationA( hwnd, &iface_filter_a, DEVICE_NOTIFY_ALL_INTERFACE_CLASSES );
+ ok( !!devnotify, "RegisterDeviceNotificationA failed, error %u\n", GetLastError() );
+ while (PeekMessageW( &msg, hwnd, 0, 0, PM_REMOVE )) DispatchMessageW( &msg );
+
+ device_change_count = 0;
+ device_change_expect = 4;
+ device_change_hwnd = hwnd;
+ device_change_all = TRUE;
+ stop_event = CreateEventW( NULL, FALSE, FALSE, NULL );
+ ok( !!stop_event, "CreateEventW failed, error %u\n", GetLastError() );
+ thread = CreateThread( NULL, 0, dinput_test_device_thread, stop_event, 0, NULL );
+ ok( !!thread, "CreateThread failed, error %u\n", GetLastError() );
+
+ while (device_change_count < device_change_expect)
+ {
+ while (PeekMessageW( &msg, hwnd, 0, 0, PM_REMOVE ))
+ {
+ TranslateMessage( &msg );
+ ok( msg.message != WM_DEVICECHANGE, "got WM_DEVICECHANGE\n" );
+ DispatchMessageW( &msg );
+ }
+ if (device_change_count == device_change_expect / 2) SetEvent( stop_event );
+ }
+
+ WaitForSingleObject( thread, INFINITE );
+ CloseHandle( thread );
+ CloseHandle( stop_event );
+
+ UnregisterDeviceNotification( devnotify );
+
+ DestroyWindow( hwnd );
+ UnregisterClassW( class.lpszClassName, class.hInstance );
+}
+
START_TEST( hotplug )
{
if (!dinput_test_init()) return;
@@ -163,6 +442,8 @@ START_TEST( hotplug )
{
test_input_lost( 0x700 );
test_input_lost( 0x800 );
+
+ test_RegisterDeviceNotification();
}
CoUninitialize();
--
2.34.1
Jan. 26, 2022