Commit Graph

2553 Commits

Author SHA1 Message Date
Alexandre Julliard 1110eccafb kernel32/tests: Fix a few more loader test failures.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-07-28 21:38:02 +09:00
Ken Thomases 2e636d4fe8 kernel32: For Mac 64-bit, re-enable the inlining of various functions, leveraging the TEB self pointer at %gs:0x30.
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>
2016-07-28 21:38:02 +09:00
Alexandre Julliard ef716e9d1e server: Don't grow the mapped file for read-only mappings.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-07-27 22:21:07 +09:00
Alexandre Julliard 32c7153fdb server: Avoid rounding mapping sizes on the server side.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-07-27 17:03:03 +09:00
Alexandre Julliard 24b49c4775 kernel32/tests: Fix loader test failures on some Windows versions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-07-27 16:09:40 +09:00
Francois Gouget b54a8dda84 kernel32/tests: Remove a trailing space from an ok() call message.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-07-26 23:59:20 +09:00
Alexandre Julliard 6f0979b983 ntdll: Implement the SectionImageInformation class of NtQuerySection.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-07-26 20:33:16 +09:00
Alexandre Julliard 2602df14d8 ntdll: Implement the SectionBasicInformation class of NtQuerySection.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-07-26 20:32:10 +09:00
Alexandre Julliard 4832adf8f9 kernel32/tests: Remove some win9x compatibility cruft.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-07-25 23:15:49 +09:00
Michael Müller 1b26d38095 kernel32: In Win9x mode UnmapViewOfFile requires base address of a mapping.
Signed-off-by: Michael Müller <michael@fds-team.de>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-07-19 22:03:21 +09:00
Michael Müller 1311c8157b ntdll: NtUnmapViewOfSection should succeed for all offsets within the mapped range.
Signed-off-by: Michael Müller <michael@fds-team.de>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-07-19 22:03:21 +09:00
Michael Müller 38d4935007 kernel32/tests: Add tests for UnmapViewOfFile with unaligned pointer.
Signed-off-by: Michael Müller <michael@fds-team.de>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-07-19 22:03:21 +09:00
John Sheu 556fef3dd1 kernel32/tests: Add some tests for fiber-local storage.
Signed-off-by: John Sheu <sheu@google.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-07-19 19:59:30 +09:00
Sebastian Lackner 225498662e kernel32/tests: Use inline implementation of NtCurrentTeb for process tests.
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-07-19 09:52:39 +09:00
Jacek Caban f000189b8a kernel32: Make MapViewOfFile and VirtualAlloc hotpatchable.
Both are patched by Firefox.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-07-18 20:49:05 +09:00
Alexandre Julliard 2f514becdb kernel32: Store synchronization objects under the session directory.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-07-18 16:21:24 +09:00
Dmitry Timoshkov 6870f3c049 kernel32/tests: Add tests for GetThreadSelectorEntry.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-07-15 11:17:06 +09:00
Ken Thomases a73045d6a0 kernel32: Overhaul the handling of argv in set_process_name().
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>
2016-07-15 11:16:11 +09:00
Sebastian Lackner 4e0edaac1f kernel32/tests: Use inline implementation of NtCurrentTeb for debugger tests.
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>
2016-07-15 11:13:15 +09:00
Sebastian Lackner 648cbf63c0 kernel32/tests: Add a test for sorting of InMemoryOrderModuleList.
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-07-07 21:23:26 +09:00
Piotr Caban 4c50ef6995 ntdll: Add RtlRestoreContext implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-07-06 11:49:33 +09:00
Alex Henrie d44ec680da kernel32: Fix memory leak in WCEL_FindPrevInHist.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-07-05 23:22:05 +09:00
Alex Henrie 16c51fbe17 kernel32: Fix memory leak in WCEL_MoveToHist.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-07-05 23:22:05 +09:00
Francois Gouget c8d1fbc6d2 kernel32: Fix typos in a couple of comments.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-07-04 11:01:42 +09:00
Andrey Gusev e1a4265867 kernel32/tests: Fix a typo in skip() message.
Signed-off-by: Andrey Gusev <andrey.goosev@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-06-23 22:49:33 +09:00
André Hentschel fdd953c2aa kernel32/tests: Fix a typo.
Signed-off-by: André Hentschel <nerv@dawncrow.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-06-23 12:04:08 +09:00
Akihiro Sagawa 7a9b36ca11 kernel32: Fix typo of i386 macro name in GetLargePageMinimum().
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-06-20 20:06:38 +09:00
Austin English 7dca3d139c kernel32: Implement GetLargePageMinimum for arm.
Signed-off-by: Austin English <austinenglish@gmail.com>
Signed-off-by: André Hentschel <nerv@dawncrow.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-06-17 22:27:49 +09:00
Austin English 4d313e6475 kernel32: Implement GetLargePageMinimum.
Signed-off-by: Austin English <austinenglish@gmail.com>
Signed-off-by: Marcus Meissner <marcus@jet.franken.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-06-17 00:09:19 +09:00
Ken Thomases d90f29d817 kernel32: Overhaul the locale determination on the Mac.
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>
2016-06-17 00:09:19 +09:00
Alexandre Julliard 73d9e2ebff kernel32: Use RtlCompareUnicodeStrings in CompareStringOrdinal for consistent results.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-06-14 17:09:54 +09:00
Andrey Gusev 2f5d04aaeb kernel32/tests: Fix a typo in ok() messages.
Signed-off-by: Andrey Gusev <andrey.goosev@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-06-03 12:30:57 +09:00
Piotr Caban 4fdfa29e60 kernel32: Use utf8 for filenames encoding if different encoding was not specified on Mac.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-06-01 00:21:47 +09:00
Francois Gouget 6c4484582b kernel32: Spelling fixes.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-05-30 11:57:07 +09:00
Nikolay Sivov 6f30f7dc52 kernel32/tests: Fix a leak in tests (Valgrind).
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-05-30 11:10:30 +09:00
Henri Verbeet 362e6f8614 kernel32/nls: Fix LOCALE_SMONTHNAME5/LOCALE_SABBREVMONTHNAME5 for LANG_PERSIAN.
‎می may be correct for LANG_DARI though.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-05-20 12:52:59 +09:00
Henri Verbeet 9a93d21681 kernel32/nls: Return CAL_GREGORIAN_XLIT_FRENCH for LOCALE_ICALENDARTYPE for LANG_PERSIAN.
The (Gregorian) month names are transliterated from French.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-05-20 12:52:59 +09:00
Henri Verbeet 918089eedf kernel32/nls: Fix LOCALE_IFIRSTDAYOFWEEK for LANG_PERSIAN.
The first day of the week is شنبه, not یک‌شنبه.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-05-20 12:52:59 +09:00
Henri Verbeet 53643d3b60 kernel32/nls: Use Persian punctuation for LANG_PERSIAN.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-05-20 12:52:59 +09:00
Henri Verbeet 39fdd439b3 kernel32/nls: Store LOCALE_SNATIVEDIGITS as UTF-8 in far.nls.
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>
2016-05-20 12:52:59 +09:00
Henri Verbeet 49aacb4784 kernel32/nls: Persian is called Persian in English.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-05-19 21:26:32 +09:00
Henri Verbeet d5620dd54b kernel32/nls: Use ZWNJ where appropriate in far.nls.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-05-19 21:26:29 +09:00
Henri Verbeet e155220931 kernel32/nls: Use Persian characters to write Persian.
For ي and ى there's the excuse that ی doesn't exist in CP1256. There's no such
excuse for using ك instead of ک.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-05-19 21:26:26 +09:00
Henri Verbeet f2af3b9b57 kernel32/nls: Persian uses a right-to-left writing system.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-05-19 21:26:24 +09:00
Akihiro Sagawa 6938fec4ae libport: Fix null character handling when mapping DBCS characters.
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-05-17 16:43:52 +09:00
Akihiro Sagawa cfe015a98c kernel32/tests: Add more partial DBCS character tests that contains a null character.
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-05-17 16:43:49 +09:00
Nikolay Sivov 45edebfb4f kernel32/nls: Fix shortest day names for Thai and Vietnamese.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-05-17 15:53:37 +09:00
Andrey Gusev a7f0dc8c3b kernel32/tests: Fix a typo in comment.
Signed-off-by: Andrey Gusev <andrey.goosev@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-05-17 14:20:10 +09:00
Alexandre Julliard d2fb19d6f7 kernel32/nls: Convert remaining files to UTF-8.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-05-16 15:40:44 +09:00
Nikolay Sivov f79fcdadcb kernel32/nls: Added SSHORTESTDAYNAME* entries.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-05-16 15:34:14 +09:00