In Twain the capability ICAP_BITDEPTH defines the number of bits to transfer per pixel during a scan. So for an RGB image with 8 bit per color channel, ICAP_BITDEPTH is 24.
In Sane the depth is defined as the number of bits per color channel, so for an RGB image with 8 bit per color channel, depth is 8.
See Page 10-132 (PDF Page 550) if the Twain 2.5 Spec. Obviously older spec versions where not as exact, so there were misunderstandings.
The existing code to handle ICAP_BITDEPTH did not consider this difference and returned the sane depth value.
This merge request fixes this and adds the ability to set the depth to 16 bit per color channel for those sane backends that support the "depth" option.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/9555
This is cmd engine rewrite part XXXXI.
Main goal is to cover bug entry 39289.
To do so we need to:
- properly handle the echo of commands when not
in interactive mode
+ good news if that this shares mostly the code
we added to rewrite commands to pass them in
pipe sub-shells,
+ also fixing the handling of @ at start of command
(there we a bunch of issues: it was only supported
at the start of a single command, all the other
forms IF/FOR/() are supposed to handle them too)
+ some of the tests assumed there is some kind of
propagation of @ in chained commands; I do believe
it's mostly linked to the commands actually run
+ most of the tests related to echo now pass (expect
a few where there are discrepancies but only on
the number of spaces inserted). I don't feel like
fixing these unless an app actually depends on it,
- fix a couple of other issues:
+ prompt $H actually echo:es \x08\x20\x08 instead of
\x08... to ensure that prev char is actually cleaned
(manually tested on Windows)
+ loop variables when not expanded inside a !foo!
construct (other env variables were).
Test program from Bug 29389 works as expected, even if
output isn't as nice as on windows, mainly because of
conhost refresh rate (BZ#56851).
Side note: this is probably the last MR from the cmd
engine rewrite saga. There are still open tickets on
cmd.exe but most of the structural work should be ok
by now.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/9554
To reproduce:
- `unshare -Upf ./wine cmd`
- (in another terminal) `unshare -Upf ./wine not-a-command`
The first terminal will now go completely unresponsive, until you kill -9 the relevant start.exe from the second terminal.
Root cause analysis: In the first Wine, wineserver gets Unix pid 3 in its namespace. (And a different pid in the root namespace, but no relevant process sees that.)
In the second Wine, cmd.exe gets Unix pid 3 in its namespace, and sends it to wineserver.
When the second cmd exits, wineserver checks if pid 3 did indeed exit, and SIGKILLs it if not. But since that pid is from wrong namespace, wineserver ends up killing itself instead.
While this only happens in badly configured sandboxes, such things do exist in the wild. https://github.com/flathub/org.winehq.Wine/issues/41
The real solution would be either fixing the sandbox config, or making Wine use pidfds instead of pids, but former is out of our control, and latter would be a lot of effort and ifdefs.
The second commit only blocks cases where wineserver exists in ntdll's namespace, but not the other way round. It's a much rarer case than having the processes in mutually-inaccessible sibling namespaces, it's a much bigger patch than the ntdll side, and the error is detected at wrong side (meaning it can't print a friendly error). I'm not sure if it's worth keeping.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/9553