| 109 | } |
| 110 | |
| 111 | BOOL CtrlRoutine::customConsoleCtrlHandler(DWORD ctrl_type) { |
| 112 | if (ctrl_type != CtrlRoutine::current_routine->getEventType()) { |
| 113 | return FALSE; |
| 114 | } |
| 115 | // TODO: remove; |
| 116 | //std::cout << "TYPE: " << CtrlRoutine::current_routine->getType() << "\n"; |
| 117 | |
| 118 | CtrlRoutine::current_routine->findAddressByStackBackTrace(); |
| 119 | |
| 120 | SetEvent(CtrlRoutine::current_routine->found_address_event); |
| 121 | |
| 122 | /* TODO: Remove. No Exception Available here. |
| 123 | if (!SetEvent(CtrlRoutine::current_routine->found_address_event)) { |
| 124 | throw runtime_error(string("Cannot set event for found address event handle. Code: ") + std::to_string(GetLastError())); |
| 125 | } |
| 126 | */ |
| 127 | |
| 128 | return TRUE; |
| 129 | } |
| 130 | |
| 131 | // TODO: a rewrite needed. |
| 132 | void CtrlRoutine::findAddressByStackBackTrace() { |
nothing calls this directly
no test coverage detected