winmm: Respect return value from joyGetPos (Coverity).

Signed-off-by: André Hentschel <nerv@dawncrow.de>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
André Hentschel 2015-12-22 23:18:52 +01:00 committed by Alexandre Julliard
parent bbc42a2341
commit 64f600fe22
1 changed files with 7 additions and 1 deletions

View File

@ -84,6 +84,7 @@ static void CALLBACK JOY_Timer(HWND hWnd, UINT wMsg, UINT_PTR wTimer, DWORD dwTi
{
int i;
WINE_JOYSTICK* joy;
MMRESULT res;
JOYINFO ji;
LONG pos;
unsigned buttonChange;
@ -93,7 +94,12 @@ static void CALLBACK JOY_Timer(HWND hWnd, UINT wMsg, UINT_PTR wTimer, DWORD dwTi
if (joy->hCapture != hWnd) continue;
joyGetPos(i, &ji);
res = joyGetPos(i, &ji);
if (res != JOYERR_NOERROR) {
WARN("joyGetPos failed: %08x\n", res);
continue;
}
pos = MAKELONG(ji.wXpos, ji.wYpos);
if (!joy->bChanged ||