Skip to content

OpenSCManagerW crashes in ARM64EC when called from x86_64 #225

@Michael-Ost-BoseProfessional

Description

System Details

Platform: Ubuntu Linux 25.10 (UTM VM)
Hardware: MacBookPro M4
Application: x86_64 LDSvc.exe (PACE License Support system service)
Hangover: fork from Hangover 11.4 (https://github.com/Michael-Ost-BoseProfessional/hangover). Emulating with FEX.

Problem Description

When x86_64 code emulated by Hangover FEX calls OpenSCManagerW in ARM64EC it crashes. The problem is that the FEX code doesn't set up argument registers correctly for a variadic function like OpenSCManagerW. I've explored two solutions:

  1. Fix the assembler in hangover/wine/dlls/rpcrt4/ndr-stubless.c NdrClientCall2 (which is a proxy to OpenSCManagerW) to fix up the x4 register to point to variadic argument 3.
  2. Fix up the ExitFunctionEC function in hangover/fex/Source/Windows/ARM64EC/Module.S to leave x4 in the right state.

I explored #1 because I already had a fork of Wine, but didn't have a fork of FEX to play with, so it was easier to fix Wine. And the fix is a little scary and hard to test. So I liked that this fix is more localized to the specific crash I was seeing. Here's a commit showing what I did Michael-Ost-BoseProfessional/wine@cc6dbd8.

But as I look closer at it, #2 might be the better, cleaner fix. I am open to making this change to FEX to see if it also fixes my crash.

What's your preference?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions