<div dir="ltr"><div style="font-family:arial,sans-serif;font-size:large" class="gmail_default">I have done some tests with that function in Windows 10.</div><div style="font-family:arial,sans-serif;font-size:large" class="gmail_default"><br></div><div style="font-family:arial,sans-serif;font-size:large" class="gmail_default">1. Call RtlGetExtendedContextLength, allocate a buffer with the returned length.</div><div style="font-family:arial,sans-serif;font-size:large" class="gmail_default">2. Pass that buffer as CONTEXT_EX to RtlInitializeExtendedContext which also returns CONTEXT in the first parameter.</div><div style="font-family:arial,sans-serif;font-size:large" class="gmail_default">3. Use that CONTEXT_EX buffer to RtlLocateLegacyContext. Now check the returned CONTEXT structure pointer with the 2nd step one.</div><div style="font-family:arial,sans-serif;font-size:large" class="gmail_default"><br></div><div style="font-family:arial,sans-serif;font-size:large" class="gmail_default">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.<br></div><div><br></div><div><div style="font-family:arial,sans-serif;font-size:large" class="gmail_default">
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.

</div><div style="font-family:arial,sans-serif;font-size:large" class="gmail_default"><br></div><br></div></div>