This is the fourth part in cmd.exe's engine rewrite.
It concerns:
- start of decoupling parsing from execution by introducing
ad hoc structure to hold parsing result to be passed for
execution (done here for redirection, and if conditions),
- refactor execution code with putting into helpers:
+ change of input/output streams
+ save / restore of input/output streams before / after
execution
Note:
- the handling of fd > 2 is clearly wrong, but it just
mimics the current implementation. More work will be
required afterwards (likely using directly CRT low level
I/O),
- I kept a few specific debug channels in place. They will
be removed (or simplified at some point), but they
could be useful to debug remaining issues.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5641
This should achieve the same thing as https://github.com/ValveSoftware/wine/commit/e8801e96fedf67b88e6f3f5d9f9e2d…
--
v3: win32u: Enumerate offscreen vulkan devices as GPU devices.
win32u: Query GPU memory from vulkan physical device.
win32u: Match driver GPUs with vulkan GPUS from their ids, or index.
win32u: Keep a list of vulkan GPUS in the device manager context.
win32u: Load the graphics driver vulkan functions lazily.
win32u: Fix default_update_display_devices return type to NTSTATUS.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5616
On Tue May 21 09:53:24 2024 +0000, eric pouech wrote:
> using strtol would be better and save you the str_is_number helper
I can switch to strtol, but how does it save the `str_is_number` helper? It returns 0, which is a valid (if useless) timeout value for the native program.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5691#note_71016
On Tue May 21 12:09:30 2024 +0000, eric pouech wrote:
> I'd rather see this outside the do/while loop (and moreover, the second
> count down shall be printed after this message)
Yes, but it only overrides the "Waiting for %s seconds" part, which mostly matches Windows' behavior (from the cursor position). The only difference is that Windows will end at "Waiting for N". While it's possible to replicate this, I believe it may cause issues with translations.
I can move it outside the do/while loop though.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5691#note_71014
On Tue May 21 10:23:40 2024 +0000, eric pouech wrote:
> why do you need float operations here? (int)(ticks_remaining / 1000)
> should do
It needs to be rounded because otherwise it will start with printing "Waiting for N-1 seconds" due to one or more ticks having elapsed (at least on my machine). But yes, I could do an int roundup instead (`(ticks_remaining + 500) / 1000`).
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5691#note_71013
eric pouech (@epo) commented about programs/timeout/timeout_main.c:
> +
> +#include <stdio.h>
> +#include <stdlib.h>
> +#include <string.h>
> +#include <conio.h>
> +#include <math.h>
> +
> +#include <windows.h>
> +
> +#include "resources.h"
> +
> +#include <wine/debug.h>
> +
> +WINE_DEFAULT_DEBUG_CHANNEL(timeout);
> +
> +static char* get_string(int which)
a couple of remarks here (about the helpers for printing):
- returning ASCII strings could lose some bits in conversion, so you'd be safer keeping unicode string
- also usage of (w)printf can lack flexibility in translations (it assumes all parameters have the same order whatever the translation). FormatMessage brings more flexibility as you can change the order of parameters in output.
- and likely RPRINTF_VA could be rewritten as a function and not a macro
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5691#note_71012