aboutsummaryrefslogtreecommitdiff
path: root/libs/usvfs/src/thooklib/hooklib.h
diff options
context:
space:
mode:
authorSulfurNitride <SulfurNitride@users.noreply.github.com>2026-04-12 02:40:16 -0500
committerSulfurNitride <SulfurNitride@users.noreply.github.com>2026-04-12 02:40:16 -0500
commitbf7a57fc55493247a624ecfd65e4d73964e7d8d2 (patch)
tree0a4b2d6123672768187a5ab863e63cd3f21bb319 /libs/usvfs/src/thooklib/hooklib.h
parente0fb66428a9b78b4c326df8d7e30429a5b271d74 (diff)
Remove vendored usvfs and Windows-only usvfs code paths
The Linux port uses its own in-process FUSE VFS (FuseConnector), so usvfs was dead weight: libs/usvfs/ was never built, usvfsconnector.cpp was explicitly REMOVE_ITEM'd from the source list, and every call site was already guarded by #ifdef _WIN32 with a working Linux branch (the Windows build is also broken on this branch, since FUSE3 is a hard find_package dependency). - Drop libs/usvfs/ and src/src/usvfsconnector.{cpp,h} - Collapse #ifdef _WIN32 / usvfs include branches in organizercore, mainwindow, settings, util, spawn - Remove getUsvfsVersionString() and the "usvfs: ..." log field - Remove vfs32/64DLLName APPPARAMs (nothing reads them) - Relabel About dialog "usvfs:" row to "VFS: FUSE 3"
Diffstat (limited to 'libs/usvfs/src/thooklib/hooklib.h')
-rw-r--r--libs/usvfs/src/thooklib/hooklib.h125
1 files changed, 0 insertions, 125 deletions
diff --git a/libs/usvfs/src/thooklib/hooklib.h b/libs/usvfs/src/thooklib/hooklib.h
deleted file mode 100644
index a549c03..0000000
--- a/libs/usvfs/src/thooklib/hooklib.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
-Userspace Virtual Filesystem
-
-Copyright (C) 2015 Sebastian Herbord. All rights reserved.
-
-This file is part of usvfs.
-
-usvfs is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-usvfs is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with usvfs. If not, see <http://www.gnu.org/licenses/>.
-*/
-#pragma once
-
-#include <map>
-#include <windows_sane.h>
-
-namespace HookLib
-{
-
-enum HookError
-{
- ERR_NONE,
- ERR_INVALIDPARAMETERS, // parameters are invalid
- ERR_FUNCEND, // function is too short to be hooked
- ERR_JUMP, // function consists only of an unconditional jump. Maybe it has already
- // been hooked?
- ERR_RIP, // segment of the function to be overwritten contains a instruction-relative
- // operation
- ERR_RELJUMP // segment of the function to be overwritten contains a relative jump we
- // can't relocated
-};
-
-typedef ULONG HOOKHANDLE;
-static const HOOKHANDLE INVALID_HOOK = (HOOKHANDLE)-1;
-
-///
-/// \brief install a stub (function to be called before the target function)
-/// \param functionAddress address of the function to stub
-/// \param stubAddress address of the stub function. This function has to have the
-/// signature of void foobar(LPVOID address).
-/// address receives the address of the function.
-/// \param error (optional) if set, the referenced variable will receive an error code
-/// describing the problem (if any)
-/// \return a handle to reference the hook in later operations or INVALID_HOOK on error
-///
-HOOKHANDLE InstallStub(LPVOID functionAddress, LPVOID stubAddress,
- HookError* error = nullptr);
-
-///
-/// \brief install a stub (function to be called before the target function)
-/// \param module the module containing the function to hook
-/// \param functionName name of the function to stub (as exported by the library)
-/// \param stubAddress address of the stub function. This function has to have the
-/// signature of void foobar(LPVOID address).
-/// address receives the address of the function.
-/// \param error (optional) if set, the referenced variable will receive an error code
-/// describing the problem (if any)
-/// \return a handle to reference the hook in later operations or INVALID_HOOK on error
-///
-HOOKHANDLE InstallStub(HMODULE module, LPCSTR functionName, LPVOID stubAddress,
- HookError* error = nullptr);
-
-///
-/// \brief install a hook (function replacing the existing functionality of the
-/// function)
-/// \param functionAddress address of the function to hook
-/// \param hookAddress address of the replacement function. This function has to have
-/// the exact same signature as the replaced function
-/// \param error (optional) if set, the referenced variable will receive an error code
-/// describing the problem (if any)
-/// \return a handle to reference the hook in later operations or INVALID_HOOK on error
-///
-HOOKHANDLE InstallHook(LPVOID functionAddress, LPVOID hookAddress,
- HookError* error = nullptr);
-
-///
-/// \brief install a hook (function replacing the existing functionality of the
-/// function)
-/// \param functionName name of the function to hook (as exported by the library)
-/// \param hookAddress address of the replacement function. This function has to have
-/// the exact same signature as the replaced function
-/// \param error (optional) if set, the referenced variable will receive an error code
-/// describing the problem (if any)
-/// \return a handle to reference the hook in later operations or INVALID_HOOK on error
-///
-HOOKHANDLE InstallHook(HMODULE module, LPCSTR functionName, LPVOID hookAddress,
- HookError* error = nullptr);
-
-///
-/// \brief remove a hook
-/// \param handle handle returned in InstallStub or InstallHook
-///
-void RemoveHook(HOOKHANDLE handle);
-
-///
-/// \brief determine the type of a hook
-/// \param handle the handle to look up
-/// \return a string describing the used hooking mechanism
-///
-const char* GetHookType(HOOKHANDLE handle);
-
-///
-/// \brief retrieve the address that can be used to directly call a detour
-/// \param handle handle for the hook
-/// \return function address
-///
-LPVOID GetDetour(HOOKHANDLE handle);
-
-///
-/// \brief resolve an error code to a descriptive string
-/// \param err the error code to resolve
-/// \return the error string
-///
-const char* GetErrorString(HookError err);
-
-} // namespace HookLib