BOOL WINAPI DetourRestoreAfterWith() { PVOID pvData; DWORD cbData; pvData = DetourFindPayloadEx(DETOUR_EXE_RESTORE_GUID, &cbData); if (pvData != NULL && cbData != 0) { return DetourRestoreAfterWithEx(pvData, cbData); } SetLastError(ERROR_MOD_NOT_FOUND); return FALSE; }
BOOL WINAPI DetourRestoreAfterWith() { for (HMODULE hMod = NULL; (hMod = DetourEnumerateModules(hMod)) != NULL;) { PVOID pvData; DWORD cbData; pvData = DetourFindPayload(hMod, DETOUR_EXE_RESTORE_GUID, &cbData); if (pvData == NULL || cbData == 0) { continue; } return DetourRestoreAfterWithEx(pvData, cbData); } SetLastError(ERROR_MOD_NOT_FOUND); return FALSE; }