Integer overflow with Delphi 10.4.1 and Win64 using Vcl.Styles.Hooks

I’m getting an integer overflow error when using Vcl.Styles.Hooks in a project on Delphi 10.4.1 compiling for Win64.
Update: I don’t get an error when I compile and run without debugging on. So perhaps this code requires checking turned off or this has something to do with Win64 debug mode.

The call stack looks like:

System._RaiseAtExcept(???,???)
System.SysUtils.ErrorHandler(???,$15AC774)
System.ErrorAt(5,$15AC774)
System._IntOver
DDetours.CorrectJ($3A615D0,$7FFD0F8A0023)
DDetours.MapInsts($7FFD0F718000,$7FFD0F8A0020,5)
DDetours.InsertDescriptor($7FFD0F718000,$3B12C20)
DDetours.InstallHook($7FFD0F718000,$1634780,nil,[])
DDetours.InterceptCreate($7FFD0F718000,$1634780,nil,[])
DDetours.InterceptCreate(‘user32.dll’,’GetSysColorBrush’,$1634780,nil,[])
Vcl.Styles.Hooks.Vcl.Styles.Hooks
System.InitUnits

This could be an issue with DDetours of course, so apologies if this is the wrong place to report it. Thanks!

Read more here: Source link