Skip to content

Commit

Permalink
Revert: Count DI_BUFFEROVERFLOW as DI_OK for mice
Browse files Browse the repository at this point in the history
  • Loading branch information
elishacloud committed Jun 20, 2024
1 parent 4a16986 commit 6c89976
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Dllmain/BuildNo.rc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define BUILD_NUMBER 7053
#define BUILD_NUMBER 7054
2 changes: 1 addition & 1 deletion External/dinputto8
7 changes: 2 additions & 5 deletions dinput8/IDirectInputDevice8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ HRESULT m_IDirectInputDevice8::GetDeviceData(DWORD cbObjectData, LPDIDEVICEOBJEC
{
Logging::LogDebug() << __FUNCTION__ << " (" << this << ")";

if (Config.FilterNonActiveInput)
if (Config.FilterNonActiveInput && pdwInOut)
{
// Check foreground window's process and don't copy device data if process is not active
HWND hfgwnd = GetForegroundWindow();
Expand All @@ -133,10 +133,7 @@ HRESULT m_IDirectInputDevice8::GetDeviceData(DWORD cbObjectData, LPDIDEVICEOBJEC
}
}

HRESULT hr = ProxyInterface->GetDeviceData(cbObjectData, rgdod, pdwInOut, dwFlags);

// Several games handle DI_BUFFEROVERFLOW as failure
return IsMouse && hr == DI_BUFFEROVERFLOW && rgdod && pdwInOut && *pdwInOut > 0 ? DI_OK : hr;
return ProxyInterface->GetDeviceData(cbObjectData, rgdod, pdwInOut, dwFlags);
}

HRESULT m_IDirectInputDevice8::SetDataFormat(LPCDIDATAFORMAT lpdf)
Expand Down

0 comments on commit 6c89976

Please sign in to comment.