From: Rémi Bernon rbernon@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54431 --- dlls/dinput/device.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c index c7b29da9271..c001d1ef29a 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c @@ -546,6 +546,7 @@ static HRESULT WINAPI dinput_device_Acquire( IDirectInputDevice8W *iface ) { struct dinput_device *impl = impl_from_IDirectInputDevice8W( iface ); HRESULT hr = DI_OK; + DWORD pid;
TRACE( "iface %p.\n", iface );
@@ -556,6 +557,8 @@ static HRESULT WINAPI dinput_device_Acquire( IDirectInputDevice8W *iface ) hr = DIERR_INVALIDPARAM; else if ((impl->dwCoopLevel & DISCL_FOREGROUND) && impl->win != GetForegroundWindow()) hr = DIERR_OTHERAPPHASPRIO; + else if ((impl->dwCoopLevel & DISCL_FOREGROUND) && (!GetWindowThreadProcessId( impl->win, &pid ) || pid != GetCurrentProcessId())) + hr = DIERR_INVALIDPARAM; else { impl->status = STATUS_ACQUIRED;