whoami\whoami.c(134):
warning C4267: 'initializing': conversion from 'size_t' to 'DWORD', possible loss of data
whoami\whoami.c(241),(256):
warning C4267: 'initializing': conversion from 'size_t' to 'UINT', possible loss of data
CORE-20537
- `WhoamiSetTable()`: Specify the correct size for allocating a buffer
for a NUL-terminated UTF16 string (previously, only half the space for
the NUL terminator was considered).
This caused a heap corruption when the corresponding NUL-terminate
string was then copied into this buffer, and potentially leading to
reading past the end of the string (since no real NUL terminator
would be found).
- `WhoamiPrintTable()`: Just make it do what it needs to do: print the
table and nothing more: no "side-effect" behaviour like table freeing.
- Instead, add a `WhoamiFreeTable()` routine whose purpose is just to
free the table. And the tables are freed in the routines where they
have been previously allocated.
- `WhoamiPrintTable()`:
* Allocate a column-lengths table *ONLY* when needed, i.e. when
printing the table in "table" format. When printing it in "list"
format, there is no need to allocate anything and we can instead
use only a single variable.
* The old code handling "those pesky ':'" -- used when tables are
displayed in list format, using: `whoami /all /fo list` -- was buggy,
because it was patching the table header names, writing a ':' and a
NUL-terminator past the end of the allocated string buffer (see bug
described above in `WhoamiSetTable()`). As a result, once the table
was freed, a heap corruption would happen, leading to a crash.
Now, displaying the ':' is handled as part of the wprintf()-formatting
table item string.
* For developers, two ways of displaying these ':' are proposed:
the way Windows displays the table in "list" format, where the ':'
directly follow the item names in the 1st column; and a "nicer" one
(to my taste!), where all the ':' are vertically aligned -- currently
disabled.
In particular:
- `IDS_NOSET`: When the user tries `hostname -s ...`, tell them that for
changing the computer host's name, one has to go in the "Computer Name"
tab in the "System" control panel applet.
NOTE: You may observe that Windows' hostname says instead,
"Use the Network Control Panel Applet to set hostname."
This piece of information is wrong since Windows 2000. Indeed:
* From NT 3.1 to NT 4, one had to change the host's name via the
"Network" control panel applet; the message was accurate back then.
* Since Windows 2000, one changes the computer's host name via the
"Network Identification" (Win2000) / "Computer Name" (WinXP and above)
tab of the "System" properties Control Panel applet.
* In addition, the ony "Network" feature in the Control Panel is the
"Network Connections" special folder and doesn't deal with the host name.
- Use the ConUtils library for uniform output (on console or redirected)
of localized string resources/messages. Supersedes PR #8739.
- Improve output of last-errors by showing their description, only
falling back to showing the error number if no description exists.
Use process-tree Level-Order-Traversal to determine the children
processes to be terminated.
This avoids using recursion to establish the process tree, and also
allows termination in a fashion similar to Windows' taskkill.
The main difference with the latter is that we terminate parent
processes first before terminating their children, instead of doing
the reverse. (This allows avoiding the case where parent processes
respawn their children when they have been terminated.)
[WINESYNC] taskkill: Build with msvcrt.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
wine commit id fb80c1b554eaf07bf2f89fcf2960e39bd0d4787a by Alexandre Julliard <julliard@winehq.org>
[WINESYNC] taskkill: Use wide-char string literals.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
wine commit id 3180972ee2c8e67c425aa7f5279d0cd830455c3d by Michael Stefaniuc <mstefani@winehq.org>
[WINESYNC] taskkill: Use the standard va_list instead of __ms_va_list.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
wine commit id 2c2e75503bea973a3091ea48d431782da656ef8e by Alexandre Julliard <julliard@winehq.org>
[WINESYNC] taskkill: Use OEM code page for output.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
wine commit id 8fdf397505522cc8e41b58cd960899ef7cdf322b by Eric Pouech <eric.pouech@gmail.com>
[WINESYNC] taskkill: Use exit code 1 when terminating processes.
wine commit id fe6294c74346e9956fb839d2a4ca078c624f6bbf by Brendan Shanks <bshanks@codeweavers.com>
[WINESYNC] taskkill: Use CRT allocation functions.
wine commit id dd3f3f381f9e761325c7c06236de1241c9605ed6 by Paul Gofman <pgofman@codeweavers.com>
[WINESYNC] taskkill: Remove unneeded free() before process exit.
wine commit id 20ab5f06d0972440a7df7fb1ba390ab1b32f3b1d by Paul Gofman <pgofman@codeweavers.com>
[WINESYNC] taskkill: Enumerate processes in main().
wine commit id cf4a0b7392f33ba3e0b3fe69007a6d1f327f13f2 by Paul Gofman <pgofman@codeweavers.com>
[WINESYNC] taskkill: Factor out get_task_pid().
wine commit id 62ef3c5be1d2c5374399984588a9daa75663d030 by Paul Gofman <pgofman@codeweavers.com>
[WINESYNC] taskkill: Use toolhelp snapshot to get process information.
wine commit id 6cca1f5099a8354b67578b42dd34fd010e80b6de by Paul Gofman <pgofman@codeweavers.com>
[WINESYNC] taskkill: Mark processes for termination in main().
wine commit id 5c851451892e05c1747108432a5a2bff3a78ed9e by Paul Gofman <pgofman@codeweavers.com>
[WINESYNC] taskkill: Support terminating child processes.
wine commit id fb6b1c91bbf412f5eba260ae52ee38176fd693d4 by Paul Gofman <pgofman@codeweavers.com>
NOTE: This implementation is disabled for ReactOS, and we keep
our own. See the comment block in the code for the reasons why.
+ Adaptations for ReactOS-specific code.
In particular, great care has been taken to keep the `pkill_list`
functionality (read: fix) introduced in PR #2403 (commit 97e7efc020).
The current problem with Wine's code is that if many processes (more
than one) with the same image name are running, then:
taskkill /im theimagename.exe
would only terminate *one* of the corresponding processes, instead of
all processes having this same image name (as on Windows).
The `pkill_list` array contains all the PIDs of these processes. This
replaces the single `pid` initialized by `get_task_pid`.
Co-authored-by: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Re-trial of #7800. Deleting __WINESRC__
hacks.
JIRA issue: CORE-5743
- Add sdk/cmake/set_wine_module.cmake.
- Load set_wine_module.cmake at
top-level CMakeLists.txt.
- Use set_wine_module cmake function
and delete __WINESRC__ as possible.
- Delete many include_directories.
URLs are getting old. We have to
update URLs for documentation
purpose.
JIRA issue: CORE-19963
- Refresh old URLs.
- Add " (DEAD_LINK)" labels
to dead links.
- Use MS Learn links rather
than MSDN ones.
- Some dead links revived by
Web Archive.
- Don't change Wine Tests
and Wine Sync.
- Don't change 3rd party libraries.
- Don't append "redirected" labels.
They are redundant when these are already present in the given module's
root resource file, from which the language-specific resource files are
being included.
- Use _alloca instead of non-standard alloca
- Use _TCHAR instead of non-standard TCHAR
- Use _off_t instead of deprecated off_t
- Use _O_BINARY instead of O_BINARY