Compare commits

..

No commits in common. "5f8a454e3f45294194ea5f9627df11a75f52af7f" and "587339879024ead9366f767f5163ca0ba70be8b1" have entirely different histories.

3 changed files with 1 additions and 24 deletions

View File

@ -649,13 +649,6 @@ static void load_dlls()
std::vector<std::string> paths = Local_Storage::get_filenames_path(path); std::vector<std::string> paths = Local_Storage::get_filenames_path(path);
for (auto & p: paths) { for (auto & p: paths) {
std::string full_path = path + p; std::string full_path = path + p;
size_t length = full_path.length();
if (length < 4) continue;
if (std::toupper(full_path[length - 1]) != 'L') continue;
if (std::toupper(full_path[length - 2]) != 'L') continue;
if (std::toupper(full_path[length - 3]) != 'D') continue;
if (full_path[length - 4] != '.') continue;
PRINT_DEBUG("Trying to load %s\n", full_path.c_str()); PRINT_DEBUG("Trying to load %s\n", full_path.c_str());
if (LoadLibraryA(full_path.c_str())) { if (LoadLibraryA(full_path.c_str())) {
PRINT_DEBUG("LOADED %s\n", full_path.c_str()); PRINT_DEBUG("LOADED %s\n", full_path.c_str());

View File

@ -18,15 +18,13 @@ bool Windows_Hook::start_hook()
{ {
GetRawInputBuffer = ::GetRawInputBuffer; GetRawInputBuffer = ::GetRawInputBuffer;
GetRawInputData = ::GetRawInputData; GetRawInputData = ::GetRawInputData;
SetCursorPos = ::SetCursorPos;
PRINT_DEBUG("Hooked Windows\n"); PRINT_DEBUG("Hooked Windows\n");
BeginHook(); BeginHook();
HookFuncs( HookFuncs(
std::make_pair<void**, void*>(&(PVOID&)GetRawInputBuffer, &Windows_Hook::MyGetRawInputBuffer), std::make_pair<void**, void*>(&(PVOID&)GetRawInputBuffer, &Windows_Hook::MyGetRawInputBuffer),
std::make_pair<void**, void*>(&(PVOID&)GetRawInputData , &Windows_Hook::MyGetRawInputData), std::make_pair<void**, void*>(&(PVOID&)GetRawInputData , &Windows_Hook::MyGetRawInputData)
std::make_pair<void**, void*>(&(PVOID&)SetCursorPos , &Windows_Hook::MySetCursorPos)
); );
EndHook(); EndHook();
@ -171,18 +169,6 @@ UINT WINAPI Windows_Hook::MyGetRawInputData(HRAWINPUT hRawInput, UINT uiCommand,
return 0; return 0;
} }
BOOL WINAPI Windows_Hook::MySetCursorPos(int x, int y)
{
if (get_steam_client()->steam_overlay->ShowOverlay()) {
POINT p;
GetCursorPos(&p);
x = p.x;
y = p.y;
}
return Windows_Hook::Inst()->SetCursorPos(x, y);
}
///////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////
Windows_Hook::Windows_Hook() : Windows_Hook::Windows_Hook() :

View File

@ -26,13 +26,11 @@ private:
// Hook to Windows window messages // Hook to Windows window messages
decltype(GetRawInputBuffer)* GetRawInputBuffer; decltype(GetRawInputBuffer)* GetRawInputBuffer;
decltype(GetRawInputData)* GetRawInputData; decltype(GetRawInputData)* GetRawInputData;
decltype(SetCursorPos)* SetCursorPos;
static LRESULT CALLBACK HookWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); static LRESULT CALLBACK HookWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
static UINT WINAPI MyGetRawInputBuffer(PRAWINPUT pData, PUINT pcbSize, UINT cbSizeHeader); static UINT WINAPI MyGetRawInputBuffer(PRAWINPUT pData, PUINT pcbSize, UINT cbSizeHeader);
static UINT WINAPI MyGetRawInputData(HRAWINPUT hRawInput, UINT uiCommand, LPVOID pData, PUINT pcbSize, UINT cbSizeHeader); static UINT WINAPI MyGetRawInputData(HRAWINPUT hRawInput, UINT uiCommand, LPVOID pData, PUINT pcbSize, UINT cbSizeHeader);
static BOOL WINAPI MySetCursorPos(int x, int y);
public: public:
virtual ~Windows_Hook(); virtual ~Windows_Hook();