[PATCH] ntdll: Set Rip in for longjmp in RtlRestoreContext (try2)

Piotr Caban piotr.caban at gmail.com
Thu Aug 25 10:47:22 CDT 2016


Hi Daniel,

On 08/18/16 18:29, Daniel Lehman wrote:
> +    pass = 0;
> +    pRtlCaptureContext(&ctx);
> +    if (InterlockedIncrement(&pass) == 1) /* interlocked to prevent compiler from moving */
The patch looks good for me except one thing that I don't understand. 
Why there's no risk that compiler will move the pass=0 assignment after 
pRtlCaptureContext call? Maybe something like this will be more correct:
pass = 0;
InterlockedIncrement(&pass);
pRtlCaptureContext(&ctx);
if (InterlockedIncrement(&pass) == 2)
?

Thanks,
Piotr



More information about the wine-devel mailing list