16 Commits
Author SHA1 Message Date
Storm Dragon 17052c5147 More fixes discovered based on Deedra's work. 2026-10-23 16:08:58 -04:00
deedra e962fd0a78 Avoid callback stack overflow when snapshotting large Edit controls
Reading a large ANSI Edit control through GetWindowTextW sends a
WM_GETTEXT buffer through WH_CALLWNDPROC. Wine copies that UTF-16 buffer
onto the application's callback stack, exhausting a 1 MiB stack at about
516,000 code units and potentially leaving an exception status in the
cached snapshot length.

Query WM_GETTEXTLENGTH and WM_GETTEXT through the current window procedure
with CallWindowProcW instead. This avoids the message-hook buffer copy
while preserving ANSI/Unicode conversion and the application's subclass
chain. Reenter the busy accessibility subclass rather than calling
DefSubclassProc directly, which can consume callbacks needed to forward
the original edit message. Reject negative or oversized copy results and
discard the unusable buffer before its length can be used for indexing.

Extend the native hook-safety fixture for both 32-bit and 64-bit DLLs:
- Reserve a 1 MiB PE stack and install a real WH_CALLWNDPROC hook.
- Replace ANSI text with 516,000, 600,000 and 1,040,000 characters and
  verify the complete UTF-16 snapshot, its length and its terminator.
- Use short lines to avoid excessive paragraph-layout time.
- Keep a lower subclass installed and verify that the original text
  replacement still reaches it exactly once during the reentrant probe.

Document the reproduction, why direct hook invocation alone misses it,
and the remaining distinction between fixture coverage and live
MUSHclient acceptance.

Validation:
- Synchronized deedra with its upstream and origin/master; both were
  already up to date.
- cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=winelib-toolchain.cmake
- cmake --build build --parallel: passed.
- git diff --check: passed.
- xvfb-run -a ctest --test-dir build --output-on-failure: interrupted
  at the user's request to skip tests. Foreground-focus, msaa-states,
  review-capture64 and review-capture32 passed before interruption;
  hook-safety had started but has no completed result from this run.
- Further integration tests were skipped at the user's request.

Live MUSHclient behavior, audible speech and physical braille remain
unverified by this commit session. Human review and submission remain
the contributor's responsibility under the README policy.
2026-10-23 09:24:36 -07:00
Storm Dragon 2dfd5b200a Merged from branch deedra after conflict fixes. 2026-10-19 22:52:05 -04:00
deedra 3474bb39c7 Bound native hook stack use and scope hooks to foreground threads
Ignored and reentrant Edit messages previously entered a callback whose
large text buffers increased stack use on every nested call. Menu hook
forwarding also reserved payload buffers for unrelated messages. The
64-bit helper additionally installed desktop-wide hooks, allowing
background UI threads to acquire subclasses and introducing synchronous
traffic through Wine's mixed-architecture global hook chain.

Move Edit processing and menu payload construction into non-inlined
handlers. Keep the forwarding callbacks small, retain the busy-state and
destruction guards, and preserve application subclass chaining and ANSI/
Unicode text handling.

Share foreground hook ownership between the Winelib helper and 32-bit
host. Attach both hooks only to the matching foreground UI thread,
release them when that thread changes, and retry incomplete attachment
as a pair. Preserve existing Edit subclasses across foreground changes
and release host hooks during shutdown.

Add native 32-bit and 64-bit stack-budget fixtures covering ignored and
busy reentrant messages, menu forwarding, nested text queries, application
subclasses before and after attachment, text input, and destruction during
a text change. Add a foreground-scope integration fixture that verifies
background exclusion, thread switching, detachment, and reattachment.
Keep hook debug symbols and frame pointers for native crash diagnosis,
and document installation and live acceptance requirements.

Validation:
- CMake configure and parallel build; git diff --check.
- Hook-safety CTest and foreground-scope fixtures for both architectures.
- Existing menu fixtures and Edit late-attachment/restart checks for both
  architectures, plus the 32-bit list fixture and reader-timeout test.

These checks exercise specific stack and hook-scope defects; they do not
establish the cause of the live MUSHclient stack overflow. Audible speech,
physical braille, and live MUSHclient acceptance remain separate checks.
2026-10-19 18:35:57 -07:00
Storm Dragon e0c83859f5 Battle.net installer now working. It crashes when the login page loads, but that seems to be fixed in upcoming version and the controls did read. 2026-10-16 12:26:59 -04:00
ak47 b16c6968ae Code optimization and bug fixes. 2026-10-14 20:55:28 -04:00
Storm Dragon 4c47cc5fc4 Merge branch 'deedra' 2026-10-14 20:13:11 -04:00
deedra b808c6686a Read command-history recalls in Wine edit fields
MUSHclient consumes queued Up/Down keys in PreTranslateMessage before the
Edit control receives WM_KEYDOWN. It recalls commands with SetWindowText
followed by SetSel at the end of the replacement. The editor subclass only
refreshed its snapshot for WM_SETTEXT, so the recalled command was silent
or followed by a stray character or blank from the caret update. Recalling
equal-length commands also leaves the final caret position unchanged.

Observe Up/Down for the focused standard Edit control in WH_GETMESSAGE,
excluding Ctrl-modified navigation. Associate the next successful
WM_SETTEXT with that retrieved key and announce the bounded recalled text
as an existing ordered text-read action. Report empty input as blank.
Consume the pending recall after the replacement and suppress the ensuing
EM_SETSEL feedback so each recalled command is announced once.

Reset recall tracking on subsequent retrieved messages, actual focus and
ordinary dispatched navigation. Preserve snapshot refreshes and normal
Left/Right reading after recalls. Keep password and foreground/focus
exclusion in place, leave unrelated programmatic text updates silent, and
check the control class before accessing the shared attachment property
so Scintilla's different state structure is untouched. Both native hook
architectures receive the fix through the existing build.

Extend the Edit fixture with application-side pretranslation of queued
history arrows. Assert the exact ordered feedback for Up/Down, equal-length
entries, rapid recalls, empty input and horizontal navigation afterward.
Require silence for unchanged history boundaries, unrelated programmatic
updates, protected fields and independently unprotected background fields.
Document history behavior and live MUSHclient acceptance steps.

Validation used a private Xorg dummy display, disposable Wine prefixes and
recording D-Bus services, with GUI checks run sequentially:

- cmake --build build --parallel
- ctest --test-dir build --output-on-failure: all four checks passed
- python3 tests/menu_integration.py --build-dir build --fixture edit
- The Edit check with --32-bit, --32-bit --late-helper, and
  --32-bit --restart-helper
- python3 tests/menu_integration.py --build-dir build --fixture winforms
  --32-bit
- python3 tests/menu_integration.py --build-dir build --fixture notepad
- python3 tests/menu_integration.py --build-dir build --fixture menu
  --32-bit
- git diff --check

The new 32-bit history regression failed against the original hook,
recording only blank actions, and passed with the fix. Final 32-bit,
64-bit and Windows Forms editor checks passed, including existing typing,
selection, deletion, Unicode, password and read-only assertions.

Built and installed the helper into the existing user-local installation,
backed up the previous five files and verified the installed artifacts.
The user subsequently confirmed that the installed fix works in MUSHclient.
Physical braille acceptance was not separately established.
2026-10-14 15:46:26 -07:00
Storm Dragon 6e92ad13d1 Updates for when prism doesn't behave. 2026-10-13 17:42:56 -04:00
deedra a002c4cc1e Echo typed characters in Wine edit fields 2026-10-12 15:31:00 -07:00
deedra a8cb350467 Provide fresh Wine review snapshots and 32-bit Edit hooks
Expose visible Wine window text to the matching Go reader's independent
keypad review commands, and extend standard Edit feedback to 32-bit programs
such as MUSHclient without requiring 32-bit Linux GLib/Winelib libraries.

Add lifetime-aware instance/window/control identities and bounded capture
of standard Edit text, button/static captions, native ListBox/ListView items,
and usable MSAA text. Preserve focus, caret, selection, scrolling, and the
clipboard. Exclude hidden/password content before retrieval, retain both
rune and UTF-16 offsets, clip visible ranges, and reject changing or
oversized sources rather than returning incomplete text as a full snapshot.

Export CaptureWindow on the version-1 WineReview D-Bus interface. Register
with the current reader service owner and publish copied focus metadata.
Authorize capture only for the current same-user owner. Use a dedicated
GLib dispatcher and separate COM worker with a 500 ms deadline, one active
job and one pending job, bounded payloads, and explicit stale/busy/limited/
unavailable replies. Keep menu and focus forwarding responsive when an MSAA
provider stalls; retain ordinary feedback with older readers.

Read the actual X11 geometry associated with Wine HWNDs using bounded XCB
queries and __wine_x11_whole_window. Translate virtual-desktop coordinates
and recheck physical geometry before returning captured text. Link XCB in
the helper/tests and declare libxcb in the Arch package dependencies.

Build edit_hook.c into the 32-bit DLL and attach both menu and input hooks
to the foreground 32-bit UI thread. Release both hooks on transitions or
attachment failure. Keep Scintilla-specific hooks confined to 64-bit builds.
Expand Edit integration checks with read-only multiline navigation and
unsuccessful deletion, plus 32-bit editor/Windows Forms lifecycle support.

Add 32-bit/64-bit native capture fixtures, wire-protocol integration checks,
and design/implementation documents. Document exact schema, capture limits,
installation dependencies, compatibility, and live acceptance procedures.

Validation during commit preparation:
- git diff --check passed.
- cmake --build build --parallel passed.
- CTest could not start because xvfb-run is unavailable in this environment.
- Further tests were skipped at the user's request; capture, protocol, and
  menu/editor integration tests were not run during commit preparation.

Live speech and physical braille checks remain necessary, including review
without moving the native caret, incoming output, plugin dialogs, and return
to Linux/Fenrir. Custom painted output requires an accessible provider;
RichEdit/Scintilla capture, semantic object review, Say All, typing echo, and
native Wine braille routing remain unsupported by this protocol.
2026-10-11 20:50:56 -07:00
Storm Dragon df7879acb5 Notepad++ should work now. 2026-10-10 22:39:24 -04:00
Storm Dragon 25e38907d3 Read Windows Forms login fields and associate their labels 2026-10-10 02:55:42 -04:00
Storm Dragon 9aad6748e0 Coupple regressions fixed. 2026-10-10 01:02:34 -04:00
ak47 c5657ee5d4 Finish up edit field accessibility. 2026-10-10 00:18:22 -04:00
Storm Dragon 6f6d4040c4 Work started on editor support. 2026-10-09 15:57:45 -04:00