Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- include/Makefile.in | 1 + include/windows.globalization.idl | 49 +++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 include/windows.globalization.idl
diff --git a/include/Makefile.in b/include/Makefile.in index b71de990aa2..46164b8268f 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -753,6 +753,7 @@ SOURCES = \ windows.foundation.idl \ windows.gaming.input.forcefeedback.idl \ windows.gaming.input.idl \ + windows.globalization.idl \ windows.h \ windows.media.speechsynthesis.idl \ windows.system.idl \ diff --git a/include/windows.globalization.idl b/include/windows.globalization.idl new file mode 100644 index 00000000000..c08f7bd27d9 --- /dev/null +++ b/include/windows.globalization.idl @@ -0,0 +1,49 @@ +/* + * Copyright 2021 Rémi Bernon for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifdef __WIDL__ +#pragma winrt ns_prefix +#endif + +import "inspectable.idl"; +import "asyncinfo.idl"; +import "eventtoken.idl"; +import "windowscontracts.idl"; +import "windows.foundation.idl"; + +namespace Windows { + namespace Globalization { + typedef enum DayOfWeek DayOfWeek; + } +} + +namespace Windows { + namespace Globalization { + [contract(Windows.Foundation.UniversalApiContract, 1.0)] + enum DayOfWeek + { + Sunday = 0, + Monday = 1, + Tuesday = 2, + Wednesday = 3, + Thursday = 4, + Friday = 5, + Saturday = 6 + }; + } +}
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- include/Makefile.in | 1 + include/windows.foundation.idl | 1 + include/windows.system.userprofile.idl | 70 ++++++++++++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 include/windows.system.userprofile.idl
diff --git a/include/Makefile.in b/include/Makefile.in index 46164b8268f..9133e5c6315 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -757,6 +757,7 @@ SOURCES = \ windows.h \ windows.media.speechsynthesis.idl \ windows.system.idl \ + windows.system.userprofile.idl \ windowscontracts.idl \ windowsx.h \ wine/debug.h \ diff --git a/include/windows.foundation.idl b/include/windows.foundation.idl index c4dc454974f..fe09dc66edd 100644 --- a/include/windows.foundation.idl +++ b/include/windows.foundation.idl @@ -127,6 +127,7 @@ namespace Windows { declare { interface Windows.Foundation.AsyncOperationCompletedHandler<boolean>; interface Windows.Foundation.IAsyncOperation<boolean>; + interface Windows.Foundation.Collections.IVectorView<HSTRING>; } } } diff --git a/include/windows.system.userprofile.idl b/include/windows.system.userprofile.idl new file mode 100644 index 00000000000..4a066c9ae8b --- /dev/null +++ b/include/windows.system.userprofile.idl @@ -0,0 +1,70 @@ +/* + * Copyright 2021 Rémi Bernon for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifdef __WIDL__ +#pragma winrt ns_prefix +#endif + +import "inspectable.idl"; +import "asyncinfo.idl"; +import "eventtoken.idl"; +import "windowscontracts.idl"; +import "windows.foundation.idl"; +import "windows.globalization.idl"; + +namespace Windows { + namespace System { + namespace UserProfile { + interface IGlobalizationPreferencesStatics; + interface IGlobalizationPreferencesStatics2; + interface IGlobalizationPreferencesStatics3; + runtimeclass GlobalizationPreferences; + } + } +} + +namespace Windows { + namespace System { + namespace UserProfile { + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.System.UserProfile.GlobalizationPreferences), + uuid(01bf4326-ed37-4e96-b0e9-c1340d1ea158) + ] + interface IGlobalizationPreferencesStatics : IInspectable + { + [propget] HRESULT Calendars([out, retval] Windows.Foundation.Collections.IVectorView<HSTRING>** value); + [propget] HRESULT Clocks([out, retval] Windows.Foundation.Collections.IVectorView<HSTRING>** value); + [propget] HRESULT Currencies([out, retval] Windows.Foundation.Collections.IVectorView<HSTRING>** value); + [propget] HRESULT Languages([out, retval] Windows.Foundation.Collections.IVectorView<HSTRING>** value); + [propget] HRESULT HomeGeographicRegion([out, retval] HSTRING* value); + [propget] HRESULT WeekStartsOn([out, retval] Windows.Globalization.DayOfWeek* value); + } + + [contract(Windows.Foundation.UniversalApiContract, 1.0)] + [marshaling_behavior(agile)] + [static(Windows.System.UserProfile.IGlobalizationPreferencesStatics, Windows.Foundation.UniversalApiContract, 1.0)] + [static(Windows.System.UserProfile.IGlobalizationPreferencesStatics2, Windows.Foundation.UniversalApiContract, 5.0)] + [static(Windows.System.UserProfile.IGlobalizationPreferencesStatics3, Windows.Foundation.UniversalApiContract, 6.0)] + runtimeclass GlobalizationPreferences + { + } + } + } +}
Signed-off-by: Jacek Caban jacek@codeweavers.com
For IVectorView and IIterator interfaces.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/windows.gaming.input/main.c | 12 ++++++++---- dlls/windows.gaming.input/tests/input.c | 8 ++++++++ dlls/windows.media.speech/main.c | 3 ++- dlls/windows.media.speech/tests/speech.c | 5 +++++ include/windows.foundation.collections.idl | 4 ++-- 5 files changed, 25 insertions(+), 7 deletions(-)
diff --git a/dlls/windows.gaming.input/main.c b/dlls/windows.gaming.input/main.c index c71374e34a3..e97322212e4 100644 --- a/dlls/windows.gaming.input/main.c +++ b/dlls/windows.gaming.input/main.c @@ -142,10 +142,12 @@ static HRESULT STDMETHODCALLTYPE vector_view_gamepad_IndexOf( }
static HRESULT STDMETHODCALLTYPE vector_view_gamepad_GetMany( - IVectorView_Gamepad *iface, ULONG start_index, IGamepad **items, UINT *value) + IVectorView_Gamepad *iface, ULONG start_index, + ULONG items_size, IGamepad **items, UINT *value) { FIXME("iface %p, start_index %#x, items %p, value %p stub!\n", iface, start_index, items, value); - return E_NOTIMPL; + *value = 0; + return E_BOUNDS; }
static const struct IVectorView_GamepadVtbl vector_view_gamepad_vtbl = @@ -266,10 +268,12 @@ static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_IndexOf( }
static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_GetMany( - IVectorView_RawGameController *iface, ULONG start_index, IRawGameController **items, UINT *value) + IVectorView_RawGameController *iface, ULONG start_index, + ULONG items_size, IRawGameController **items, UINT *value) { FIXME("iface %p, start_index %#x, items %p, value %p stub!\n", iface, start_index, items, value); - return E_NOTIMPL; + *value = 0; + return E_BOUNDS; }
static const struct IVectorView_RawGameControllerVtbl vector_view_raw_game_controller_vtbl = diff --git a/dlls/windows.gaming.input/tests/input.c b/dlls/windows.gaming.input/tests/input.c index 62822b30c28..6ed40186df9 100644 --- a/dlls/windows.gaming.input/tests/input.c +++ b/dlls/windows.gaming.input/tests/input.c @@ -175,6 +175,10 @@ static void test_Gamepad(void) ok(hr == E_BOUNDS, "IVectorView_Gamepad_GetAt failed, hr %#x\n", hr); ok(gamepad == NULL, "IVectorView_Gamepad_GetAt returned %p\n", gamepad);
+ hr = IVectorView_Gamepad_GetMany(gamepads, size, 1, &gamepad, &size); + ok(hr == E_BOUNDS, "IVectorView_Gamepad_GetMany failed, hr %#x\n", hr); + ok(size == 0, "IVectorView_Gamepad_GetMany returned count %u\n", size); + size = 0xdeadbeef; found = TRUE; gamepad = (IGamepad *)0xdeadbeef; @@ -343,6 +347,10 @@ static void test_RawGameController(void) ok(hr == S_OK, "IVectorView_RawGameController_get_Size failed, hr %#x\n", hr); ok(size != 0xdeadbeef, "IVectorView_RawGameController_get_Size returned %u\n", size);
+ hr = IVectorView_RawGameController_GetMany(controllers, size, 1, &controller, &size); + ok(hr == E_BOUNDS, "IVectorView_RawGameController_GetMany failed, hr %#x\n", hr); + ok(size == 0, "IVectorView_RawGameController_GetMany returned count %u\n", size); + controller = (IRawGameController *)0xdeadbeef; hr = IVectorView_RawGameController_GetAt(controllers, size, &controller); ok(hr == E_BOUNDS, "IVectorView_RawGameController_GetAt failed, hr %#x\n", hr); diff --git a/dlls/windows.media.speech/main.c b/dlls/windows.media.speech/main.c index 92215fe717d..1a9ba51b071 100644 --- a/dlls/windows.media.speech/main.c +++ b/dlls/windows.media.speech/main.c @@ -139,7 +139,8 @@ static HRESULT STDMETHODCALLTYPE vector_view_voice_information_IndexOf( }
static HRESULT STDMETHODCALLTYPE vector_view_voice_information_GetMany( - IVectorView_VoiceInformation *iface, ULONG start_index, IVoiceInformation **items, UINT *value) + IVectorView_VoiceInformation *iface, ULONG start_index, + ULONG items_size, IVoiceInformation **items, UINT *value) { FIXME("iface %p, start_index %#x, items %p, value %p stub!\n", iface, start_index, items, value); *value = 0; diff --git a/dlls/windows.media.speech/tests/speech.c b/dlls/windows.media.speech/tests/speech.c index 33ce75c0c0e..30244e59612 100644 --- a/dlls/windows.media.speech/tests/speech.c +++ b/dlls/windows.media.speech/tests/speech.c @@ -48,6 +48,7 @@ static void test_SpeechSynthesizer(void) IVectorView_VoiceInformation *voices = NULL; IInstalledVoicesStatic *voices_static = NULL; IActivationFactory *factory = NULL; + IVoiceInformation *voice; IInspectable *inspectable = NULL, *tmp_inspectable = NULL; IAgileObject *agile_object = NULL, *tmp_agile_object = NULL; HSTRING str; @@ -98,6 +99,10 @@ static void test_SpeechSynthesizer(void) ok(hr == S_OK, "IVectorView_VoiceInformation_get_Size voices failed, hr %#x\n", hr); todo_wine ok(size != 0 && size != 0xdeadbeef, "IVectorView_VoiceInformation_get_Size returned %u\n", size);
+ hr = IVectorView_VoiceInformation_GetMany(voices, size, 1, &voice, &size); + ok(hr == S_OK, "IVectorView_VoiceInformation_GetMany failed, hr %#x\n", hr); + ok(size == 0, "IVectorView_VoiceInformation_GetMany returned count %u\n", size); + IVectorView_VoiceInformation_Release(voices);
IInstalledVoicesStatic_Release(voices_static); diff --git a/include/windows.foundation.collections.idl b/include/windows.foundation.collections.idl index 50a678e410c..250f8b9acbe 100644 --- a/include/windows.foundation.collections.idl +++ b/include/windows.foundation.collections.idl @@ -83,7 +83,7 @@ cpp_quote("#endif") [propget] HRESULT Current([out, retval] T *value); [propget] HRESULT HasCurrent([out, retval] BOOL *value); HRESULT MoveNext([out, retval] BOOL *value); - HRESULT GetMany([in] UINT32 count, [out] T *items, [out, retval] UINT32 *value); + HRESULT GetMany([in] UINT32 count, [in] UINT32 items_size, [out] T *items, [out, retval] UINT32 *value); }
[ @@ -104,7 +104,7 @@ cpp_quote("#endif") HRESULT GetAt([in] ULONG index, [out, retval] T *value); [propget] HRESULT Size([out, retval] ULONG *value); HRESULT IndexOf([in, optional] T element, [out] ULONG *index, [out, retval] BOOLEAN *value); - HRESULT GetMany([in] ULONG start_index, [out] T *items, [out, retval] ULONG *value); + HRESULT GetMany([in] ULONG start_index, [in] ULONG items_size, [out] T *items, [out, retval] ULONG *value); } } #endif
Signed-off-by: Jacek Caban jacek@codeweavers.com
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/windows.gaming.input/main.c | 20 ++++++++++---------- dlls/windows.gaming.input/tests/input.c | 4 ++-- dlls/windows.media.speech/main.c | 10 +++++----- dlls/windows.media.speech/tests/speech.c | 2 +- include/windows.foundation.collections.idl | 8 ++++---- 5 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/dlls/windows.gaming.input/main.c b/dlls/windows.gaming.input/main.c index e97322212e4..bf6b990a623 100644 --- a/dlls/windows.gaming.input/main.c +++ b/dlls/windows.gaming.input/main.c @@ -117,7 +117,7 @@ static HRESULT STDMETHODCALLTYPE vector_view_gamepad_GetTrustLevel( }
static HRESULT STDMETHODCALLTYPE vector_view_gamepad_GetAt( - IVectorView_Gamepad *iface, ULONG index, IGamepad **value) + IVectorView_Gamepad *iface, UINT32 index, IGamepad **value) { FIXME("iface %p, index %#x, value %p stub!\n", iface, index, value); *value = NULL; @@ -125,7 +125,7 @@ static HRESULT STDMETHODCALLTYPE vector_view_gamepad_GetAt( }
static HRESULT STDMETHODCALLTYPE vector_view_gamepad_get_Size( - IVectorView_Gamepad *iface, ULONG *value) + IVectorView_Gamepad *iface, UINT32 *value) { FIXME("iface %p, value %p stub!\n", iface, value); *value = 0; @@ -133,7 +133,7 @@ static HRESULT STDMETHODCALLTYPE vector_view_gamepad_get_Size( }
static HRESULT STDMETHODCALLTYPE vector_view_gamepad_IndexOf( - IVectorView_Gamepad *iface, IGamepad *element, ULONG *index, BOOLEAN *found) + IVectorView_Gamepad *iface, IGamepad *element, UINT32 *index, BOOLEAN *found) { FIXME("iface %p, element %p, index %p, found %p stub!\n", iface, element, index, found); *index = 0; @@ -142,8 +142,8 @@ static HRESULT STDMETHODCALLTYPE vector_view_gamepad_IndexOf( }
static HRESULT STDMETHODCALLTYPE vector_view_gamepad_GetMany( - IVectorView_Gamepad *iface, ULONG start_index, - ULONG items_size, IGamepad **items, UINT *value) + IVectorView_Gamepad *iface, UINT32 start_index, + UINT32 items_size, IGamepad **items, UINT *value) { FIXME("iface %p, start_index %#x, items %p, value %p stub!\n", iface, start_index, items, value); *value = 0; @@ -243,7 +243,7 @@ static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_GetTrustLevel( }
static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_GetAt( - IVectorView_RawGameController *iface, ULONG index, IRawGameController **value) + IVectorView_RawGameController *iface, UINT32 index, IRawGameController **value) { FIXME("iface %p, index %#x, value %p stub!\n", iface, index, value); *value = NULL; @@ -251,7 +251,7 @@ static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_GetAt( }
static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_get_Size( - IVectorView_RawGameController *iface, ULONG *value) + IVectorView_RawGameController *iface, UINT32 *value) { FIXME("iface %p, value %p stub!\n", iface, value); *value = 0; @@ -259,7 +259,7 @@ static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_get_Size( }
static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_IndexOf( - IVectorView_RawGameController *iface, IRawGameController *element, ULONG *index, BOOLEAN *found) + IVectorView_RawGameController *iface, IRawGameController *element, UINT32 *index, BOOLEAN *found) { FIXME("iface %p, element %p, index %p, found %p stub!\n", iface, element, index, found); *index = 0; @@ -268,8 +268,8 @@ static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_IndexOf( }
static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_GetMany( - IVectorView_RawGameController *iface, ULONG start_index, - ULONG items_size, IRawGameController **items, UINT *value) + IVectorView_RawGameController *iface, UINT32 start_index, + UINT32 items_size, IRawGameController **items, UINT *value) { FIXME("iface %p, start_index %#x, items %p, value %p stub!\n", iface, start_index, items, value); *value = 0; diff --git a/dlls/windows.gaming.input/tests/input.c b/dlls/windows.gaming.input/tests/input.c index 6ed40186df9..6ce06de346e 100644 --- a/dlls/windows.gaming.input/tests/input.c +++ b/dlls/windows.gaming.input/tests/input.c @@ -115,7 +115,7 @@ static void test_Gamepad(void) BOOLEAN found; HSTRING str; HRESULT hr; - ULONG size; + UINT32 size;
gamepad_event_handler.IEventHandler_Gamepad_iface.lpVtbl = &gamepad_event_handler_vtbl;
@@ -292,7 +292,7 @@ static void test_RawGameController(void) BOOLEAN found; HSTRING str; HRESULT hr; - ULONG size; + UINT32 size;
controller_event_handler.IEventHandler_RawGameController_iface.lpVtbl = &controller_event_handler_vtbl;
diff --git a/dlls/windows.media.speech/main.c b/dlls/windows.media.speech/main.c index 1a9ba51b071..c358b991be2 100644 --- a/dlls/windows.media.speech/main.c +++ b/dlls/windows.media.speech/main.c @@ -116,14 +116,14 @@ static HRESULT STDMETHODCALLTYPE vector_view_voice_information_GetTrustLevel( }
static HRESULT STDMETHODCALLTYPE vector_view_voice_information_GetAt( - IVectorView_VoiceInformation *iface, ULONG index, IVoiceInformation **value) + IVectorView_VoiceInformation *iface, UINT32 index, IVoiceInformation **value) { FIXME("iface %p, index %#x, value %p stub!\n", iface, index, value); return S_OK; }
static HRESULT STDMETHODCALLTYPE vector_view_voice_information_get_Size( - IVectorView_VoiceInformation *iface, ULONG *value) + IVectorView_VoiceInformation *iface, UINT32 *value) { FIXME("iface %p, value %p stub!\n", iface, value); *value = 0; @@ -131,7 +131,7 @@ static HRESULT STDMETHODCALLTYPE vector_view_voice_information_get_Size( }
static HRESULT STDMETHODCALLTYPE vector_view_voice_information_IndexOf( - IVectorView_VoiceInformation *iface, IVoiceInformation *element, ULONG *index, BOOLEAN *value) + IVectorView_VoiceInformation *iface, IVoiceInformation *element, UINT32 *index, BOOLEAN *value) { FIXME("iface %p, element %p, index %p, value %p stub!\n", iface, element, index, value); *value = FALSE; @@ -139,8 +139,8 @@ static HRESULT STDMETHODCALLTYPE vector_view_voice_information_IndexOf( }
static HRESULT STDMETHODCALLTYPE vector_view_voice_information_GetMany( - IVectorView_VoiceInformation *iface, ULONG start_index, - ULONG items_size, IVoiceInformation **items, UINT *value) + IVectorView_VoiceInformation *iface, UINT32 start_index, + UINT32 items_size, IVoiceInformation **items, UINT *value) { FIXME("iface %p, start_index %#x, items %p, value %p stub!\n", iface, start_index, items, value); *value = 0; diff --git a/dlls/windows.media.speech/tests/speech.c b/dlls/windows.media.speech/tests/speech.c index 30244e59612..770562e9d82 100644 --- a/dlls/windows.media.speech/tests/speech.c +++ b/dlls/windows.media.speech/tests/speech.c @@ -53,7 +53,7 @@ static void test_SpeechSynthesizer(void) IAgileObject *agile_object = NULL, *tmp_agile_object = NULL; HSTRING str; HRESULT hr; - ULONG size; + UINT32 size;
hr = pRoInitialize(RO_INIT_MULTITHREADED); ok(hr == S_OK, "RoInitialize failed, hr %#x\n", hr); diff --git a/include/windows.foundation.collections.idl b/include/windows.foundation.collections.idl index 250f8b9acbe..b0b9430048b 100644 --- a/include/windows.foundation.collections.idl +++ b/include/windows.foundation.collections.idl @@ -101,10 +101,10 @@ cpp_quote("#endif") ] interface IVectorView<T> : IInspectable { - HRESULT GetAt([in] ULONG index, [out, retval] T *value); - [propget] HRESULT Size([out, retval] ULONG *value); - HRESULT IndexOf([in, optional] T element, [out] ULONG *index, [out, retval] BOOLEAN *value); - HRESULT GetMany([in] ULONG start_index, [in] ULONG items_size, [out] T *items, [out, retval] ULONG *value); + HRESULT GetAt([in] UINT32 index, [out, retval] T *value); + [propget] HRESULT Size([out, retval] UINT32 *value); + HRESULT IndexOf([in, optional] T element, [out] UINT32 *index, [out, retval] BOOLEAN *value); + HRESULT GetMany([in] UINT32 start_index, [in] UINT32 items_size, [out] T *items, [out, retval] UINT32 *value); } } #endif
On 3/23/21 11:23 AM, Rémi Bernon wrote:
diff --git a/include/windows.foundation.collections.idl b/include/windows.foundation.collections.idl index 250f8b9acbe..b0b9430048b 100644 --- a/include/windows.foundation.collections.idl +++ b/include/windows.foundation.collections.idl @@ -101,10 +101,10 @@ cpp_quote("#endif") ] interface IVectorView<T> : IInspectable {
HRESULT GetAt([in] ULONG index, [out, retval] T *value);
[propget] HRESULT Size([out, retval] ULONG *value);
HRESULT IndexOf([in, optional] T element, [out] ULONG *index, [out, retval] BOOLEAN *value);
HRESULT GetMany([in] ULONG start_index, [in] ULONG items_size, [out] T *items, [out, retval] ULONG *value);
HRESULT GetAt([in] UINT32 index, [out, retval] T *value);
[propget] HRESULT Size([out, retval] UINT32 *value);
HRESULT IndexOf([in, optional] T element, [out] UINT32 *index, [out, retval] BOOLEAN *value);
HRESULT GetMany([in] UINT32 start_index, [in] UINT32 items_size, [out] T *items, [out, retval] UINT32 *value);
Could we just use unsigned int (like Windows SDK does)?
Thanks, Jacek
On 3/23/21 6:32 PM, Jacek Caban wrote:
On 3/23/21 11:23 AM, Rémi Bernon wrote:
diff --git a/include/windows.foundation.collections.idl b/include/windows.foundation.collections.idl index 250f8b9acbe..b0b9430048b 100644 --- a/include/windows.foundation.collections.idl +++ b/include/windows.foundation.collections.idl @@ -101,10 +101,10 @@ cpp_quote("#endif") ] interface IVectorView<T> : IInspectable { - HRESULT GetAt([in] ULONG index, [out, retval] T *value); - [propget] HRESULT Size([out, retval] ULONG *value); - HRESULT IndexOf([in, optional] T element, [out] ULONG *index, [out, retval] BOOLEAN *value); - HRESULT GetMany([in] ULONG start_index, [in] ULONG items_size, [out] T *items, [out, retval] ULONG *value); + HRESULT GetAt([in] UINT32 index, [out, retval] T *value); + [propget] HRESULT Size([out, retval] UINT32 *value); + HRESULT IndexOf([in, optional] T element, [out] UINT32 *index, [out, retval] BOOLEAN *value); + HRESULT GetMany([in] UINT32 start_index, [in] UINT32 items_size, [out] T *items, [out, retval] UINT32 *value);
Could we just use unsigned int (like Windows SDK does)?
Thanks, Jacek
It seems to be lowering the type to its underlying integral base type in windows.foundation.collections.h, but the generated specialized interfaces (like IVectorView<HSTRING>) have UINT32. Does it really make a difference?
On 3/23/21 6:47 PM, Rémi Bernon wrote:
On 3/23/21 6:32 PM, Jacek Caban wrote:
On 3/23/21 11:23 AM, Rémi Bernon wrote:
diff --git a/include/windows.foundation.collections.idl b/include/windows.foundation.collections.idl index 250f8b9acbe..b0b9430048b 100644 --- a/include/windows.foundation.collections.idl +++ b/include/windows.foundation.collections.idl @@ -101,10 +101,10 @@ cpp_quote("#endif") ] interface IVectorView<T> : IInspectable { - HRESULT GetAt([in] ULONG index, [out, retval] T *value); - [propget] HRESULT Size([out, retval] ULONG *value); - HRESULT IndexOf([in, optional] T element, [out] ULONG *index, [out, retval] BOOLEAN *value); - HRESULT GetMany([in] ULONG start_index, [in] ULONG items_size, [out] T *items, [out, retval] ULONG *value); + HRESULT GetAt([in] UINT32 index, [out, retval] T *value); + [propget] HRESULT Size([out, retval] UINT32 *value); + HRESULT IndexOf([in, optional] T element, [out] UINT32 *index, [out, retval] BOOLEAN *value); + HRESULT GetMany([in] UINT32 start_index, [in] UINT32 items_size, [out] T *items, [out, retval] UINT32 *value);
Could we just use unsigned int (like Windows SDK does)?
Thanks, Jacek
It seems to be lowering the type to its underlying integral base type in windows.foundation.collections.h, but the generated specialized interfaces (like IVectorView<HSTRING>) have UINT32. Does it really make a difference?
No, in that case that's fine.
Jacek
On 3/23/21 6:47 PM, Rémi Bernon wrote:
On 3/23/21 6:32 PM, Jacek Caban wrote:
On 3/23/21 11:23 AM, Rémi Bernon wrote:
diff --git a/include/windows.foundation.collections.idl b/include/windows.foundation.collections.idl index 250f8b9acbe..b0b9430048b 100644 --- a/include/windows.foundation.collections.idl +++ b/include/windows.foundation.collections.idl @@ -101,10 +101,10 @@ cpp_quote("#endif") ] interface IVectorView<T> : IInspectable { - HRESULT GetAt([in] ULONG index, [out, retval] T *value); - [propget] HRESULT Size([out, retval] ULONG *value); - HRESULT IndexOf([in, optional] T element, [out] ULONG *index, [out, retval] BOOLEAN *value); - HRESULT GetMany([in] ULONG start_index, [in] ULONG items_size, [out] T *items, [out, retval] ULONG *value); + HRESULT GetAt([in] UINT32 index, [out, retval] T *value); + [propget] HRESULT Size([out, retval] UINT32 *value); + HRESULT IndexOf([in, optional] T element, [out] UINT32 *index, [out, retval] BOOLEAN *value); + HRESULT GetMany([in] UINT32 start_index, [in] UINT32 items_size, [out] T *items, [out, retval] UINT32 *value);
Could we just use unsigned int (like Windows SDK does)?
Thanks, Jacek
It seems to be lowering the type to its underlying integral base type in windows.foundation.collections.h, but the generated specialized interfaces (like IVectorView<HSTRING>) have UINT32. Does it really make a difference?
No, in that case that's fine.
Thanks, Jacek
Signed-off-by: Jacek Caban jacek@codeweavers.com
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/windows.media.speech/main.c | 10 ++++++---- dlls/windows.media.speech/tests/speech.c | 5 +++++ 2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/dlls/windows.media.speech/main.c b/dlls/windows.media.speech/main.c index c358b991be2..31847a2eb6a 100644 --- a/dlls/windows.media.speech/main.c +++ b/dlls/windows.media.speech/main.c @@ -119,7 +119,8 @@ static HRESULT STDMETHODCALLTYPE vector_view_voice_information_GetAt( IVectorView_VoiceInformation *iface, UINT32 index, IVoiceInformation **value) { FIXME("iface %p, index %#x, value %p stub!\n", iface, index, value); - return S_OK; + *value = NULL; + return E_BOUNDS; }
static HRESULT STDMETHODCALLTYPE vector_view_voice_information_get_Size( @@ -131,10 +132,11 @@ static HRESULT STDMETHODCALLTYPE vector_view_voice_information_get_Size( }
static HRESULT STDMETHODCALLTYPE vector_view_voice_information_IndexOf( - IVectorView_VoiceInformation *iface, IVoiceInformation *element, UINT32 *index, BOOLEAN *value) + IVectorView_VoiceInformation *iface, IVoiceInformation *element, UINT32 *index, BOOLEAN *found) { - FIXME("iface %p, element %p, index %p, value %p stub!\n", iface, element, index, value); - *value = FALSE; + FIXME("iface %p, element %p, index %p, found %p stub!\n", iface, element, index, found); + *index = 0; + *found = FALSE; return S_OK; }
diff --git a/dlls/windows.media.speech/tests/speech.c b/dlls/windows.media.speech/tests/speech.c index 770562e9d82..1c48c5bf933 100644 --- a/dlls/windows.media.speech/tests/speech.c +++ b/dlls/windows.media.speech/tests/speech.c @@ -99,6 +99,11 @@ static void test_SpeechSynthesizer(void) ok(hr == S_OK, "IVectorView_VoiceInformation_get_Size voices failed, hr %#x\n", hr); todo_wine ok(size != 0 && size != 0xdeadbeef, "IVectorView_VoiceInformation_get_Size returned %u\n", size);
+ voice = (IVoiceInformation *)0xdeadbeef; + hr = IVectorView_VoiceInformation_GetAt(voices, size, &voice); + ok(hr == E_BOUNDS, "IVectorView_VoiceInformation_GetAt failed, hr %#x\n", hr); + ok(voice == NULL, "IVectorView_VoiceInformation_GetAt returned %p\n", voice); + hr = IVectorView_VoiceInformation_GetMany(voices, size, 1, &voice, &size); ok(hr == S_OK, "IVectorView_VoiceInformation_GetMany failed, hr %#x\n", hr); ok(size == 0, "IVectorView_VoiceInformation_GetMany returned count %u\n", size);
Signed-off-by: Jacek Caban jacek@codeweavers.com