mirror of
https://github.com/dashr9230/SA-MP.git
synced 2025-01-03 16:13:34 +08:00
[saco] Implement UninstallFileSystemHooks()
* Updates `DllMain(...)`
This commit is contained in:
parent
29c3a8b351
commit
58263d0e96
@ -157,3 +157,19 @@ void InstallFileSystemHooks()
|
||||
|
||||
//----------------------------------------------------------
|
||||
|
||||
void UninstallFileSystemHooks()
|
||||
{
|
||||
if(bFileHooksInstalled) {
|
||||
DetourRemove((PBYTE)Real_CreateFileA,(PBYTE)Arch_CreateFileA);
|
||||
DetourRemove((PBYTE)Real_ReadFile,(PBYTE)Arch_ReadFile);
|
||||
DetourRemove((PBYTE)Real_GetFileSize,(PBYTE)Arch_GetFileSize);
|
||||
DetourRemove((PBYTE)Real_SetFilePointer,(PBYTE)Arch_SetFilePointer);
|
||||
DetourRemove((PBYTE)Real_CloseHandle,(PBYTE)Arch_CloseHandle);
|
||||
DetourRemove((PBYTE)Real_GetFileType,(PBYTE)Arch_GetFileType);
|
||||
DetourRemove((PBYTE)Real_ShowCursor,(PBYTE)Arch_ShowCursor);
|
||||
bFileHooksInstalled = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
void InstallShowCursorHook();
|
||||
void InstallFileSystemHooks();
|
||||
void UninstallFileSystemHooks();
|
||||
|
||||
#define MAX_OPEN_ARCH_FILES 50
|
||||
|
||||
|
@ -62,7 +62,6 @@ void LaunchMonitor(PVOID v)
|
||||
|
||||
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
||||
{
|
||||
// TODO: DllMain
|
||||
if(DLL_PROCESS_ATTACH==fdwReason)
|
||||
{
|
||||
hInstance = hinstDLL;
|
||||
@ -97,7 +96,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
||||
else if(DLL_PROCESS_DETACH==fdwReason)
|
||||
{
|
||||
if(tSettings.bDebug || tSettings.bPlayOnline) {
|
||||
//sub_10062D90
|
||||
UninstallFileSystemHooks();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user