winmm: Attempt only once to load the default joystick driver.
Signed-off-by: Baruch Rutman <peterooch@gmail.com> Signed-off-by: Andrew Eikum <aeikum@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
0c28ca8d50
commit
ebae298aa4
|
@ -68,12 +68,21 @@ static WINE_JOYSTICK JOY_Sticks[MAXJOYSTICK];
|
|||
*/
|
||||
static BOOL JOY_LoadDriver(DWORD dwJoyID)
|
||||
{
|
||||
if (dwJoyID >= MAXJOYSTICK)
|
||||
static BOOL winejoystick_missing = FALSE;
|
||||
|
||||
if (dwJoyID >= MAXJOYSTICK || winejoystick_missing)
|
||||
return FALSE;
|
||||
if (JOY_Sticks[dwJoyID].hDriver)
|
||||
return TRUE;
|
||||
|
||||
JOY_Sticks[dwJoyID].hDriver = OpenDriverA("winejoystick.drv", 0, dwJoyID);
|
||||
|
||||
if (!JOY_Sticks[dwJoyID].hDriver)
|
||||
{
|
||||
/* The default driver is missing, don't attempt to load it again */
|
||||
winejoystick_missing = TRUE;
|
||||
}
|
||||
|
||||
return (JOY_Sticks[dwJoyID].hDriver != 0);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue