Commit Graph
5 Commits
Author SHA1 Message Date
Claude f13d0ccd1d Named events, mutexes and semaphores between processes
They were the process's own. A named one now keeps its state in a page
of POSIX shared memory, named for the user and a hash of the name,
which each process with a handle maps; a spin lock in the page holds
the state still while a wait looks at it and takes it, and a wait for
several shared objects takes their locks in the order of their names.
The page lists the processes holding handles: when none is alive the
object is gone, as when its last handle closes, so a program that
crashed leaves no name behind. A mutex whose owner's process has ended
is abandoned, and the next wait returns WAIT_ABANDONED. Waits in other
processes look again every 4 ms, since nothing can wake them.

iotest checks, with child processes: a mutex that exists and is owned
elsewhere, an event set from another process, the name free again
after every handle closes, an abandoned mutex, a semaphore's count
shared, and a name kept to one kind of object.

Signed-off-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
2026-11-21 15:09:01 +00:00
Claude fb16704c8f tests: check what Windows and Wine agree on for the new APIs
iotest calls GetEnvironmentStringsA only without UNICODE, where the
SDK headers name it. wintest's symbol font check needs Wingdings on
Windows, which Wine does not have, so it is skipped there when the
font is missing. Wine's MMIO_DELETE reports success but leaves the
file, so audiotest checks that the file is gone only elsewhere.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>
2026-11-20 16:36:23 +00:00
Claude 7a46a21945 port: the environment block, GetUserName, Beep and the standard folders
GetEnvironmentStrings(W) and FreeEnvironmentStrings give a copy of the
environment; GetUserName the login name; Beep plays its tone through the
sound device. SHGetFolderPath and SHGetSpecialFolderPath give the XDG
folders and the home folder on Linux (CSIDL_APPDATA is ~/.config,
CSIDL_PROFILE is the home folder) and the ~/Library folders on macOS,
creating them with CSIDL_FLAG_CREATE.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>
2026-11-20 16:16:04 +00:00
Claude f6606cb6cb iotest: check what Windows and Wine agree on
A byte pipe's message count is the message length (0) less what was
read, on Windows as on Wine, so the test no longer checks it. Wine's
BuildCommDCB takes only on and off for dtr= and rts=; the handshake
forms are checked where they are kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>
2026-11-20 14:43:47 +00:00
Claude 1198cad531 port: pipes, serial ports, and commctrl.h's helper macros
CreatePipe and PeekNamedPipe, and a child's standard handles through
STARTF_USESTDHANDLES (CreateProcessW now passes its STARTUPINFO on). A
pipe whose other end is closed reports ERROR_BROKEN_PIPE or
ERROR_NO_DATA, and a write to it no longer stops the program.

Serial ports over termios: "COM1" is $WINPORT_COM1 or the first serial
device, and a device path opens as a port. GetCommState/SetCommState,
BuildCommDCB, COMMTIMEOUTS, the modem lines, PurgeComm, ClearCommError,
EscapeCommFunction, WaitCommEvent and SetCommMask; on a port opened
with FILE_FLAG_OVERLAPPED, reads, writes and event waits run in the
background, with GetOverlappedResult and CancelIo.

The ListView_, TabCtrl_ and TreeView_ macros, winsock.h, and commctrl.h
under WIN32_LEAN_AND_MEAN (it needs objidl.h for LPSTREAM).

The new iotest covers pipes, a child, and a port over a
pseudo-terminal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>
2026-11-20 14:06:10 +00:00