hook Present and ResizeBuffers with MinHook

potentially works around a rare crash regarding discord hooks in functions called by Framework::Update()
This commit is contained in:
goat 2023-05-26 22:59:32 +02:00
parent 681cda91a4
commit 5af1425c97
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B

View file

@ -1005,8 +1005,8 @@ internal class InterfaceManager : IDisposable, IServiceType
Log.Error(ex, "Could not enable immersive mode");
}
this.presentHook = Hook<PresentDelegate>.FromAddress(this.address.Present, this.PresentDetour);
this.resizeBuffersHook = Hook<ResizeBuffersDelegate>.FromAddress(this.address.ResizeBuffers, this.ResizeBuffersDetour);
this.presentHook = Hook<PresentDelegate>.FromAddress(this.address.Present, this.PresentDetour, true);
this.resizeBuffersHook = Hook<ResizeBuffersDelegate>.FromAddress(this.address.ResizeBuffers, this.ResizeBuffersDetour, true);
Log.Verbose("===== S W A P C H A I N =====");
Log.Verbose($"Present address 0x{this.presentHook!.Address.ToInt64():X}");