mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 19:26:32 +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 https://github.com/wine-mirror/wine/commit/ebae298aa4d2711fef35d4ac60c6012438f36d61 https://www.winehq.org/pipermail/wine-devel/2018-November/134767.html
This commit is contained in:
committed by
Hermès BÉLUSCA - MAÏTO
parent
13e566444d
commit
97150ce9dd
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user