This commit is contained in:
Akash Mozumdar 2018-07-19 21:44:03 -04:00
parent d6a90e5426
commit 5ea77e23a5
2 changed files with 3 additions and 2 deletions

View File

@ -32,7 +32,7 @@ add_compile_options(
/MP
/GS-
$<$<CONFIG:MinSizeRel>:/MT>
$<$<CONFIG:Debug>:/MTd>
#$<$<CONFIG:Debug>:/MTd>
)
add_definitions(

View File

@ -101,12 +101,13 @@ void HookManager::RemoveProcessContext(DWORD pid)
void HookManager::RegisterProcess(DWORD pid, HANDLE hostPipe)
{
HM_LOCK;
ProcessRecord record = processRecordsByIds[pid];
ProcessRecord record;
record.hostPipe = hostPipe;
record.hookman_section = OpenFileMappingW(FILE_MAP_READ, FALSE, (ITH_SECTION_ + std::to_wstring(pid)).c_str());
record.hookman_map = MapViewOfFile(record.hookman_section, FILE_MAP_READ, 0, 0, HOOK_SECTION_SIZE / 2); // jichi 1/16/2015: Changed to half to hook section size
record.process_handle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid);
record.hookman_mutex = OpenMutexW(MUTEX_ALL_ACCESS, FALSE, (ITH_HOOKMAN_MUTEX_ + std::to_wstring(pid)).c_str());
processRecordsByIds[pid] = record;
if (attach) attach(pid);
}