mirror of
https://github.com/Artikash/Textractor.git
synced 2024-12-24 01:14:12 +08:00
refactor
This commit is contained in:
parent
47ea350eaa
commit
52a4fb348b
@ -14,7 +14,6 @@
|
||||
//#define ITH_ENGINE_UX_DLL L"vnrengux.dll"
|
||||
|
||||
#define ITH_DLL L"vnrhook.dll"
|
||||
#define ITH_DLL_XP L"vnrhookxp.dll"
|
||||
|
||||
// Pipes
|
||||
|
||||
@ -27,24 +26,7 @@
|
||||
|
||||
// Mutex
|
||||
|
||||
// jichi 7/12/2015:
|
||||
// ITH IO name prefix, needed by Windows 10 for NT event and mutex APIs
|
||||
// Otherwise, NT functions will return status = STATUS_OBJECT_PATH_SYNTAX_BAD
|
||||
//#define ITH_PATH_ L"\\BaseNamedObjects\\"
|
||||
#define ITH_PATH_ L""
|
||||
|
||||
#define ITH_PROCESS_MUTEX_ ITH_PATH_ L"VNR_PROCESS_" // ITH_%d
|
||||
#define ITH_HOOKMAN_MUTEX_ ITH_PATH_ L"VNR_HOOKMAN_" // ITH_HOOKMAN_%d
|
||||
#define ITH_DETACH_MUTEX_ ITH_PATH_ L"VNR_DETACH_" // ITH_DETACH_%d
|
||||
|
||||
#define ITH_GRANTPIPE_MUTEX ITH_PATH_ L"VNR_GRANT_PIPE" // ITH_GRANT_PIPE
|
||||
|
||||
#define ITH_CLIENT_MUTEX ITH_PATH_ L"VNR_CLIENT" // ITH_DLL_RUNNING
|
||||
#define ITH_SERVER_MUTEX ITH_PATH_ L"VNR_SERVER" // ITH_RUNNING
|
||||
#define ITH_SERVER_HOOK_MUTEX ITH_PATH_ L"VNR_SERVER_HOOK" // original
|
||||
|
||||
// Events
|
||||
|
||||
#define ITH_REMOVEHOOK_EVENT ITH_PATH_ L"VNR_REMOVE_HOOK" // ITH_REMOVE_HOOK
|
||||
|
||||
// EOF
|
||||
|
@ -94,12 +94,6 @@ BOOL WINAPI DllMain(HINSTANCE hModule, DWORD fdwReason, LPVOID unused)
|
||||
wchar_t hm_mutex[0x100];
|
||||
swprintf(hm_mutex, ITH_HOOKMAN_MUTEX_ L"%d", GetCurrentProcessId());
|
||||
::hmMutex = CreateMutexW(nullptr, FALSE, hm_mutex);
|
||||
}
|
||||
{
|
||||
wchar_t dll_mutex[0x100];
|
||||
swprintf(dll_mutex, ITH_PROCESS_MUTEX_ L"%d", GetCurrentProcessId());
|
||||
DWORD exists;
|
||||
::hMutex = CreateMutexW(nullptr, TRUE, dll_mutex); // jichi 9/18/2013: own is true, make sure the injected dll is singleton
|
||||
if (GetLastError() == ERROR_ALREADY_EXISTS)
|
||||
return FALSE;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user