DDetours icon indicating copy to clipboard operation
DDetours copied to clipboard

AV when InterceptCreate called inside initialization section

Open Sorien opened this issue 9 years ago • 3 comments

initialization
    InterceptCreate(@Dialogs.ShowMessage, @DialogHelper.ShowMessage);

image

Sorien avatar Jan 14 '16 08:01 Sorien

Hi Sorien, Can you please include a simple demo ?

MahdiSafsafi avatar Jan 14 '16 08:01 MahdiSafsafi

hmm, can't reproduce it in simple demo .. i'll try to debug it a bit

Sorien avatar Jan 14 '16 09:01 Sorien

system.pas - function InitUnits https://gist.github.com/Sorien/5235bdfab2c33dd11ece

image

TProc(P)(); is calling initialization at my unit (code below)

initialization
    InterceptCreate(@Dialogs.ShowMessage, @DialogHelper.ShowMessage);

in next itteration total count is changed ...

image

when i remove InterceptCreate/replace with old code hooking Count won't be changed

it looks really weird :/

Sorien avatar Jan 14 '16 09:01 Sorien