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
Re: [PATCH v2 resend 6/6] comctl32/listview: Fix deselect on LVS_OWNERDATA.
by Angelo Haller
On 11/06/2022 02.55, Zhiyi Zhang wrote:
>
> On 6/11/22 02:18, Angelo Haller wrote:
>> On 10/06/2022 03.13, Zhiyi Zhang wrote:
>>> On 5/26/22 04:00, Angelo Haller wrote:
>>>> From: Angelo Haller <angelo(a)szanni.org>
>>>>
>>>> Send one "deselect all items" notification on selection change for
>>>> LVS_OWNERDATA listviews instead of notifying about each individual
>>>> item change.
>>>>
>>>> Enable LVS_OWNERDATA multi select tests for wine.
>>>>
>>>> Signed-off-by: Angelo Haller <angelo(a)szanni.org>
>>>> ---
>>>> dlls/comctl32/listview.c | 6 ++++++
>>>> dlls/comctl32/tests/listview.c | 8 ++++----
>>>> 2 files changed, 10 insertions(+), 4 deletions(-)
>>>>
>>>> diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
>>>> index bb394974906..a71e34b99d9 100644
>>>> --- a/dlls/comctl32/listview.c
>>>> +++ b/dlls/comctl32/listview.c
>>>> @@ -3406,6 +3406,12 @@ static BOOL LISTVIEW_DeselectAllSkipItems(LISTVIEW_INFO *infoPtr, RANGES toSkip)
>>>> lvItem.state = 0;
>>>> lvItem.stateMask = LVIS_SELECTED;
>>>> +
>>>> + /* notify deselect of all items (-1) on LVS_OWNERDATA style */
>>>> + if (infoPtr->dwStyle & LVS_OWNERDATA) {
>>>> + LISTVIEW_SetItemState(infoPtr, -1, &lvItem);
>>>> + return TRUE;
>>>> + }
>>> Please add a separate test for this. Select and then deselect all items instead of mixing it with other tests.
>> Maybe the comment needs to be better. Deselect all (-1) is the ONLY signal ever sent on ANY deselection,
>> be it one or multiple items (for LVS_OWNERDATA).
>> This is how win32 implements it, hence there is no way of making this a separate test.
>>
>> Maybe the line should read:
>>
>> /* Always send one deselect all (-1) notification for LVS_OWNERDATA style instead of
>> * informing individual items of deselection */
>>
>> And I am still looking into the other remarks. Some might need reordering as I won't be able to
>> enable the tests without this last patch.
>>
>> Thanks for the feedback so far!
> I was thinking adding a test that selects items, and them maybe send a mouse click somewhere
> in the blank space of the listview control to deselect them all to show that only a -1 notification is sent.
> But it may be difficult to get the tests work reliably. If you can't make it work, I guess mixing it with
> other tests is okay.
We do not need mouse clicks. See my reply to your comment in 1/6. The
deselect of multiple items can be triggered by selecting multiple
holding shift, releasing shift and moving the cursor again. This
deselects multiple. The code testing for this is already in 1/6.
My comment was with regards to enabling the tests individually. I might
be able to do so by reordering and spitting some of the patches.
>
>
>>>> /* need to clone the DPA because callbacks can change it */
>>>> if (!(clone = ranges_clone(infoPtr->selectionRanges))) return FALSE;
>>>> diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c
>>>> index 78b3e3ae069..066858ac7e8 100644
>>>> --- a/dlls/comctl32/tests/listview.c
>>>> +++ b/dlls/comctl32/tests/listview.c
>>>> @@ -3598,7 +3598,7 @@ static void test_ownerdata_multiselect(void)
>>>> ok_sequence(sequences, PARENT_ODSTATECHANGED_SEQ_INDEX,
>>>> ownerdata_multiselect_select_0_to_1_seq,
>>>> - "ownerdata multiselect: select multiple via SHIFT", TRUE);
>>>> + "ownerdata multiselect: select multiple via SHIFT", FALSE);
>>>> res = SendMessageA(hwnd, WM_KEYUP, VK_DOWN, 0);
>>>> expect(0, res);
>>>> @@ -3615,7 +3615,7 @@ static void test_ownerdata_multiselect(void)
>>>> ok_sequence(sequences, PARENT_ODSTATECHANGED_SEQ_INDEX,
>>>> ownerdata_multiselect_select_0_to_2_seq,
>>>> - "ownerdata multiselect: select multiple via SHIFT+CONTROL", TRUE);
>>>> + "ownerdata multiselect: select multiple via SHIFT+CONTROL", FALSE);
>>>> res = SendMessageA(hwnd, WM_KEYUP, VK_DOWN, 0);
>>>> expect(0, res);
>>>> @@ -3633,7 +3633,7 @@ static void test_ownerdata_multiselect(void)
>>>> ok_sequence(sequences, PARENT_ODSTATECHANGED_SEQ_INDEX,
>>>> ownerdata_multiselect_deselect_all_select_3_seq,
>>>> - "ownerdata multiselect: deselect all, select item 3", TRUE);
>>>> + "ownerdata multiselect: deselect all, select item 3", FALSE);
>>>> res = SendMessageA(hwnd, LVM_GETSELECTEDCOUNT, 0, 0);
>>>> expect(1, res);
>>>> @@ -3645,7 +3645,7 @@ static void test_ownerdata_multiselect(void)
>>>> ok_sequence(sequences, PARENT_ODSTATECHANGED_SEQ_INDEX,
>>>> ownerdata_multiselect_deselect_3_select_2_seq,
>>>> - "ownerdata multiselect: deselect item 3, select item 2", TRUE);
>>>> + "ownerdata multiselect: deselect item 3, select item 2", FALSE);;
>>> Extra ;
>>>
>>>
>>> Thanks,
>>> Zhiyi
>>>
>>>
>>>> DestroyWindow(hwnd);
>>>> }
>>
June 11, 2022
Re: [PATCH v2 resend 3/6] comctl32/listview: Send LVN_ODSTATECHANGED only for virtual lists.
by Angelo Haller
On 11/06/2022 03.02, Zhiyi Zhang wrote:
>
> On 6/11/22 07:56, Angelo Haller wrote:
>> On 10/06/2022 03.13, Zhiyi Zhang wrote:
>>> On 5/26/22 04:00, Angelo Haller wrote:
>>>> From: Angelo Haller <angelo(a)szanni.org>
>>>>
>>>> The LVN_ODSTATECHANGED notification should only be sent to lists
>>>> that have LVS_OWNERDATA set.
>>>>
>>>> Signed-off-by: Angelo Haller <angelo(a)szanni.org>
>>>> ---
>>>> dlls/comctl32/listview.c | 1 +
>>>> 1 file changed, 1 insertion(+)
>>>>
>>>> diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
>>>> index 72ade724313..318df0a4093 100644
>>>> --- a/dlls/comctl32/listview.c
>>>> +++ b/dlls/comctl32/listview.c
>>>> @@ -8946,6 +8946,7 @@ static VOID LISTVIEW_SetOwnerDataState(LISTVIEW_INFO *infoPtr, INT nFirst, INT n
>>>> {
>>>> NMLVODSTATECHANGE nmlv;
>>>> + if (!(infoPtr->dwStyle & LVS_OWNERDATA)) return;
>>> Make sense. It will be better if you can add a simple test before this patch and remove the todo_wines after the fix.
>> Is this strictly necessary? The call site has special handling for:
>> infoPtr->dwStyle & LVS_OWNERDATA
>>
>> We could guard the call to the function at the call site, if that is preferred.
>>
>> Apart from that I am not sure how to write a test for this. This bug is triggered by creating a non ownerdata list and selecting multiple entries holding shift+ctrl and clicking with the mouse. This will send an LVN_ODSTATECHANGED notification where it is not supposed to (as it is not an ownerdata list).
> You can write a test that demonstrate the exact same thing. Create a non onwerdata listview control and test the message sequence doesn't contain LVN_ODSTATECHANGED, which should have a todo_wine
> because Wine is currently broken in this case. Then you fix it in the next patch and removes the todo_wine.
>
> As for the mouse emulation, could you do it using only the keyboard? Such as sending VK_DOWN while holding Shift and Ctrl?
>
This is exactly what I was trying to communicate. I can NOT trigger the
erroneous sending of LVN_ODSTATECHANGED via the keyboard.
The bug is in LISTVIEW_AddGroupSelection which gets called from
LISTVIEW_LButtonDown.
Patch 2/6 moves the offending code to a new function
LISTVIEW_SetOwnerdataState().
This is why I asked about opening a bug report with an contrived
application that crashes with wine but not with windows.
>> I have not found any test examples with mouse emulation. Maybe I missed something.
>>
>> Or should I open a separate bug report for this line?
>>
>>>> if (!item) return;
>>>> ZeroMemory(&nmlv, sizeof(nmlv));
>>
June 11, 2022
Re: [PATCH v2 resend 1/6] comctl32/tests: Expand ownerdata listview tests.
by Angelo Haller
On 11/06/2022 02.57, Zhiyi Zhang wrote:
>
> On 6/11/22 02:33, Angelo Haller wrote:
>> On 10/06/2022 03.12, Zhiyi Zhang wrote:
>>> On 5/26/22 04:00, Angelo Haller wrote:
>>>> From: Angelo Haller <angelo(a)szanni.org>
>>>>
>>>> Add more test cases to ownderdata listviews.
>>>> Check LVN_ITEMCHANGED IDs.
>>>>
>>>> Signed-off-by: Angelo Haller <angelo(a)szanni.org>
>>>> ---
>>>> dlls/comctl32/tests/listview.c | 59 +++++++++++++++++++++++++++++-----
>>>> 1 file changed, 51 insertions(+), 8 deletions(-)
>>>>
>>>> diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c
>>>> index 6ac7f53137d..78b3e3ae069 100644
>>>> --- a/dlls/comctl32/tests/listview.c
>>>> +++ b/dlls/comctl32/tests/listview.c
>>>> @@ -255,11 +255,33 @@ static const struct message ownerdata_deselect_all_parent_seq[] = {
>>>> { 0 }
>>>> };
>>>> -static const struct message ownerdata_multiselect_odstatechanged_seq[] = {
>>>> - { WM_NOTIFY, sent|id, 0, 0, LVN_ITEMCHANGED },
>>>> +static const struct message ownerdata_multiselect_select_0_to_1_seq[] = {
>>>> + { WM_NOTIFY, sent|id|wparam, -1, 0, LVN_ITEMCHANGED },
>>>> { WM_NOTIFY, sent|id, 0, 0, LVN_ODSTATECHANGED },
>>>> - { WM_NOTIFY, sent|id, 0, 0, LVN_ITEMCHANGED },
>>>> - { WM_NOTIFY, sent|id, 0, 0, LVN_ITEMCHANGED },
>>>> + { WM_NOTIFY, sent|id|wparam, 0, 0, LVN_ITEMCHANGED },
>>>> + { WM_NOTIFY, sent|id|wparam, 1, 0, LVN_ITEMCHANGED },
>>>> + { 0 }
>>>> +};
>>>> +
>>>> +static const struct message ownerdata_multiselect_select_0_to_2_seq[] = {
>>>> + { WM_NOTIFY, sent|id|wparam, -1, 0, LVN_ITEMCHANGED },
>>>> + { WM_NOTIFY, sent|id, 0, 0, LVN_ODSTATECHANGED },
>>>> + { WM_NOTIFY, sent|id|wparam, 1, 0, LVN_ITEMCHANGED },
>>>> + { WM_NOTIFY, sent|id|wparam, 2, 0, LVN_ITEMCHANGED },
>>>> + { 0 }
>>>> +};
>>>> +
>>>> +static const struct message ownerdata_multiselect_deselect_all_select_3_seq[] = {
>>>> + { WM_NOTIFY, sent|id|wparam, -1, 0, LVN_ITEMCHANGED },
>>>> + { WM_NOTIFY, sent|id|wparam, 2, 0, LVN_ITEMCHANGED },
>>>> + { WM_NOTIFY, sent|id|wparam, 3, 0, LVN_ITEMCHANGED },
>>>> + { 0 }
>>>> +};
>>>> +
>>>> +static const struct message ownerdata_multiselect_deselect_3_select_2_seq[] = {
>>>> + { WM_NOTIFY, sent|id|wparam, -1, 0, LVN_ITEMCHANGED },
>>>> + { WM_NOTIFY, sent|id|wparam, 3, 0, LVN_ITEMCHANGED },
>>>> + { WM_NOTIFY, sent|id|wparam, 2, 0, LVN_ITEMCHANGED },
>>>> { 0 }
>>>> };
>>>> @@ -3575,8 +3597,8 @@ static void test_ownerdata_multiselect(void)
>>>> expect(0, res);
>>>> ok_sequence(sequences, PARENT_ODSTATECHANGED_SEQ_INDEX,
>>>> - ownerdata_multiselect_odstatechanged_seq,
>>>> - "ownerdata select multiple notification", TRUE);
>>>> + ownerdata_multiselect_select_0_to_1_seq,
>>>> + "ownerdata multiselect: select multiple via SHIFT", TRUE);
>>>> res = SendMessageA(hwnd, WM_KEYUP, VK_DOWN, 0);
>>>> expect(0, res);
>>>> @@ -3592,8 +3614,8 @@ static void test_ownerdata_multiselect(void)
>>>> expect(0, res);
>>>> ok_sequence(sequences, PARENT_ODSTATECHANGED_SEQ_INDEX,
>>>> - ownerdata_multiselect_odstatechanged_seq,
>>>> - "ownerdata select multiple notification", TRUE);
>>>> + ownerdata_multiselect_select_0_to_2_seq,
>>>> + "ownerdata multiselect: select multiple via SHIFT+CONTROL", TRUE);
>>>> res = SendMessageA(hwnd, WM_KEYUP, VK_DOWN, 0);
>>>> expect(0, res);
>>>> @@ -3604,6 +3626,27 @@ static void test_ownerdata_multiselect(void)
>>>> res = SendMessageA(hwnd, LVM_GETSELECTEDCOUNT, 0, 0);
>>>> expect(3, res);
>>>> + flush_sequences(sequences, NUM_MSG_SEQUENCES);
>>>> +
>>>> + res = SendMessageA(hwnd, WM_KEYDOWN, VK_DOWN, 0);
>>>> + expect(0, res);
>>>> +
>>>> + ok_sequence(sequences, PARENT_ODSTATECHANGED_SEQ_INDEX,
>>>> + ownerdata_multiselect_deselect_all_select_3_seq,
>>>> + "ownerdata multiselect: deselect all, select item 3", TRUE);
>>>> +
>>>> + res = SendMessageA(hwnd, LVM_GETSELECTEDCOUNT, 0, 0);
>>>> + expect(1, res);
>>> Hi Angelo,
>>>
>>> Thanks for looking into this. There are a few things can be improved for this series.
>>>
>>> Please complete the keyboard sequence by sending WM_KEYUP for VK_DOWN and
>>> WM_KEYUP for VK_UP.
>> I'll add the WM_KEYUP events for sure. Not sure how that slipped.
>>> Also please add tests for pressing VK_UP while holding Shift after setting pressing VK_DOWN while holding Shift.
>>> Same for holding both Shift and Control And add checks for NMLVODSTATECHANGE member values. For example,
>>> I don't think uOldState should always be 0.
>> Happy to add more tests for VK_UP.
>>
>> With regards to the uOldState: I have not found an instance where it is not 0. Which kind of makes sense, at least according to the underlying logic.
>>
>> Windows seems to only use LVN_ODSTATECHANGED to set a new state (selection of multiple items). For un-setting (uOldState != 0) Windows will instead send an all items changed (LVN_ITEMCHANGED = -1) signal instead. That is at least what I have observed in my testing.
> I see. Please add that tests as well.
That test is in this exact patch. This is why I added
ownerdata_multiselect_deselect_all_select_3_seq. It checks that on
deslection of multiple items NO LVN_ODSTATECHANGED is send but instead
LVN_ITEMCHANGED = -1.
Or did i misunderstand?
>
>>>> +
>>>> + flush_sequences(sequences, NUM_MSG_SEQUENCES);
>>>> +
>>>> + res = SendMessageA(hwnd, WM_KEYDOWN, VK_UP, 0);
>>>> + expect(0, res);
>>>> +
>>>> + ok_sequence(sequences, PARENT_ODSTATECHANGED_SEQ_INDEX,
>>>> + ownerdata_multiselect_deselect_3_select_2_seq,
>>>> + "ownerdata multiselect: deselect item 3, select item 2", TRUE);
>>>> +
>>>> DestroyWindow(hwnd);
>>>> }
>>>>
>>
June 11, 2022
Re: [PATCH 0/5] MR228: d3dx: improvements to texture creation functions
by Piotr Caban (@piotr)
Patch 4 (d3dx10: Add D3DX10CreateAsyncTextureProcessor implementation) needs some work (the texture should be created in CreateDeviceObject). I'll prepare better version.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/228#note_1903
June 11, 2022
Re: [PATCH 3/6] windows.media.speech/tests: Add basic tests for ssml/text to stream functions.
by Cláudio Sampaio
Hi Bernard,
You have been doing windows.media.speech mainly due to Phasmophobia, right?
There was an update today:
https://steamcommunity.com/app/739630/eventcomments/3421060714389955228/
Specifically this excerpt:
Our Voice recognition system has been completely replaced!
We are no longer relying on Windows' speech systems, meaning it supports
many more languages and platforms, such as ‘GeForce Now’ and Steam Deck,
with no setup required (and fixes that pesky tab-out bug).
- You now only need to set your microphone in-game, instead of your
‘Windows Default Microphone’
- You can now see the input volume of your microphone in the Audio
Settings
- Additional microphone input options have been added:
- Voice Detector Sensitivity
- Noise Suppression
- Due to the new system only working if you are in a server, the voice
recognition test has been removed.
It seems that dknighter (the game main developer) did that for the Steam
Deck. I haven't yet tested on my Deck, but did not work on my Arch Linux
(maybe an early bug).
Does that harm your work? Or I'm wrong about Phasmophobia being the main
drive behind your massive work?
On Thu, Jun 9, 2022 at 6:48 PM Bernhard Kölbl <wine(a)gitlab.winehq.org>
wrote:
> From: Bernhard Kölbl <besentv(a)gmail.com>
>
> Signed-off-by: Bernhard Kölbl <besentv(a)gmail.com>
> ---
> dlls/windows.media.speech/tests/speech.c | 80 ++++++++++++++++++++++--
> 1 file changed, 76 insertions(+), 4 deletions(-)
>
> diff --git a/dlls/windows.media.speech/tests/speech.c
> b/dlls/windows.media.speech/tests/speech.c
> index 7c870901de9..9df71e2b6cb 100644
> --- a/dlls/windows.media.speech/tests/speech.c
> +++ b/dlls/windows.media.speech/tests/speech.c
> @@ -779,18 +779,26 @@ static void test_ActivationFactory(void)
>
> static void test_SpeechSynthesizer(void)
> {
> + static const WCHAR *simple_ssml =
> + L"<speak version='1.0' xmlns='http://www.w3.org/2001/10/synthesis'
> xml:lang='en-US'>"
> + "Hello, how are you doing today?"
> + "</speak>";
> + static const WCHAR *simple_synth_text = L"Hello, how are you doing
> today?";
> static const WCHAR *speech_synthesizer_name =
> L"Windows.Media.SpeechSynthesis.SpeechSynthesizer";
> static const WCHAR *speech_synthesizer_name2 =
> L"windows.media.speechsynthesis.speechsynthesizer";
> static const WCHAR *unknown_class_name = L"Unknown.Class";
> IActivationFactory *factory = NULL, *factory2 = NULL;
> + IAsyncOperation_SpeechSynthesisStream *operation_ss_stream = NULL;
> IVectorView_VoiceInformation *voices = NULL;
> IInstalledVoicesStatic *voices_static = NULL;
> + ISpeechSynthesisStream *ss_stream = NULL;
> IVoiceInformation *voice;
> IInspectable *inspectable = NULL, *tmp_inspectable = NULL;
> IAgileObject *agile_object = NULL, *tmp_agile_object = NULL;
> ISpeechSynthesizer *synthesizer;
> ISpeechSynthesizer2 *synthesizer2;
> IClosable *closable;
> + struct async_inspectable_handler async_inspectable_handler;
> HMODULE hdll;
> HSTRING str, str2;
> HRESULT hr;
> @@ -843,6 +851,7 @@ static void test_SpeechSynthesizer(void)
> FreeLibrary(hdll);
> }
>
> + /* Test static Synth ifaces: IActivationFactory,
> IInstalledVoicesStatic, etc. */
> hr = IActivationFactory_QueryInterface(factory, &IID_IInspectable,
> (void **)&inspectable);
> ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IInspectable
> failed, hr %#lx\n", hr);
>
> @@ -889,11 +898,24 @@ static void test_SpeechSynthesizer(void)
>
> IVectorView_VoiceInformation_Release(voices);
>
> - IInstalledVoicesStatic_Release(voices_static);
> + hr = IInstalledVoicesStatic_get_DefaultVoice(voices_static, &voice);
> + todo_wine ok(hr == S_OK, "IInstalledVoicesStatic_get_DefaultVoice
> failed, hr %#lx\n", hr);
> +
> + if (hr == S_OK)
> + {
> + IVoiceInformation_get_Description(voice, &str2);
> + trace("SpeechSynthesizer default voice %s.\n",
> debugstr_hstring(str2));
> +
> + WindowsDeleteString(str2);
> + ref = IVoiceInformation_Release(voice);
> + ok(ref == 0, "Got unexpected ref %lu.\n", ref);
> + }
>
> + IInstalledVoicesStatic_Release(voices_static);
> IAgileObject_Release(agile_object);
> IInspectable_Release(inspectable);
>
> + /* Test Synthesizer */
> hr = IActivationFactory_QueryInterface(factory,
> &IID_ISpeechSynthesizer, (void **)&synthesizer);
> ok(hr == E_NOINTERFACE, "Got unexpected hr %#lx.\n", hr);
>
> @@ -903,13 +925,63 @@ static void test_SpeechSynthesizer(void)
> hr = IInspectable_QueryInterface(inspectable,
> &IID_ISpeechSynthesizer, (void **)&synthesizer);
> ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
>
> + /* Test SynthesizeTextToStreamAsync */
> + hr = WindowsCreateString(simple_synth_text,
> wcslen(simple_synth_text), &str);
> + ok(hr == S_OK, "WindowsCreateString failed, hr %#lx\n", hr);
> +
> + hr = ISpeechSynthesizer_SynthesizeTextToStreamAsync(synthesizer, str,
> &operation_ss_stream);
> + todo_wine ok(hr == S_OK,
> "ISpeechSynthesizer_SynthesizeSsmlToStreamAsync failed, hr %#lx\n", hr);
> + if(FAILED(hr)) goto skip_ss_stream;
> +
> + await_async_inspectable((IAsyncOperation_IInspectable
> *)operation_ss_stream,
> + &async_inspectable_handler,
> +
> &IID_IAsyncOperationCompletedHandler_SpeechSynthesisStream);
> + check_async_info((IInspectable *)operation_ss_stream, 1, Completed,
> S_OK);
> + 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);
> +
> + if (hr == S_OK && ss_stream)
> + {
> + ref = ISpeechSynthesisStream_Release(ss_stream);
> + todo_wine ok(ref == 0, "Got unexpected ref %lu.\n", ref);
> + }
> +
> + IAsyncOperation_SpeechSynthesisStream_Release(operation_ss_stream);
> + WindowsDeleteString(str);
> +
> + /* Test SynthesizeSsmlToStreamAsync */
> + hr = WindowsCreateString(simple_ssml, wcslen(simple_ssml), &str);
> + ok(hr == S_OK, "WindowsCreateString failed, hr %#lx\n", hr);
> +
> + hr = ISpeechSynthesizer_SynthesizeSsmlToStreamAsync(synthesizer, str,
> &operation_ss_stream);
> + todo_wine ok(hr == S_OK,
> "ISpeechSynthesizer_SynthesizeSsmlToStreamAsync failed, hr %#lx\n", hr);
> + await_async_inspectable((IAsyncOperation_IInspectable
> *)operation_ss_stream,
> + &async_inspectable_handler,
> +
> &IID_IAsyncOperationCompletedHandler_SpeechSynthesisStream);
> + check_async_info((IInspectable *)operation_ss_stream, 2, Completed,
> S_OK);
> + 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);
> +
> + if (hr == S_OK && ss_stream)
> + {
> + ref = ISpeechSynthesisStream_Release(ss_stream);
> + ok(ref == 0, "Got unexpected ref %lu.\n", ref);
> + }
> +
> + IAsyncOperation_SpeechSynthesisStream_Release(operation_ss_stream);
> +
> +skip_ss_stream:
> + WindowsDeleteString(str);
> +
> hr = IInspectable_QueryInterface(inspectable, &IID_IClosable, (void
> **)&closable);
> ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
>
> hr = IInspectable_QueryInterface(inspectable,
> &IID_ISpeechSynthesizer2, (void **)&synthesizer2);
> - ok(hr == S_OK ||
> - broken(hr == E_NOINTERFACE), /* requires newer Windows */
> - "Got unexpected hr %#lx.\n", hr);
> + ok(hr == S_OK || broken(hr == E_NOINTERFACE), "Got unexpected hr
> %#lx.\n", hr); /* Requires Win10 >= 1703 */
>
> if (hr == S_OK)
> {
> --
> GitLab
>
>
> https://gitlab.winehq.org/wine/wine/-/merge_requests/217
>
>
--
Cláudio "Patola" Sampaio
Wrocław, Polska
June 11, 2022
[PATCH 5/5] d3dx10/tests: Add D3DX10CreateAsyncTextureProcessor tests.
by Piotr Caban
From: Piotr Caban <piotr(a)codeweavers.com>
Signed-off-by: Piotr Caban <piotr(a)codeweavers.com>
---
dlls/d3dx10_43/tests/d3dx10.c | 64 +++++++++++++++++++++++++++++++++++
1 file changed, 64 insertions(+)
diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c
index 54533f5c738..a0a2b4fc32b 100644
--- a/dlls/d3dx10_43/tests/d3dx10.c
+++ b/dlls/d3dx10_43/tests/d3dx10.c
@@ -2003,6 +2003,69 @@ static void test_D3DX10CreateAsyncTextureInfoProcessor(void)
CoUninitialize();
}
+static void test_D3DX10CreateAsyncTextureProcessor(void)
+{
+ ID3DX10DataProcessor *dp;
+ ID3D10Resource *resource;
+ ID3D10Device *device;
+ HRESULT hr;
+ int i;
+
+ device = create_device();
+ if (!device)
+ {
+ skip("Failed to create device, skipping tests.\n");
+ return;
+ }
+
+ CoInitialize(NULL);
+
+ hr = D3DX10CreateAsyncTextureProcessor(device, NULL, NULL);
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+
+ hr = D3DX10CreateAsyncTextureProcessor(NULL, NULL, &dp);
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+
+ hr = D3DX10CreateAsyncTextureProcessor(device, NULL, &dp);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ hr = ID3DX10DataProcessor_Process(dp, (void *)test_image[0].data, 0);
+ ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
+ hr = ID3DX10DataProcessor_Process(dp, NULL, test_image[0].size);
+ ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
+ hr = ID3DX10DataProcessor_Destroy(dp);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+
+ for (i = 0; i < ARRAY_SIZE(test_image); ++i)
+ {
+ winetest_push_context("Test %u", i);
+
+ hr = D3DX10CreateAsyncTextureProcessor(device, NULL, &dp);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+
+ hr = ID3DX10DataProcessor_Process(dp, (void *)test_image[i].data, test_image[i].size);
+ todo_wine_if(test_image[i].expected_info.MiscFlags & D3D10_RESOURCE_MISC_TEXTURECUBE)
+ ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP),
+ "Got unexpected hr %#x.\n", hr);
+ if (hr == S_OK)
+ {
+ hr = ID3DX10DataProcessor_CreateDeviceObject(dp, (void **)&resource);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ check_resource_info(resource, test_image + i, __LINE__);
+ check_resource_data(resource, test_image + i, __LINE__);
+ ID3D10Resource_Release(resource);
+ }
+
+ hr = ID3DX10DataProcessor_Destroy(dp);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+
+ winetest_pop_context();
+ }
+
+ CoUninitialize();
+
+ ID3D10Device_Release(device);
+}
+
static void test_get_image_info(void)
{
static const WCHAR test_resource_name[] = L"resource.data";
@@ -3493,6 +3556,7 @@ START_TEST(d3dx10)
test_D3DX10CreateAsyncFileLoader();
test_D3DX10CreateAsyncResourceLoader();
test_D3DX10CreateAsyncTextureInfoProcessor();
+ test_D3DX10CreateAsyncTextureProcessor();
test_get_image_info();
test_create_texture();
test_font();
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/228
June 11, 2022
[PATCH 4/5] d3dx10: Add D3DX10CreateAsyncTextureProcessor implementation.
by Piotr Caban
From: Piotr Caban <piotr(a)codeweavers.com>
Signed-off-by: Piotr Caban <piotr(a)codeweavers.com>
---
dlls/d3dx10_43/async.c | 83 +++++++++++++++++++++++++++++++++++++-
dlls/d3dx10_43/dxhelpers.h | 2 +
dlls/d3dx10_43/texture.c | 41 ++++++++++---------
3 files changed, 105 insertions(+), 21 deletions(-)
diff --git a/dlls/d3dx10_43/async.c b/dlls/d3dx10_43/async.c
index f0c726944c0..9efe52f0792 100644
--- a/dlls/d3dx10_43/async.c
+++ b/dlls/d3dx10_43/async.c
@@ -16,6 +16,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#define COBJMACROS
#include "d3d10_1.h"
#include "d3dx10.h"
#include "d3dcompiler.h"
@@ -315,6 +316,68 @@ static ID3DX10DataProcessorVtbl texture_info_processor_vtbl =
texture_info_processor_Destroy
};
+struct texture_processor
+{
+ ID3DX10DataProcessor ID3DX10DataProcessor_iface;
+ ID3D10Device *device;
+ D3DX10_IMAGE_LOAD_INFO *info;
+ ID3D10Resource *texture;
+};
+
+static inline struct texture_processor *texture_processor_from_ID3DX10DataProcessor(ID3DX10DataProcessor *iface)
+{
+ return CONTAINING_RECORD(iface, struct texture_processor, ID3DX10DataProcessor_iface);
+}
+
+static HRESULT WINAPI texture_processor_Process(ID3DX10DataProcessor *iface, void *data, SIZE_T size)
+{
+ struct texture_processor *processor = texture_processor_from_ID3DX10DataProcessor(iface);
+
+ TRACE("iface %p, data %p, size %Iu.\n", iface, data, size);
+
+ if (processor->texture)
+ {
+ FIXME("called multiple times\n");
+ ID3D10Resource_Release(processor->texture);
+ processor->texture = NULL;
+ }
+ return create_texture(processor->device, data, size, processor->info, &processor->texture);
+}
+
+static HRESULT WINAPI texture_processor_CreateDeviceObject(ID3DX10DataProcessor *iface, void **object)
+{
+ struct texture_processor *processor = texture_processor_from_ID3DX10DataProcessor(iface);
+
+ TRACE("iface %p, object %p.\n", iface, object);
+
+ if (!processor->texture)
+ return E_FAIL;
+
+ *object = processor->texture;
+ ID3D10Resource_AddRef(processor->texture);
+ return S_OK;
+}
+
+static HRESULT WINAPI texture_processor_Destroy(ID3DX10DataProcessor *iface)
+{
+ struct texture_processor *processor = texture_processor_from_ID3DX10DataProcessor(iface);
+
+ TRACE("iface %p.\n", iface);
+
+ if (processor->texture)
+ ID3D10Resource_Release(processor->texture);
+ ID3D10Device_Release(processor->device);
+ free(processor);
+ return S_OK;
+}
+
+static ID3DX10DataProcessorVtbl texture_processor_vtbl =
+{
+ texture_processor_Process,
+ texture_processor_CreateDeviceObject,
+ texture_processor_Destroy
+};
+
HRESULT WINAPI D3DX10CompileFromMemory(const char *data, SIZE_T data_size, const char *filename,
const D3D10_SHADER_MACRO *defines, ID3D10Include *include, const char *entry_point,
const char *target, UINT sflags, UINT eflags, ID3DX10ThreadPump *pump, ID3D10Blob **shader,
@@ -517,8 +580,24 @@ HRESULT WINAPI D3DX10CreateAsyncTextureInfoProcessor(D3DX10_IMAGE_INFO *info, ID
HRESULT WINAPI D3DX10CreateAsyncTextureProcessor(ID3D10Device *device,
D3DX10_IMAGE_LOAD_INFO *info, ID3DX10DataProcessor **processor)
{
- FIXME("device %p, info %p, processor %p stub!\n", device, info, processor);
- return E_NOTIMPL;
+ struct texture_processor *object;
+
+ TRACE("device %p, info %p, processor %p.\n", device, info, processor);
+
+ if (!device || !processor)
+ return E_INVALIDARG;
+
+ object = calloc(1, sizeof(*object));
+ if (!object)
+ return E_OUTOFMEMORY;
+
+ object->ID3DX10DataProcessor_iface.lpVtbl = &texture_processor_vtbl;
+ object->device = device;
+ ID3D10Device_AddRef(device);
+ object->info = info;
+
+ *processor = &object->ID3DX10DataProcessor_iface;
+ return S_OK;
}
HRESULT WINAPI D3DX10PreprocessShaderFromMemory(const char *data, SIZE_T data_size, const char *filename,
diff --git a/dlls/d3dx10_43/dxhelpers.h b/dlls/d3dx10_43/dxhelpers.h
index 82fe639c2ea..1ecbd9f7866 100644
--- a/dlls/d3dx10_43/dxhelpers.h
+++ b/dlls/d3dx10_43/dxhelpers.h
@@ -23,3 +23,5 @@ extern HRESULT load_resourceW(HMODULE module, const WCHAR *resource,
void **data, DWORD *size) DECLSPEC_HIDDEN;
extern HRESULT get_image_info(const void *data, SIZE_T size, D3DX10_IMAGE_INFO *img_info) DECLSPEC_HIDDEN;
+extern HRESULT create_texture(ID3D10Device *device, const void *data, SIZE_T size,
+ D3DX10_IMAGE_LOAD_INFO *load_info, ID3D10Resource **texture) DECLSPEC_HIDDEN;
diff --git a/dlls/d3dx10_43/texture.c b/dlls/d3dx10_43/texture.c
index d5066b9793b..0f4212b97ef 100644
--- a/dlls/d3dx10_43/texture.c
+++ b/dlls/d3dx10_43/texture.c
@@ -669,8 +669,8 @@ HRESULT WINAPI D3DX10CreateTextureFromResourceW(ID3D10Device *device, HMODULE mo
return D3DX10CreateTextureFromMemory(device, buffer, size, load_info, pump, texture, hresult);
}
-HRESULT WINAPI D3DX10CreateTextureFromMemory(ID3D10Device *device, const void *src_data, SIZE_T src_data_size,
- D3DX10_IMAGE_LOAD_INFO *load_info, ID3DX10ThreadPump *pump, ID3D10Resource **texture, HRESULT *hresult)
+HRESULT create_texture(ID3D10Device *device, const void *data, SIZE_T size,
+ D3DX10_IMAGE_LOAD_INFO *load_info, ID3D10Resource **texture)
{
unsigned int frame_count, width, height, stride, frame_size;
IWICFormatConverter *converter = NULL;
@@ -689,29 +689,14 @@ HRESULT WINAPI D3DX10CreateTextureFromMemory(ID3D10Device *device, const void *s
GUID src_format;
HRESULT hr;
- TRACE("device %p, src_data %p, src_data_size %Iu, load_info %p, pump %p, texture %p, hresult %p.\n",
- device, src_data, src_data_size, load_info, pump, texture, hresult);
-
- if (!device)
- return E_INVALIDARG;
- if (!src_data)
- return E_FAIL;
if (load_info)
FIXME("load_info is ignored.\n");
- if (pump)
- FIXME("Thread pump is not supported yet.\n");
- if (FAILED(D3DX10GetImageInfoFromMemory(src_data, src_data_size, NULL, &img_info, NULL)))
- {
- if (hresult)
- *hresult = E_FAIL;
+ if (FAILED(D3DX10GetImageInfoFromMemory(data, size, NULL, &img_info, NULL)))
return E_FAIL;
- }
if (img_info.MiscFlags & D3D10_RESOURCE_MISC_TEXTURECUBE)
{
FIXME("Cube map is not supported.\n");
- if (hresult)
- *hresult = E_FAIL;
return E_FAIL;
}
@@ -719,7 +704,7 @@ HRESULT WINAPI D3DX10CreateTextureFromMemory(ID3D10Device *device, const void *s
goto end;
if (FAILED(hr = IWICImagingFactory_CreateStream(factory, &stream)))
goto end;
- if (FAILED(hr = IWICStream_InitializeFromMemory(stream, (BYTE *)src_data, src_data_size)))
+ if (FAILED(hr = IWICStream_InitializeFromMemory(stream, (BYTE *)data, size)))
goto end;
if (FAILED(hr = IWICImagingFactory_CreateDecoderFromStream(factory, (IStream *)stream, NULL, 0, &decoder)))
goto end;
@@ -822,7 +807,25 @@ end:
IWICStream_Release(stream);
if (factory)
IWICImagingFactory_Release(factory);
+ return hr;
+}
+
+HRESULT WINAPI D3DX10CreateTextureFromMemory(ID3D10Device *device, const void *src_data, SIZE_T src_data_size,
+ D3DX10_IMAGE_LOAD_INFO *load_info, ID3DX10ThreadPump *pump, ID3D10Resource **texture, HRESULT *hresult)
+{
+ HRESULT hr;
+
+ TRACE("device %p, src_data %p, src_data_size %Iu, load_info %p, pump %p, texture %p, hresult %p.\n",
+ device, src_data, src_data_size, load_info, pump, texture, hresult);
+
+ if (!device)
+ return E_INVALIDARG;
+ if (!src_data)
+ return E_FAIL;
+ if (pump)
+ FIXME("Thread pump is not supported yet.\n");
+ hr = create_texture(device, src_data, src_data_size, load_info, texture);
if (hresult)
*hresult = hr;
return hr;
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/228
June 11, 2022
[PATCH 3/5] d3dx10: Add D3DX10CreateAsyncTextureProcessor stub.
by Piotr Caban
From: Piotr Caban <piotr(a)codeweavers.com>
Signed-off-by: Piotr Caban <piotr(a)codeweavers.com>
---
dlls/d3dx10_43/async.c | 7 +++++++
dlls/d3dx10_43/d3dx10_43.spec | 2 +-
include/d3dx10async.h | 2 ++
3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/dlls/d3dx10_43/async.c b/dlls/d3dx10_43/async.c
index 0d75a64ff9e..f0c726944c0 100644
--- a/dlls/d3dx10_43/async.c
+++ b/dlls/d3dx10_43/async.c
@@ -514,6 +514,13 @@ HRESULT WINAPI D3DX10CreateAsyncTextureInfoProcessor(D3DX10_IMAGE_INFO *info, ID
return S_OK;
}
+HRESULT WINAPI D3DX10CreateAsyncTextureProcessor(ID3D10Device *device,
+ D3DX10_IMAGE_LOAD_INFO *info, ID3DX10DataProcessor **processor)
+{
+ FIXME("device %p, info %p, processor %p stub!\n", device, info, processor);
+ return E_NOTIMPL;
+}
+
HRESULT WINAPI D3DX10PreprocessShaderFromMemory(const char *data, SIZE_T data_size, const char *filename,
const D3D10_SHADER_MACRO *defines, ID3DInclude *include, ID3DX10ThreadPump *pump, ID3D10Blob **shader_text,
ID3D10Blob **errors, HRESULT *hresult)
diff --git a/dlls/d3dx10_43/d3dx10_43.spec b/dlls/d3dx10_43/d3dx10_43.spec
index c0a2c9fa56c..95160a067c5 100644
--- a/dlls/d3dx10_43/d3dx10_43.spec
+++ b/dlls/d3dx10_43/d3dx10_43.spec
@@ -17,7 +17,7 @@
@ stub D3DX10CreateAsyncShaderPreprocessProcessor(str ptr ptr ptr ptr ptr)
@ stub D3DX10CreateAsyncShaderResourceViewProcessor(ptr ptr ptr)
@ stdcall D3DX10CreateAsyncTextureInfoProcessor(ptr ptr)
-@ stub D3DX10CreateAsyncTextureProcessor(ptr ptr ptr)
+@ stdcall D3DX10CreateAsyncTextureProcessor(ptr ptr ptr)
@ stdcall D3DX10CreateDevice(ptr long long long ptr)
@ stdcall D3DX10CreateDeviceAndSwapChain(ptr long long long ptr ptr ptr)
@ stdcall D3DX10CreateEffectFromFileA(str ptr ptr str long long ptr ptr ptr ptr ptr ptr)
diff --git a/include/d3dx10async.h b/include/d3dx10async.h
index c932be91b01..931458f4813 100644
--- a/include/d3dx10async.h
+++ b/include/d3dx10async.h
@@ -76,6 +76,8 @@ HRESULT WINAPI D3DX10CreateAsyncMemoryLoader(const void *data, SIZE_T datasize,
HRESULT WINAPI D3DX10CreateAsyncResourceLoaderA(HMODULE module, const char *resource, ID3DX10DataLoader **loader);
HRESULT WINAPI D3DX10CreateAsyncResourceLoaderW(HMODULE module, const WCHAR *resource, ID3DX10DataLoader **loader);
+HRESULT WINAPI D3DX10CreateAsyncTextureProcessor(ID3D10Device *device,
+ D3DX10_IMAGE_LOAD_INFO *info, ID3DX10DataProcessor **processor);
HRESULT WINAPI D3DX10CreateAsyncTextureInfoProcessor(D3DX10_IMAGE_INFO *info, ID3DX10DataProcessor **processor);
#endif
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/228
June 11, 2022
[PATCH 2/5] d3dx10/tests: Add D3DX10CreateTextureFromMemory HRESULT argument tests.
by Piotr Caban
From: Piotr Caban <piotr(a)codeweavers.com>
Signed-off-by: Piotr Caban <piotr(a)codeweavers.com>
---
dlls/d3dx10_43/tests/d3dx10.c | 74 ++++++++++++++++++++++++++---------
1 file changed, 55 insertions(+), 19 deletions(-)
diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c
index 560bc7a8f17..54533f5c738 100644
--- a/dlls/d3dx10_43/tests/d3dx10.c
+++ b/dlls/d3dx10_43/tests/d3dx10.c
@@ -2158,8 +2158,8 @@ static void test_create_texture(void)
HMODULE resource_module;
ID3D10Device *device;
WCHAR path[MAX_PATH];
+ HRESULT hr, hr2;
unsigned int i;
- HRESULT hr;
device = create_device();
if (!device)
@@ -2173,35 +2173,47 @@ static void test_create_texture(void)
/* D3DX10CreateTextureFromMemory tests */
resource = (ID3D10Resource *)0xdeadbeef;
- hr = D3DX10CreateTextureFromMemory(NULL, test_bmp_1bpp, sizeof(test_bmp_1bpp), NULL, NULL, &resource, NULL);
+ hr2 = 0xdeadbeef;
+ hr = D3DX10CreateTextureFromMemory(NULL, test_bmp_1bpp, sizeof(test_bmp_1bpp), NULL, NULL, &resource, &hr2);
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#x.\n", hr2);
ok(resource == (ID3D10Resource *)0xdeadbeef, "Got unexpected resource %p.\n", resource);
resource = (ID3D10Resource *)0xdeadbeef;
- hr = D3DX10CreateTextureFromMemory(device, NULL, 0, NULL, NULL, &resource, NULL);
+ hr2 = 0xdeadbeef;
+ hr = D3DX10CreateTextureFromMemory(device, NULL, 0, NULL, NULL, &resource, &hr2);
ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
+ ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#x.\n", hr2);
ok(resource == (ID3D10Resource *)0xdeadbeef, "Got unexpected resource %p.\n", resource);
resource = (ID3D10Resource *)0xdeadbeef;
- hr = D3DX10CreateTextureFromMemory(device, NULL, sizeof(test_bmp_1bpp), NULL, NULL, &resource, NULL);
+ hr2 = 0xdeadbeef;
+ hr = D3DX10CreateTextureFromMemory(device, NULL, sizeof(test_bmp_1bpp), NULL, NULL, &resource, &hr2);
ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
+ ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#x.\n", hr2);
ok(resource == (ID3D10Resource *)0xdeadbeef, "Got unexpected resource %p.\n", resource);
resource = (ID3D10Resource *)0xdeadbeef;
- hr = D3DX10CreateTextureFromMemory(device, test_bmp_1bpp, 0, NULL, NULL, &resource, NULL);
+ hr2 = 0xdeadbeef;
+ hr = D3DX10CreateTextureFromMemory(device, test_bmp_1bpp, 0, NULL, NULL, &resource, &hr2);
ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
+ ok(hr == hr2, "Got unexpected hr2 %#x.\n", hr2);
ok(resource == (ID3D10Resource *)0xdeadbeef, "Got unexpected resource %p.\n", resource);
resource = (ID3D10Resource *)0xdeadbeef;
- hr = D3DX10CreateTextureFromMemory(device, test_bmp_1bpp, sizeof(test_bmp_1bpp) - 1, NULL, NULL, &resource, NULL);
+ hr2 = 0xdeadbeef;
+ hr = D3DX10CreateTextureFromMemory(device, test_bmp_1bpp, sizeof(test_bmp_1bpp) - 1, NULL, NULL, &resource, &hr2);
ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
+ ok(hr == hr2, "Got unexpected hr2 %#x.\n", hr2);
ok(resource == (ID3D10Resource *)0xdeadbeef, "Got unexpected resource %p.\n", resource);
for (i = 0; i < ARRAY_SIZE(test_image); ++i)
{
winetest_push_context("Test %u", i);
- hr = D3DX10CreateTextureFromMemory(device, test_image[i].data, test_image[i].size, NULL, NULL, &resource, NULL);
+ hr2 = 0xdeadbeef;
+ hr = D3DX10CreateTextureFromMemory(device, test_image[i].data, test_image[i].size, NULL, NULL, &resource, &hr2);
+ ok(hr == hr2, "Got unexpected hr2 %#x.\n", hr2);
todo_wine_if(test_image[i].expected_info.MiscFlags & D3D10_RESOURCE_MISC_TEXTURECUBE)
ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP),
"Got unexpected hr %#x.\n", hr);
@@ -2217,21 +2229,31 @@ static void test_create_texture(void)
/* D3DX10CreateTextureFromFile tests */
- hr = D3DX10CreateTextureFromFileW(device, NULL, NULL, NULL, &resource, NULL);
+ hr2 = 0xdeadbeef;
+ hr = D3DX10CreateTextureFromFileW(device, NULL, NULL, NULL, &resource, &hr2);
ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
- hr = D3DX10CreateTextureFromFileW(device, L"deadbeef", NULL, NULL, &resource, NULL);
+ ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#x.\n", hr2);
+ hr2 = 0xdeadbeef;
+ hr = D3DX10CreateTextureFromFileW(device, L"deadbeef", NULL, NULL, &resource, &hr2);
ok(hr == D3D10_ERROR_FILE_NOT_FOUND, "Got unexpected hr %#x.\n", hr);
- hr = D3DX10CreateTextureFromFileA(device, NULL, NULL, NULL, &resource, NULL);
+ ok(hr == hr2, "Got unexpected hr2 %#x.\n", hr2);
+ hr2 = 0xdeadbeef;
+ hr = D3DX10CreateTextureFromFileA(device, NULL, NULL, NULL, &resource, &hr2);
ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
- hr = D3DX10CreateTextureFromFileA(device, "deadbeef", NULL, NULL, &resource, NULL);
+ ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#x.\n", hr2);
+ hr2 = 0xdeadbeef;
+ hr = D3DX10CreateTextureFromFileA(device, "deadbeef", NULL, NULL, &resource, &hr2);
ok(hr == D3D10_ERROR_FILE_NOT_FOUND, "Got unexpected hr %#x.\n", hr);
+ ok(hr == hr2, "Got unexpected hr2 %#x.\n", hr2);
for (i = 0; i < ARRAY_SIZE(test_image); ++i)
{
winetest_push_context("Test %u", i);
create_file(test_filename, test_image[i].data, test_image[i].size, path);
- hr = D3DX10CreateTextureFromFileW(device, path, NULL, NULL, &resource, NULL);
+ hr2 = 0xdeadbeef;
+ hr = D3DX10CreateTextureFromFileW(device, path, NULL, NULL, &resource, &hr2);
+ ok(hr == hr2, "Got unexpected hr2 %#x.\n", hr2);
todo_wine_if(test_image[i].expected_info.MiscFlags & D3D10_RESOURCE_MISC_TEXTURECUBE)
ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP),
"Got unexpected hr %#x.\n", hr);
@@ -2242,7 +2264,9 @@ static void test_create_texture(void)
ID3D10Resource_Release(resource);
}
- hr = D3DX10CreateTextureFromFileA(device, get_str_a(path), NULL, NULL, &resource, NULL);
+ hr2 = 0xdeadbeef;
+ hr = D3DX10CreateTextureFromFileA(device, get_str_a(path), NULL, NULL, &resource, &hr2);
+ ok(hr == hr2, "Got unexpected hr2 %#x.\n", hr2);
todo_wine_if(test_image[i].expected_info.MiscFlags & D3D10_RESOURCE_MISC_TEXTURECUBE)
ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP),
"Got unexpected hr %#x.\n", hr);
@@ -2259,25 +2283,35 @@ static void test_create_texture(void)
/* D3DX10CreateTextureFromResource tests */
- hr = D3DX10CreateTextureFromResourceW(device, NULL, NULL, NULL, NULL, &resource, NULL);
+ hr2 = 0xdeadbeef;
+ hr = D3DX10CreateTextureFromResourceW(device, NULL, NULL, NULL, NULL, &resource, &hr2);
ok(hr == D3DX10_ERR_INVALID_DATA, "Got unexpected hr %#x.\n", hr);
- hr = D3DX10CreateTextureFromResourceW(device, NULL, L"deadbeef", NULL, NULL, &resource, NULL);
+ ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#x.\n", hr2);
+ hr2 = 0xdeadbeef;
+ hr = D3DX10CreateTextureFromResourceW(device, NULL, L"deadbeef", NULL, NULL, &resource, &hr2);
ok(hr == D3DX10_ERR_INVALID_DATA, "Got unexpected hr %#x.\n", hr);
- hr = D3DX10CreateTextureFromResourceA(device, NULL, NULL, NULL, NULL, &resource, NULL);
+ ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#x.\n", hr2);
+ hr2 = 0xdeadbeef;
+ hr = D3DX10CreateTextureFromResourceA(device, NULL, NULL, NULL, NULL, &resource, &hr2);
ok(hr == D3DX10_ERR_INVALID_DATA, "Got unexpected hr %#x.\n", hr);
- hr = D3DX10CreateTextureFromResourceA(device, NULL, "deadbeef", NULL, NULL, &resource, NULL);
+ ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#x.\n", hr2);
+ hr2 = 0xdeadbeef;
+ hr = D3DX10CreateTextureFromResourceA(device, NULL, "deadbeef", NULL, NULL, &resource, &hr2);
ok(hr == D3DX10_ERR_INVALID_DATA, "Got unexpected hr %#x.\n", hr);
+ ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#x.\n", hr2);
for (i = 0; i < ARRAY_SIZE(test_image); ++i)
{
winetest_push_context("Test %u", i);
resource_module = create_resource_module(test_resource_name, test_image[i].data, test_image[i].size);
+ hr2 = 0xdeadbeef;
hr = D3DX10CreateTextureFromResourceW(device, resource_module,
- test_resource_name, NULL, NULL, &resource, NULL);
+ test_resource_name, NULL, NULL, &resource, &hr2);
todo_wine_if(test_image[i].expected_info.MiscFlags & D3D10_RESOURCE_MISC_TEXTURECUBE)
ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP),
"Got unexpected hr %#x.\n", hr);
+ ok(hr == hr2, "Got unexpected hr2 %#x.\n", hr2);
if (hr == S_OK)
{
check_resource_info(resource, test_image + i, __LINE__);
@@ -2285,11 +2319,13 @@ static void test_create_texture(void)
ID3D10Resource_Release(resource);
}
+ hr2 = 0xdeadbeef;
hr = D3DX10CreateTextureFromResourceA(device, resource_module,
- get_str_a(test_resource_name), NULL, NULL, &resource, NULL);
+ get_str_a(test_resource_name), NULL, NULL, &resource, &hr2);
todo_wine_if(test_image[i].expected_info.MiscFlags & D3D10_RESOURCE_MISC_TEXTURECUBE)
ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP),
"Got unexpected hr %#x.\n", hr);
+ ok(hr == hr2, "Got unexpected hr2 %#x.\n", hr2);
if (hr == S_OK)
{
check_resource_info(resource, test_image + i, __LINE__);
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/228
June 11, 2022
[PATCH 1/5] d3dx10: Don't ignore HRESULT parameter in D3DX10CreateTextureFromMemory.
by Piotr Caban
From: Piotr Caban <piotr(a)codeweavers.com>
Signed-off-by: Piotr Caban <piotr(a)codeweavers.com>
---
dlls/d3dx10_43/tests/d3dx10.c | 5 +++++
dlls/d3dx10_43/texture.c | 32 +++++++++++++++++++++++++-------
2 files changed, 30 insertions(+), 7 deletions(-)
diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c
index 0c6c4e5c8ce..560bc7a8f17 100644
--- a/dlls/d3dx10_43/tests/d3dx10.c
+++ b/dlls/d3dx10_43/tests/d3dx10.c
@@ -2172,6 +2172,11 @@ static void test_create_texture(void)
/* D3DX10CreateTextureFromMemory tests */
+ resource = (ID3D10Resource *)0xdeadbeef;
+ hr = D3DX10CreateTextureFromMemory(NULL, test_bmp_1bpp, sizeof(test_bmp_1bpp), NULL, NULL, &resource, NULL);
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ ok(resource == (ID3D10Resource *)0xdeadbeef, "Got unexpected resource %p.\n", resource);
+
resource = (ID3D10Resource *)0xdeadbeef;
hr = D3DX10CreateTextureFromMemory(device, NULL, 0, NULL, NULL, &resource, NULL);
ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
diff --git a/dlls/d3dx10_43/texture.c b/dlls/d3dx10_43/texture.c
index 9c7762bc617..d5066b9793b 100644
--- a/dlls/d3dx10_43/texture.c
+++ b/dlls/d3dx10_43/texture.c
@@ -581,7 +581,9 @@ HRESULT WINAPI D3DX10CreateTextureFromFileA(ID3D10Device *device, const char *sr
TRACE("device %p, src_file %s, load_info %p, pump %p, texture %p, hresult %p.\n",
device, debugstr_a(src_file), load_info, pump, texture, hresult);
- if (!src_file || !texture)
+ if (!device)
+ return E_INVALIDARG;
+ if (!src_file)
return E_FAIL;
if (!(str_len = MultiByteToWideChar(CP_ACP, 0, src_file, -1, NULL, 0)))
@@ -608,11 +610,17 @@ HRESULT WINAPI D3DX10CreateTextureFromFileW(ID3D10Device *device, const WCHAR *s
TRACE("device %p, src_file %s, load_info %p, pump %p, texture %p, hresult %p.\n",
device, debugstr_w(src_file), load_info, pump, texture, hresult);
- if (!src_file || !texture)
+ if (!device)
+ return E_INVALIDARG;
+ if (!src_file)
return E_FAIL;
if (FAILED((hr = load_file(src_file, &buffer, &size))))
+ {
+ if (hresult)
+ *hresult = hr;
return hr;
+ }
hr = D3DX10CreateTextureFromMemory(device, buffer, size, load_info, pump, texture, hresult);
@@ -631,8 +639,8 @@ HRESULT WINAPI D3DX10CreateTextureFromResourceA(ID3D10Device *device, HMODULE mo
TRACE("device %p, module %p, resource %s, load_info %p, pump %p, texture %p, hresult %p.\n",
device, module, debugstr_a(resource), load_info, pump, texture, hresult);
- if (!resource || !texture)
- return D3DX10_ERR_INVALID_DATA;
+ if (!device)
+ return E_INVALIDARG;
hr = load_resourceA(module, resource, &buffer, &size);
if (FAILED(hr))
@@ -651,8 +659,8 @@ HRESULT WINAPI D3DX10CreateTextureFromResourceW(ID3D10Device *device, HMODULE mo
TRACE("device %p, module %p, resource %s, load_info %p, pump %p, texture %p, hresult %p.\n",
device, module, debugstr_w(resource), load_info, pump, texture, hresult);
- if (!resource || !texture)
- return D3DX10_ERR_INVALID_DATA;
+ if (!device)
+ return E_INVALIDARG;
hr = load_resourceW(module, resource, &buffer, &size);
if (FAILED(hr))
@@ -684,7 +692,9 @@ HRESULT WINAPI D3DX10CreateTextureFromMemory(ID3D10Device *device, const void *s
TRACE("device %p, src_data %p, src_data_size %Iu, load_info %p, pump %p, texture %p, hresult %p.\n",
device, src_data, src_data_size, load_info, pump, texture, hresult);
- if (!src_data || !src_data_size || !texture)
+ if (!device)
+ return E_INVALIDARG;
+ if (!src_data)
return E_FAIL;
if (load_info)
FIXME("load_info is ignored.\n");
@@ -692,10 +702,16 @@ HRESULT WINAPI D3DX10CreateTextureFromMemory(ID3D10Device *device, const void *s
FIXME("Thread pump is not supported yet.\n");
if (FAILED(D3DX10GetImageInfoFromMemory(src_data, src_data_size, NULL, &img_info, NULL)))
+ {
+ if (hresult)
+ *hresult = E_FAIL;
return E_FAIL;
+ }
if (img_info.MiscFlags & D3D10_RESOURCE_MISC_TEXTURECUBE)
{
FIXME("Cube map is not supported.\n");
+ if (hresult)
+ *hresult = E_FAIL;
return E_FAIL;
}
@@ -807,5 +823,7 @@ end:
if (factory)
IWICImagingFactory_Release(factory);
+ if (hresult)
+ *hresult = hr;
return hr;
}
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/228
June 11, 2022