[PATCH] ntdll/exception: Change return type to CONTEXT* of RtlLocateLegacyContext.

Biswapriyo Nath nathbappai at gmail.com
Wed Sep 2 08:40:04 CDT 2020


I have done some tests with that function in Windows 10.

1. Call RtlGetExtendedContextLength, allocate a buffer with the returned
length.
2. Pass that buffer as CONTEXT_EX to RtlInitializeExtendedContext which
also returns CONTEXT in the first parameter.
3. Use that CONTEXT_EX buffer to RtlLocateLegacyContext. Now check the
returned CONTEXT structure pointer with the 2nd step one.

Also there is a hint in the function name "RtlLocateLegacyContext" itself.
CONTEXT_EX holds the offsets of "Legacy" context (in wdm.h). And by doing
the pointer arithmetic "context_ex + context_ex->Legacy.Offset",
RtlLocateLegacyContext should return a CONTEXT pointer.

I agreed with your logic and it's true. But if one wants to get the WoW-ed
CONTEXT, he/she already has to set the appropriate CONTEXT pointer
structure type as return value.It depends on the flag in
RtlGetExtendedContextLength function.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20200902/c6fbc014/attachment.htm>


More information about the wine-devel mailing list