| 117 | } |
| 118 | |
| 119 | DWORD WINAPI ServiceThread(LPVOID lpParam) |
| 120 | { |
| 121 | |
| 122 | ManualMap::WDLL* WDll = 0; |
| 123 | Process::CProcess Service(std::string("BEService.exe")); |
| 124 | while (WaitForSingleObject(g_ServiceStopEvent, 0) != WAIT_OBJECT_0) |
| 125 | { |
| 126 | Service.Wait(10); |
| 127 | Service.Open(PROCESS_ALL_ACCESS); |
| 128 | WDll = new ManualMap::WDLL; |
| 129 | if (!ManualMap::LoadFileA(Service.GetHandle(), reinterpret_cast<LPCSTR>(lpParam), 0, WDll)) |
| 130 | { |
| 131 | OutputDebugString("AmdK9 : LoadFileA failed."); |
| 132 | if (WDll) |
| 133 | delete WDll; |
| 134 | Service.Kill(); |
| 135 | Service.Close(); |
| 136 | continue; |
| 137 | } |
| 138 | if(WDll) |
| 139 | delete WDll; |
| 140 | WaitForSingleObject(Service.GetHandle(), INFINITE); |
| 141 | Service.Close(); |
| 142 | } |
| 143 | |
| 144 | return ERROR_SUCCESS; |
| 145 | } |
| 146 | |