mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[WINMM] Sync wine commit ebae298 as a fix for CORE-15336 (#1031)
Reduce CPU usage by only attempting once to load the default joystick driver.
Fix for CORE-15336
Imported wine commit ebae298
ebae298aa4
https://www.winehq.org/pipermail/wine-devel/2018-November/134767.html
This commit is contained in:
parent
13e566444d
commit
97150ce9dd
1 changed files with 10 additions and 1 deletions
|
@ -55,12 +55,21 @@ static WINE_JOYSTICK JOY_Sticks[MAXJOYSTICK];
|
||||||
*/
|
*/
|
||||||
static BOOL JOY_LoadDriver(DWORD dwJoyID)
|
static BOOL JOY_LoadDriver(DWORD dwJoyID)
|
||||||
{
|
{
|
||||||
if (dwJoyID >= MAXJOYSTICK)
|
static BOOL winejoystick_missing = FALSE;
|
||||||
|
|
||||||
|
if (dwJoyID >= MAXJOYSTICK || winejoystick_missing)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (JOY_Sticks[dwJoyID].hDriver)
|
if (JOY_Sticks[dwJoyID].hDriver)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
JOY_Sticks[dwJoyID].hDriver = OpenDriverA("winejoystick.drv", 0, dwJoyID);
|
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);
|
return (JOY_Sticks[dwJoyID].hDriver != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue