Switches Windows default map injection to record an app mcontext and take over there, rather than taking over on the return path out of DR functions and confusing clients with two initial blocks in the DR library.
Tested by observing the block sequence in the log file. Without the fix:
Fragment 1, tag 0x000000001502643b, flags 0x1000630, shared, size 19:
[dynamorio.dll~dynamorio_app_init_and_early_takeover+0x37b,~dr_persist_start-0x
Fragment 2, tag 0x0000000015349c23, flags 0x1000030, shared, size 44:
[dynamorio.dll~dynamorio_earliest_init_takeover+0x2d,~dr_virtual_query-0x24dfd]
Fragment 3, tag 0x00007fff20502630, flags 0x9000630, shared, size 34:
[ntdll.dll!RtlUserThreadStart]
With the fix:
Fragment 1, tag 0x00007ffc25822630, flags 0x9000630, shared, size 34:
[ntdll.dll!RtlUserThreadStart]
Issue: #4958 (closed), #626 (closed) Fixes #4958 (closed) Fixes #626 (closed)