Skip to content

fix: resolve ZDSR backend delay-load failure on 32-bit x86 - #76

Merged
ethindp merged 1 commit into
ethindp:masterfrom
qt06:fix/zdsr-32bit-delayload
Jul 13, 2026
Merged

ethindp merged 1 commit into
ethindp:masterfrom
qt06:fix/zdsr-32bit-delayload

Conversation

@qt06

@qt06 qt06 commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

ZDSRAPI.dll (32-bit) exports undecorated function names (e.g. \InitTTS), but the MSVC delay-load import table on x86 stores stdcall-decorated names (\InitTTS@12). This causes \GetProcAddress\ to fail at runtime even when the DLL is loaded via the registry recovery path.

Additionally, the delay-load hook's stub comparison fails due to the same decoration mismatch, resulting in a null pointer return (crash/exception) when the DLL cannot be found at all.

Changes

  • source/delayimp.cpp: In \dliFailGetProc, strip the @n\ suffix from the function name before calling \GetProcAddress, matching the DLL's actual export name
  • source/delayimp.cpp: In the stub comparison loop on x86, strip @n\ suffix from both the proc name and stub entries before comparing, ensuring graceful stub fallback when the DLL is absent

Testing

  • Built and tested on Windows x86 (32-bit) with ZDSR installed
  • ZDSR backend initializes and functions correctly after the fix
  • NVDA, SAPI5, OneCore backends unaffected

@ethindp

ethindp commented Jul 13, 2026

Copy link
Copy Markdown
Owner

... resulting in a null pointer return (crash/exception) when the DLL cannot be found at all.

This doesn't make sense to me. The delay loader hook is designed to stub functions it knows about. If it is not stubbing ZDSR's functions so that they redirect to Prisms stubs, this is a bug.

@ethindp
ethindp merged commit fe0ad71 into ethindp:master Jul 13, 2026
66 checks passed
@qt06
qt06 deleted the fix/zdsr-32bit-delayload branch November 5, 2026 02:34
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