Jinoh Kang (@iamahuman) commented about dlls/ntdll/unix/signal_arm64.c:
+/***********************************************************************
context_init_empty_xstate
- Initializes a context's CONTEXT_EX structure to point to an empty xstate buffer
- */
+static inline void context_init_empty_xstate( CONTEXT *context, void *xstate_buffer ) +{
- CONTEXT_EX *xctx;
- xctx = (CONTEXT_EX *)(context + 1);
- xctx->Legacy.Length = sizeof(CONTEXT);
- xctx->Legacy.Offset = -(LONG)sizeof(CONTEXT);
- xctx->XState.Length = 0;
- xctx->XState.Offset = (BYTE *)xstate_buffer - (BYTE *)xctx;
- xctx->All.Length = sizeof(CONTEXT);
Usually, `All` should span the entire context buffer, including the `CONTEXT_EX` header:
```suggestion:-0+0 xctx->All.Length = (BYTE *)xstate_buffer - (BYTE *)context; ```
If this is not the case for ARM64 kiUserExceptionDispatcher, please add a comment here.