From: Brendan Shanks bshanks@codeweavers.com
--- dlls/xinput1_3/main.c | 2 +- dlls/xinput1_3/tests/xinput.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/dlls/xinput1_3/main.c b/dlls/xinput1_3/main.c index 28f57e93bce..c2539483398 100644 --- a/dlls/xinput1_3/main.c +++ b/dlls/xinput1_3/main.c @@ -1101,7 +1101,7 @@ DWORD WINAPI DECLSPEC_HOTPATCH XInputGetDSoundAudioDeviceGuids(DWORD index, GUID FIXME("index %lu, render_guid %s, capture_guid %s stub!\n", index, debugstr_guid(render_guid), debugstr_guid(capture_guid));
- if (index >= XUSER_MAX_COUNT) return ERROR_BAD_ARGUMENTS; + if (index >= XUSER_MAX_COUNT || !render_guid || !capture_guid) return ERROR_BAD_ARGUMENTS; if (!controllers[index].device) return ERROR_DEVICE_NOT_CONNECTED;
return ERROR_NOT_SUPPORTED; diff --git a/dlls/xinput1_3/tests/xinput.c b/dlls/xinput1_3/tests/xinput.c index 5c31f0be1fe..71905dc5a40 100644 --- a/dlls/xinput1_3/tests/xinput.c +++ b/dlls/xinput1_3/tests/xinput.c @@ -255,6 +255,12 @@ static void test_get_dsoundaudiodevice(void) trace("Headset microphone not attached\n"); }
+ result = pXInputGetDSoundAudioDeviceGuids(0, NULL, &soundCapture); + ok(result == ERROR_BAD_ARGUMENTS, "XInputGetDSoundAudioDeviceGuids returned %lu\n", result); + + result = pXInputGetDSoundAudioDeviceGuids(0, &soundRender, NULL); + ok(result == ERROR_BAD_ARGUMENTS, "XInputGetDSoundAudioDeviceGuids returned %lu\n", result); + result = pXInputGetDSoundAudioDeviceGuids(XUSER_MAX_COUNT+1, &soundRender, &soundCapture); ok(result == ERROR_BAD_ARGUMENTS, "XInputGetDSoundAudioDeviceGuids returned %lu\n", result); }