MCPcopy Create free account
hub / github.com/FEX-Emu/FEX / ReconstructWowContext

Function ReconstructWowContext

Source/Windows/WOW64/Module.cpp:332–347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

330}
331
332WOW64_CONTEXT ReconstructWowContext(CONTEXT* Context) {
333 if (!IsDispatcherAddress(Context->Pc)) {
334 ReconstructThreadState(Context);
335 }
336
337 WOW64_CONTEXT WowContext {
338 .ContextFlags = WOW64_CONTEXT_ALL,
339 };
340
341 auto* XSave = reinterpret_cast<XSAVE_FORMAT*>(WowContext.ExtendedRegisters);
342 XSave->ControlWord = 0x27f;
343 XSave->MxCsr = 0x1f80;
344
345 Context::StoreWowContextFromState(GetTLS().ThreadState(), &WowContext);
346 return WowContext;
347}
348
349static std::optional<FEX::Windows::TSOHandlerConfig> HandlerConfig;
350

Callers 1

Calls 4

StoreWowContextFromStateFunction · 0.85
GetTLSFunction · 0.85
IsDispatcherAddressFunction · 0.70
ReconstructThreadStateFunction · 0.70

Tested by

no test coverage detected