Skip to content

(APL) NativeHook API // (WineFix) Fix hanging when editing embedded SVGs#47

Open
noahc3 wants to merge 2 commits intodevfrom
fix-svg-hang
Open

(APL) NativeHook API // (WineFix) Fix hanging when editing embedded SVGs#47
noahc3 wants to merge 2 commits intodevfrom
fix-svg-hang

Conversation

@noahc3
Copy link
Copy Markdown
Owner

@noahc3 noahc3 commented Apr 13, 2026

This PR implements a new NativeHook API in APL to enable inline function detouring for native code.

  • This API overwrites function prologues with jumps to managed delegates and creates executable trampolines for call-through to originals.
  • Supports large (>=12 byte, absolute jump) and small (>=5 byte, relative jump via nearby relay) prologues.

This PR also implements new patches in WineFix to resolve hanging when editing embedded SVGs (resolves #14)

  • Widen stub fix - Hooks ID2D1PathGeometry::Widen via ComHook to return an empty geometry instead of E_NOTIMPL, preventing potential hangs on stroked path geometries.
  • Bezier split recursion guard - Detours d2d_geometry_intersect_bezier_bezier via NativeHook to return early when bezier parameter ranges shrink below 1e-6, preventing infinite recursion on overlapping/collinear beziers.
  • Bezier split budget - Detours d2d_geometry_split_bezier via NativeHook with a thread-local counter (reset on Close via ComHook) that caps splits at 512 per operation, preventing unbounded segment growth.

These WineFix patches are functionally equivalent runtime patch implementations of the following Wine runner patches by @Arecsu

@noahc3 noahc3 self-assigned this Apr 13, 2026
@noahc3 noahc3 added apl winefix wf-patch For bugs that we'd like to patch in WineFix labels Apr 13, 2026
@noahc3 noahc3 changed the base branch from main to dev April 13, 2026 03:33
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 13, 2026

🚀 Build Artifacts Ready

Commit: 9aa836a
Build Timestamp: April 13, 2026 at 03:35 UTC
Build Workflow: View Run

📦 Direct Downloads (via nightly.link):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

apl wf-patch For bugs that we'd like to patch in WineFix winefix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WineFix Patch: Crash when editing SVGs

1 participant