On other platforms, gsbase is set to point to Wine's TEB. So, these functions
can use %gs-relative addressing with the field offsets to access the fields of
the TEB.
On the Mac, gsbase points to internals of the pthread implementation and that
wouldn't work. However, Wine hijacks %gs:0x30 and stores the TEB address there.
So, we access the TEB fields by first loading the TEB address and then
accessing its fields relative to that.
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This fixes several problems with the code:
* The code had been assuming that the argument strings pointed to by the argv
array are contiguous iff certain process-name-setting functions are available.
This doesn't seem reliable. Instead, test if it's true and shift the strings
if so.
However, setproctitle() is specifically documented as a preferred alternative
to the technique of overwriting the arg strings, so don't shift the strings
if that's available.
* Use the last path component, recognizing backslash as a path separator, for
setprogname() in addition to prctl(). First, setprogname() is documented as
searching for the last component itself, but it doesn't understand Windows-
style paths, so we need to help it. Second, on some platforms (e.g. macOS),
setprogname(), like prctl(), has a fairly small internal length limit (e.g.
32 characters). So, concentrate on the most meaningful part of the path.
* Remove argv[0] from argv whether or not there are any process-name-setting
functions available. This is necessary for the proper functioning of Wine,
so it must be done on all platforms. This part of the logic was lost with
commit 5a4576ee0.
* Call all available process-name-setting functions instead of treating them
as mutually exclusive alternatives. This is also logic that was lost with
commit 5a4576ee0.
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Also enable BeingDebugged PEB tests on x86_64.
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
The C library locale is inadequate for conveying the Mac user settings between
LOCALE_Init() and setup_unix_locales(). The set of locales supported by the C
library can't express the combinations allowed in user settings.
Setting LANG to a user-settings-derived locale when there's no corresponding C
library locale is actually worse than leaving it unset. It will prevent the
C library from honoring the LC_* variables (other than LC_ALL). That's why
Terminal.app won't set LANG in that case, it just sets LC_CTYPE=UTF-8. This
commit makes Wine follow similar logic in not setting LANG if the C library
doesn't support the Mac user settings.
Rather, it uses a wrapper around setlocale() to query the locale. That wrapper
returns a value representing the Mac user settings if the C library comes up
empty. It also has logic to handle Terminal's setting LC_CTYPE=UTF-8, since
parse_locale_name() can't handle that properly.
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
می may be correct for LANG_DARI though.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
The (Gregorian) month names are transliterated from French.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
The first day of the week is شنبه, not یکشنبه.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
CP1256 can't represent these, but it's fine in UTF-8.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>