SEH-safe header field writing
| 1699 | |
| 1700 | // SEH-safe header field writing |
| 1701 | static bool SEH_WriteResponseHeader(void* respHeader, int32_t eresult = 1) { |
| 1702 | __try { |
| 1703 | *(uint32_t*)((uintptr_t)respHeader + 16) |= 0x20000000u; |
| 1704 | *(int32_t*)((uintptr_t)respHeader + 216) = eresult; |
| 1705 | |
| 1706 | *(uint32_t*)((uintptr_t)respHeader + 16) |= 0x40000000u; |
| 1707 | *(int32_t*)((uintptr_t)respHeader + 220) = 0; |
| 1708 | return true; |
| 1709 | } __except(EXCEPTION_EXECUTE_HANDLER) { |
| 1710 | LOG("[VtHook] EXCEPTION writing response header: code=0x%08X", GetExceptionCode()); |
| 1711 | return false; |
| 1712 | } |
| 1713 | } |
| 1714 | |
| 1715 | // Shared Cloud RPC dispatch - routes a method name to the appropriate handler. |
| 1716 | // Returns std::nullopt if the method is not a recognized Cloud RPC we handle. |