Commit graph

9400 commits

Author SHA1 Message Date
Piotr Caban 89fc06a703 xcopy: Exit after displaying help message. 2024-07-03 21:48:46 +02:00
Eric Pouech 44e8133f4f cmd: Set success/failure return code for PUSHD command.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-07-03 11:30:35 +02:00
Eric Pouech c88789c89b cmd: Set success/failure return code for DIR command.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-07-03 11:30:34 +02:00
Eric Pouech 3852b24b8e cmd: Set success/failure return code for CD command.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-07-03 11:30:33 +02:00
Eric Pouech db929054ba cmd: Add success/failure return code for MKDIR/MD commands.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-07-03 11:30:32 +02:00
Eric Pouech 22bb6ce6e9 cmd: Add success/failure tests for dir related commands.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-07-03 11:30:31 +02:00
Eric Pouech 692f4384e4 cmd: Set success/failure return code for COPY command.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-07-02 20:07:51 +02:00
Eric Pouech e65bcb688a cmd: Set success/failure return code for RENAME command.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-07-02 20:07:50 +02:00
Eric Pouech 90d278f932 cmd: Set success/failure return code for MOVE command.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-07-02 20:07:49 +02:00
Eric Pouech ca3b24733a cmd: Set success/failure return code DELETE command.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-07-02 20:07:48 +02:00
Eric Pouech 0b6fc4cd1c cmd: Set success/failure return code for TYPE command.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-07-02 20:07:47 +02:00
Eric Pouech a132d9c37e cmd: Add success/failure tests for file related commands.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-07-02 20:07:45 +02:00
Fabian Maurer 9db570c6c3 cmd: Close file opened with popen with correct function (coverity). 2024-07-01 18:02:33 +02:00
Eric Pouech bf9a465e95 cmd: Implement semantic for chaining in ||, | and && operators.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-28 12:17:26 +02:00
Eric Pouech 9c717825dc cmd: Set success/failure return code for CALL command.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-28 12:17:25 +02:00
Eric Pouech b1d28877dc cmd: Set success/failure return code for ECHO command.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-28 12:17:24 +02:00
Eric Pouech 7ccc169570 cmd: Add success/failure return code tests for CALL command.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-28 12:17:22 +02:00
Eric Pouech 355b493833 cmd: Use precedence in command chaining.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-28 12:17:21 +02:00
Eric Pouech aeeea45da3 cmd: Return sub-block return code for IF and FOR.
Cleaning-up previous method for end-of-block vs error in IF and
FOR commands.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-27 22:06:12 +02:00
Eric Pouech 6932e8bd0e cmd: Support help for IF and FOR commands.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-27 22:06:12 +02:00
Eric Pouech 6c39db0ca0 cmd: Migrate IF/FOR instructions inside CMD_NODE.
Basically:
- IF and FOR command parsing in integrated into node_builder,
- CMD_NODE is no longer degenerated (and no longer use
  NULL CMD_COMMAND to mark end of block)
- lexer evolves to delegate a bunch of things to node_builder
  (esp. command nesting...)

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53190
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50132
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=44063
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-27 22:06:12 +02:00
Eric Pouech b89c3a41bb cmd: Let token errors be tranlatable.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-26 16:57:27 +02:00
Eric Pouech cb56c7b7bd cmd: Move code around to avoid forward declaration.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-26 16:54:40 +02:00
Eric Pouech cd50aa7d9c cmd: Let redirections be handled by node instead of command.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-26 16:54:40 +02:00
Eric Pouech 6ad88c5512 cmd: Fix a couple of expansions issues.
Fix several incorrect behaviors that (partly) compensate each others:
- when replacing %XXX% by %YYY%, advance current position after the copied
  %YYY% (otherwise it will expand %YYY% in same run),
- don't parse the command in run_program(),
- always expand full content in CALL command.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-26 16:54:40 +02:00
Eric Pouech 560521c14b cmd: Add more tests about CALL and variable expansion.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-26 16:54:40 +02:00
Eric Pouech 2f5456316c cmd: Move depth count inside builder.
(and temporarly using parenthesis count to store curDepth).

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-24 13:24:06 +02:00
Eric Pouech fc4b9c645a cmd: Fix a couple of issues wrt. variable expansion.
Ensure expansion at parse time is only done once.
Simply handleExpansion() code.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-24 13:24:05 +02:00
Eric Pouech 3a8aad4834 cmd: Move prompt handling into line reading.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-24 13:24:04 +02:00
Eric Pouech f45588c57f cmd: Remove unrelated parameter to WCMD_show_prompt.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-24 13:24:03 +02:00
Eric Pouech 8ad0923515 cmd: Factorize code for reading a new line for parser.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-24 13:24:02 +02:00
Eric Pouech bd36ac98c0 cmd: Expand delayed variables in IF operands.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-21 22:59:40 +02:00
Eric Pouech 01d0027739 cmd/tests: Add tests for delayed substitution in IF command.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-21 22:59:40 +02:00
Eric Pouech 411cce36b1 cmd: Introduce return code to indicate abort of current instruction.
Use that return code for WCMD_exit() and WCMD_goto().

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-21 22:59:40 +02:00
Eric Pouech 844d6b553a cmd: Use kernel32's error codes instead of literals.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-21 22:59:40 +02:00
Eric Pouech 2ec70835fc cmd: Introduce token-based syntax parser for building command nodes.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-21 22:59:40 +02:00
Eric Pouech 96d682e5f7 cmd: Test input has been read before using it.
This let confirmations fail when reading from NUL
(instead of looping forever).

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-20 23:03:26 +02:00
Eric Pouech 96762f12e7 cmd: Remove old FOR loop related code.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-20 23:03:26 +02:00
Eric Pouech f98077591f cmd: Fix delayed expansion in FOR loop on file sets.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-20 23:03:26 +02:00
Eric Pouech 0ca28d3a70 cmd: Split parsing from executing FOR loops for file walking.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-20 23:03:26 +02:00
Eric Pouech 6d6fee9dda cmd: Fix delay expansion in FOR loop for filesets.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-19 11:38:10 +02:00
Eric Pouech 2e2a3f4539 cmd: Split parsing from executing FOR loops for filesets (/F).
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-19 11:38:09 +02:00
Eric Pouech 53f7a59992 cmd: Fix delay expansion in FOR /L loops.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-19 11:38:07 +02:00
Eric Pouech 9ba05f5e5b cmd: Split parsing from executing FOR loops for numbers (/L).
Introducing CMD_FOR_CONTROL structure to store parsing output
for consumption in execution.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-19 11:38:05 +02:00
Eric Pouech 25a02d894f cmd: Introduce helpers to handle directory walk.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-17 21:50:00 +02:00
Eric Pouech 2b51e5aca0 cmd: Enable '%0' through '%9' as valid FOR loop variables.
Note: there are many other letters than can be used as variable names.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-17 21:49:57 +02:00
Eric Pouech dc7e8da528 cmd: Introduce helpers to save and restore FOR loop contexts.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-17 21:49:55 +02:00
Eric Pouech abcc2a1bc6 cmd: Introduce helpers to handle FOR variables.
This should let the code be agnostic to the supported variables.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-17 21:49:53 +02:00
Eric Pouech 85ca94be7c cmd: Add more tests about FOR loops.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-17 21:49:50 +02:00
Eric Pouech 80342a0c10 conhost: Support IME input in window mode.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-14 13:48:43 +02:00
Eric Pouech b85c6f5bbb conhost: Handle WM_CHAR for window console.
This lets some characters (like diacritics, generated by two keys,
(eg. circumflex-e on a French keyboard layout)) have usable
key-down INPUT_RECORD.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-14 13:48:43 +02:00
Eric Pouech 1890a3de3f cmd: Separate IF command parsing from execution.
Introducting CMD_IF_CONDITION to hold IF condition.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-04 22:22:01 +02:00
Eric Pouech 5388414923 cmd: Let errorlevel be a signed integer.
Manual testing show that native reports errorlevel as a signed
entity.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-04 22:22:01 +02:00
Eric Pouech 855642d565 cmd: Create helper to execute a command.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-04 22:22:01 +02:00
Eric Pouech a899caac7b cmd: Introduce structure CMD_REDIRECTION.
This structure will hold information for a redirection, and
can be chained in a list when multiple redirections are listed.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-04 22:22:01 +02:00
Eric Pouech 18d8c6fe52 cmd: Introduce a helper to set std handles.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-06-04 22:22:01 +02:00
Hans Leidekker cd780fe609 wmic: Add csproduct and systemenclosure aliases. 2024-06-03 23:24:59 +02:00
Hans Leidekker a293b2f23a wmic: Sort the alias list. 2024-06-03 23:24:59 +02:00
Eric Pouech b3fa23e88d conhost: Fix display of font preview in 64-bit mode.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-05-28 20:42:29 +02:00
Alexandre Julliard 83888e37df conhost: Fix a printf format warning. 2024-05-24 12:35:56 +02:00
Alexandre Julliard ecbc4cf06d wineboot: Retrieve CPU details through the SMBIOS table. 2024-05-14 13:25:16 +02:00
Alexandre Julliard 7097c614b2 wineboot: Support multiple SMBIOS entries of the same type. 2024-05-14 13:20:17 +02:00
Alexandre Julliard 73c798021b wineboot: Report the correct model number on ARM platforms. 2024-05-14 13:20:17 +02:00
Alexandre Julliard c50dc0512c wineboot: Get the CPU model details with NtQuerySystemInformation(SystemCpuInformation). 2024-05-14 13:20:17 +02:00
Alexandre Julliard c3b1259f75 wineboot: Create CPU environment keys together with other hardware keys. 2024-05-14 13:20:15 +02:00
Eric Pouech e6e1bbb410 cmd: Move operator from CMD_COMMAND to CMD_NODE.
For now, the tree is degenerated into a list (as it was before).

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-05-13 21:09:45 +02:00
Eric Pouech 603e81a37a cmd: Add helpers to handle list in degenerated binary tree.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-05-13 21:09:43 +02:00
Eric Pouech 7e70824ed5 cmd: Introduce CMD_NODE structure.
This will allow to separate better the individual command to
be executed (CMD_COMMAND) from the chaining and I/O handling
of several commands (CMD_NODE).

This also renames CMD_LIST into CMD_COMMAND to fit in above
scheme.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-05-13 21:09:41 +02:00
Eric Pouech 508b3ac996 cmd: Remove malloc attribute from xrealloc.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-05-13 21:09:39 +02:00
Eric Pouech ae9bdbda3b cmd: Use CRT's popen instead of rewriting it.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-05-08 22:39:44 +02:00
Eric Pouech 93354bbd88 cmd: Introduce xrealloc helper.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-05-08 22:39:44 +02:00
Eric Pouech 76237079d1 cmd: No longer keep track of last element in command list.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-05-08 22:39:44 +02:00
Eric Pouech 371eda6c4c cmd: Consistenly use the same variable to identify current command.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-05-08 22:39:44 +02:00
Eric Pouech 6f0e9e5e4e cmd/tests: Test success/failure of commands.
The || and && operators to chain commands rely on the LHS command
to be successful (or unsucessful) to decide upon launching the RHS
command.

Unfortunately, success/failure is not always when errorlevel is
0 (non zero).

Some exmaples:
- if a redirection fails (eg. appending to a non existing file),
  the command (builtin/external) is always unsuccessful (and the
  error level is untouched,
- external command (when redirection is ok) is succesful when
  program exit code is zero,
- ditto for a call to a label inside the batch file, with
  the 'exit /b' parameter,
- it's way more complicated for builtins. Eg 'type' is unsuccessful
  on a non existing file, while 'dir' (on the same unexisting file)
  succeeds.

So start adding some tests about success / failure of some commands.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-05-07 22:49:45 +02:00
Eric Pouech 289c49ee21 cmd/tests: Test calling batch files named as builtin commands.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-05-07 22:49:45 +02:00
Eric Pouech 8bbd48bfd8 cmd/tests: Test delayed expansion with spaces in IF and FOR.
Based on a patch by Alex Henrie.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-05-07 22:49:45 +02:00
Eric Pouech 232f282585 cmd/tests: Test nested loop variables expansion.
Based on a patch by Dimitry Sokolov.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-05-07 22:49:45 +02:00
Eric Pouech 14bdf6e725 cmd/tests: Test using %%0-%%9 as loop variables.
Based on a test case from Dimitry Sokolov.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-05-07 22:49:45 +02:00
Anton Baskanov 89ad36b1d9 explorer: Restore display settings on process exit.
Restore display settings to the ones in the registry when CDS_FULLSCREEN
is used in ChangeDisplaySettings().

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49674
2024-05-02 10:06:57 +02:00
Alexandre Julliard 64923f3fee widl: Default to fully interpreted stubs mode. 2024-05-02 09:22:40 +02:00
Alexandre Julliard 4679ceb7ed systeminfo: Pass proper Unicode strings to fwprintf. 2024-04-29 17:35:26 +02:00
Alexandre Julliard cc038c1a40 services: Use fully interpreted IDL stubs. 2024-04-26 10:41:58 +02:00
Alexandre Julliard 3f4562e7e1 rpcss: Use fully interpreted IDL stubs. 2024-04-26 10:41:53 +02:00
Alexandre Julliard e26ed6bc99 plugplay: Use fully interpreted IDL stubs. 2024-04-26 10:41:49 +02:00
Alex Henrie 19e27e95b9 explorer: Fix font handle leaks in virtual desktop.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56133
2024-04-16 21:26:51 +02:00
Hans Leidekker bc52693f9a wmic: Handle multiple properties separated by whitespace. 2024-04-02 23:30:12 +02:00
Hans Leidekker ca629dec9b wmic: Handle failure from CommandLineToArgvW(). 2024-04-02 23:30:11 +02:00
Hans Leidekker 2b3bc20103 wmic: Strip spaces once. 2024-04-02 23:30:11 +02:00
Hans Leidekker c00da2e52d wmic: Make an error message more general. 2024-04-02 23:30:11 +02:00
Eric Pouech 7f60584a90 cmd: Fix substring expansion for 'magic' variables.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56498
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-04-01 09:08:56 +02:00
Eric Pouech b868d82391 cmd: Add test for substring handling in 'magic' variable expansion.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-04-01 09:08:49 +02:00
Louis Lenders 5a8bb41cad wmic: Support interactive mode and piped commands.
Make piped commands work like for example "echo os get version|wmic"
or "type file.txt | wmic" where file.txt contains some commands.
Also support interactive mode.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56361
2024-03-29 22:45:36 +01:00
Paul Gofman 29c73ee173 ntdll: Support more xstate features. 2024-03-26 18:20:56 +01:00
Eric Pouech a7ad588ec5 winedbg: Don't reload a minidump for a different machine.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-21 22:19:58 +01:00
Eric Pouech 70d11a59c6 winedbg: Update the CPU information displayed when reloading a minidump.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-21 22:19:58 +01:00
Eric Pouech 97e584b695 winedbg: Flush expr buffer upon internal exception.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-21 22:19:58 +01:00
Eric Pouech 2e46d81c64 winedbg: Extend 'attach' command to load minidump files.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-21 22:19:58 +01:00
Eric Pouech 8a65cdd13d winedbg: Add ability to set executable name.
Either from command line option, or as a command.
Mostly handy for scripting.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-21 22:19:58 +01:00
Eric Pouech 6b9c1682b1 winedbg: Reload module without virtual flag.
So that we can get to debug info.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-15 15:06:38 +01:00
Eric Pouech aabf6334f3 winedbg: Fallback to PE image when reading memory (minidump).
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-15 15:06:38 +01:00