Skip to content

Give PC-Talker its delay-load stubs on ARM64 - #132

Merged
ethindp merged 1 commit into
ethindp:masterfrom
trypsynth:fix/pc-talker-arm64
Sep 22, 2026
Merged

ethindp merged 1 commit into
ethindp:masterfrom
trypsynth:fix/pc-talker-arm64

Conversation

@trypsynth

@trypsynth trypsynth commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

On Windows ARM64, probing PC-Talker on a machine without it crashes the process:

[prism WARN] prism/delayimp: delay-load dummy handle pool exhausted after 0 modules; 'PCTKUSR.dll' left unresolved
[prism ERROR] prism/delayimp: no stub for 'PCTKUSR.dll!PCTKStatus'; delay-load will fail

The availability poll reaches PC-Talker in its first scan, so any context with an availability callback takes the process down on ARM64 within a second of starting.

PC-Talker is built for ARM64, and PrismPlatformWindows.cmake generates its import library there, but PCTK_DLL and PC-Talker's stubs sat inside the x86/x64 block in delayimp.cpp. With no stub, the failure hook has nothing to return, and the delay-load exception is fatal.

What this does

Moves PCTK_DLL out of the x86/x64 block and, inside the one stub table, wraps only the ZDSR and BoyPCReader entries in that block. PC-Talker's entries and the bridge entries now exist on every architecture, which makes the separate #else table (a copy of the bridge entries) redundant, so it goes.

This replaces the first version of this PR, which built PC-Talker on x86 and x64 only.

Testing

On GitHub's windows-11-arm runner, through a .NET test suite that creates a context with an availability callback. Before, the test host crashed on the first scan as above. After, PC-Talker is registered and the suite passes. The same suite passes on x64 and x86.

@ethindp

ethindp commented Sep 22, 2026

Copy link
Copy Markdown
Owner

PCTalker is available on ARM64, so we do need to add stubs fro that arch (I forgot to do this in the recent batch of commits, woops).

@trypsynth

Copy link
Copy Markdown
Contributor Author

@ethindp should I do that in this pr, or would you like to close/merge this and then have me or you do that as its own pr?

@ethindp

ethindp commented Sep 22, 2026

Copy link
Copy Markdown
Owner

@trypsynth I'm happy if it's combined as one PR. Either works for me.

@trypsynth trypsynth changed the title Build PC-Talker only where its delay-load stubs exist Give PC-Talker its delay-load stubs on ARM64 Sep 22, 2026
@ethindp
ethindp merged commit 0c8c327 into ethindp:master Sep 22, 2026
65 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants