Unix consoles (created from initial process) are inherited by child
processes for various reasons, like keeping std handles bound to that
unix console.
This differs from Windows as the default for a GUI is not to have
console attached.
If a GUI programs asks for a console, it will succeed on Windows
but fail under Wine as the Unix console is still present.
So, allow AllocConsole() to succeed when called from a GUI program
and tied to a Unix console.
(don't do it for CUI as they are already attached to a console).
This fixes Scrap Mechanic when run with '-dev' option.
(based on suggestion from Zhiyi Zhang)
Signed-off-by: Eric Pouech <epouech(a)codeweavers.com>
--
v2: kernelbase: Only inherit consoles for CUI processes.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3022
--
v5: winepulse: Refactor AudioClient's Initialize to match other drivers.
wineoss: Use create_stream's channel count in AudioClient's Initialize.
winecoreaudio: Use create_stream's channel count in AudioClient's Initialize.
winealsa: Use create_stream's channel count in AudioClient's Initialize.
winepulse: Use mmdevapi's set_stream_volumes.
wineoss: Use mmdevapi's set_stream_volumes.
winecoreaudio: Use mmdevapi's set_stream_volumes.
winealsa: Use mmdevapi's set_stream_volumes.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3112
This commit is part of a series of commits intended to remove all uses of hlsl_type_get_regset().
However, I think it deserves to be upstreamed sooner since it solves a rather important SM1 regression (explained below) introduced in e0031d2a1f40792ac85619a495bf5197f248b0e1 .
---
In SM1 we can expect all variables to always belong to a single regset.
structs in particular, should always be allocated to HLSL_REGSET_NUM,
since they are only allowed if all their components are numeric.
We are not covering the structs case because of the use of
hlsl_type_get_regset(), which is currently not defined for structs.
So the current shader
```hlsl
struct
{
float4 a;
float4 b;
} apple;
float4 main() : sv_target
{
return apple.a + apple.b;
}
```
fails with
```
vkd3d/libs/vkd3d-shader/hlsl.c:224: Aborting, reached unreachable code.
```
The solution is to iterate over all regsets to find the one where the
variable is allocated (if any), and ignore all others.
--
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/236