Commit Graph

292 Commits

Author SHA1 Message Date
Alexandre Julliard 8b35892b15 ntdll: Print a diagnostic when mscoree cannot be loaded.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-26 18:47:32 +01:00
Alexandre Julliard 39c8875ff8 ntdll: Add support for running IL-only .NET executables.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-21 09:55:05 +01:00
Alexandre Julliard 12276796c9 ntdll: Hardcode the windows and system directories.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-19 19:38:29 +01:00
Alexandre Julliard a8a74134e8 ntdll: Check for file mappings that cannot be loaded as dlls.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-30 15:10:24 +01:00
Alexandre Julliard 9d911a5736 ntdll: Move suspending a thread on startup back to the platform-specific files.
This partially reverts f64d2688d2.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-22 22:26:46 +01:00
Alexandre Julliard 8a62752fe9 ntdll: Use DWORDs for ARM assembly instructions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-18 19:20:10 +01:00
Alexandre Julliard 6fe15e6c41 ntdll: Round the pthread stack size to a page boundary.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-12-26 10:14:38 +01:00
Alexandre Julliard f64d2688d2 ntdll: Move suspending a thread on startup into attach_dlls().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-12-01 20:32:12 +01:00
Alexandre Julliard 70b69f3e5f ntdll: Don't return from attach_dlls on failure.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-30 19:06:44 +01:00
Alexandre Julliard afb16abc0f ntdll: Add a platform-specific helper for starting a process.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-29 17:18:23 +01:00
Alexandre Julliard f8e0bd1b0d ntdll: Put the initial pthread stack at the end of the Win32 stack.
Create a separate view for it so that the main stack can be freed
independently.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-29 10:44:21 +01:00
Alexandre Julliard 822e142403 ntdll: Support magic \1 prefix in debug format for relay traces.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-25 12:05:40 +01:00
Alexandre Julliard ed893d3591 ntdll: Delay attaching to dlls loaded because of a forwarded entry point.
Based on a patch by Sebastian Lackner.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-21 13:14:16 +01:00
Alexandre Julliard 8477ae27a8 ntdll: Fixup imports in the first thread that runs, even if it's not the main one.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-20 20:24:39 +01:00
Alexandre Julliard ab182dbf06 server: No longer store the mapping object in the dll structure.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-26 17:01:45 +02:00
Alexandre Julliard 8c103f298b ntdll: Add support for setting a platform-specific initial context.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-19 12:10:14 +02:00
Alexandre Julliard 9979c793e8 ntdll: Don't clear the last page of the initial stack.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-19 12:03:09 +02:00
Alexandre Julliard a003f0aed8 ntdll: Store the kernel32 process entry point in a global variable.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-19 11:59:58 +02:00
Alexandre Julliard 94872cc84f ntdll: Fix access rights checks for mapping objects.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-12 20:32:01 +02:00
Martin Storsjo 4eb2c5532d ntdll: Simplify the arm version of a stub function.
Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-08-01 16:28:37 +02:00
Martin Storsjo dd30536044 ntdll: Implement allocate_stub for arm64.
Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-08-01 16:28:14 +02:00
Martin Storsjo 114d8aded7 ntdll: Handle IMAGE_REL_BASED_DIR64 for arm64 in the same way as for x86_64.
Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-07 19:48:32 +02:00
Michael Müller 5a96399b66 ntdll: Implement LdrEnumerateLoadedModules.
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>
2017-05-01 19:29:13 +02:00
Andrew Wesie 06c5a9ab55 ntdll: Read entry point in LdrInitializeThunk.
Overwatch overwrites the PE header contents in a TLS callback. This results in
a crash on wine, because the entry point will be incorrect in start_process.

Signed-off-by: Andrew Wesie <awesie@gmail.com>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-02-09 21:37:08 +01:00
Ken Thomases 3d8efb2388 ntdll: For Mac 64-bit, poke NtCurrentTeb()->ThreadLocalStoragePointer to the corresponding offset from %gs.
64-bit Windows apps have hard-coded accesses to %gs:0x58 baked into them.  They
need to find the ThreadLocalStoragePointer there.

Technically, the gsbase register and the memory it points to belong to the
pthread implementation on macOS.  It's used for the pthread TLS implementation.
Slot 11 (offset 0x58) is currently used for the implementation of the ttyname()
system library function.  We do not anticipate that Wine or any of the system
libraries or frameworks it uses will call ttyname().  Furthermore, Apple has
made it so that future releases of macOS will no longer use that slot.  So, we
hijack it for our purposes.

Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-07-29 12:04:10 +09:00
Michael Müller 77be592845 ntdll: Do not sort InMemoryOrderModuleList by memory address.
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-07 21:23:26 +09:00
Sebastian Lackner b89f88841e ntdll: Skip unused import descriptors when loading libraries.
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-11 12:22:34 +09:00
Jacek Caban 443c2a4719 ntdll: Pass SYNCHRONIZE flag in NtOpenFile and NtCreateFile calls.
This is needed by Office 2013, which hooks those functions and expects
flag to be set.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-09 20:36:17 +09:00
Alex Henrie 48f3bacb0b ntdll: Avoid double initialization.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-22 22:25:39 +09:00
Dmitry Timoshkov beeeb2a528 ntdll: Avoid path buffer re-allocation step for common dll name lengths.
For instance c:\windows\system32\advapi32.dll is 33 characters long with
0-terminator.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-11-10 19:43:11 +09:00
Dmitry Timoshkov 7d2cd2fe61 ntdll: Print process id in the loader log if requested.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
2015-10-01 23:08:13 +09:00
Dmitry Timoshkov 7386de357f ntdll: Do not fail to relocate an image if the size of relocation block is 0. 2015-08-20 14:32:32 +09:00
Dmitry Timoshkov e67a00b466 ntdll: Separate image relocation from NtMapViewOfSection. 2015-08-18 19:56:48 +09:00
Sebastian Lackner 38076fa633 ntdll: Move cookie initialization code from memory management to loader. 2015-08-12 22:58:28 +09:00
Piotr Caban 18d9ca872a ntdll: Fix modules order in InInitializationOrderModuleList. 2015-08-12 22:54:42 +09:00
Dmitry Timoshkov 21c3724813 ntdll: Cache contents of IMAGE_TLS_DIRECTORY instead of saving a directory pointer. 2015-07-15 15:13:16 +09:00
Sebastian Lackner 64ee8a4a53 ntdll: Do not omit mandatory argument for VirtualProtect. 2015-05-04 20:07:58 +09:00
Francois Gouget ca1545cf17 ntdll: Remove unneeded NONAMELESSXXX directives. 2015-03-16 15:04:50 +09:00
Michael Müller 15d013067d ntdll: Wait until builtin dlls are unloaded before releasing the virtual view. 2014-10-07 20:22:15 +02:00
Sebastian Lackner 5272ca241b ntdll: Set ldr.EntryPoint for main executable. 2014-10-07 20:22:13 +02:00
Sebastian Lackner 636dc013cd ntdll: Use call_dll_entry_point to execute TLS callbacks. 2014-09-08 16:03:38 +02:00
Sebastian Lackner b7f77bb1fd ntdll: Save more registers in call_dll_entry_point on i386. 2014-09-08 16:02:17 +02:00
Nikolay Sivov 5a8d73283c ntdll: Fix LdrLockLoaderLock()/LdrUnlockLoaderLock() on 64bit. 2014-06-11 13:05:39 +02:00
Nikolay Sivov 97e2af1f73 ntdll: Implement non-blocking mode for LdrLockLoaderLock(). 2014-05-16 10:52:52 +02:00
Alexandre Julliard 0e42fd97c0 ntdll: Detect 16-bit modules and resolve imports for them. 2014-02-25 16:08:24 -06:00
Alexandre Julliard ff08cd597d ntdll: Only allocate TLS data when resolving imports. 2014-02-17 20:16:08 +01:00
Alexandre Julliard f5fc925f0e ntdll: Move fixup_imports to avoid forward declarations. 2014-02-17 20:15:45 +01:00
Alexandre Julliard 0f0bf58663 ntdll: Don't fixup imports for executables. 2014-02-17 20:15:44 +01:00
Alexandre Julliard 7307298ac3 ntdll: Don't fixup imports when a dll is already loaded. 2014-02-17 20:15:43 +01:00
Martin Storsjo 48ae8f3070 ntdll: Improve handling of THUMB_MOV32 relocations. 2014-01-03 11:27:29 +01:00