-------------------------------------------------------------------------
| 92 | |
| 93 | //------------------------------------------------------------------------- |
| 94 | void BreakPoint::AdjustEipAfterBreakPointRemoval(HANDLE hThread) const |
| 95 | { |
| 96 | CONTEXT lcContext; |
| 97 | lcContext.ContextFlags = CONTEXT_ALL; |
| 98 | if (!GetThreadContext(hThread, &lcContext)) |
| 99 | THROW_LAST_ERROR("Error in GetThreadContext", GetLastError()); |
| 100 | |
| 101 | #ifdef _WIN64 |
| 102 | --lcContext.Rip; // Move back one byte |
| 103 | #else |
| 104 | --lcContext.Eip; // Move back one byte |
| 105 | #endif |
| 106 | if (!SetThreadContext(hThread, &lcContext)) |
| 107 | THROW_LAST_ERROR("Error in SetThreadContext", GetLastError()); |
| 108 | } |
| 109 | } |