Rémi Bernon : include: Add missing items_size parameter to GetMany.
Alexandre Julliard
julliard at winehq.org
Tue Mar 23 16:54:31 CDT 2021
Module: wine
Branch: master
Commit: 03e3bf5324f2a7c12f9fdccfb344e367d512a8a8
URL: https://source.winehq.org/git/wine.git/?a=commit;h=03e3bf5324f2a7c12f9fdccfb344e367d512a8a8
Author: Rémi Bernon <rbernon at codeweavers.com>
Date: Tue Mar 23 11:23:16 2021 +0100
include: Add missing items_size parameter to GetMany.
For IVectorView and IIterator interfaces.
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
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
More information about the wine-cvs
mailing list