Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b89731a
commit f121d47
Showing
5 changed files
with
43 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
module; | ||
|
||
#include <common.hxx> | ||
|
||
export module devicechange; | ||
|
||
import common; | ||
import settings; | ||
|
||
class DeviceChange | ||
{ | ||
public: | ||
DeviceChange() | ||
{ | ||
FusionFix::onInitEvent() += []() | ||
{ | ||
// Disable WM_DEVICECHANGE message handler, since it happens randomly for some reason | ||
auto pattern = hook::pattern("74 63 83 E8 18 0F 85 ? ? ? ? E8 ? ? ? ? 84 C0"); | ||
static raw_mem pDeviceChangeCheck(pattern.get_first(0), { 0x90, 0x90 }); // nop | ||
|
||
static auto DeviceChangeCB = []() | ||
{ | ||
if (FusionFixSettings.GetInt("PREF_DEVICECHANGE")) | ||
pDeviceChangeCheck.Write(); | ||
else | ||
pDeviceChangeCheck.Restore(); | ||
}; | ||
|
||
DeviceChangeCB(); | ||
|
||
FusionFix::onIniFileChange() += []() | ||
{ | ||
DeviceChangeCB(); | ||
}; | ||
}; | ||
} | ||
} DeviceChange; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters