Commit Graph

294 Commits

Author SHA1 Message Date
Alexandre Julliard 5b1fc81908 ntdll: Hardcode address space limits for ARM platforms.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-28 21:07:53 +01:00
Alexandre Julliard 075741b681 kernel32: Move image path name initialization to ntdll.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-22 23:04:26 +02:00
Alexandre Julliard 87d9fef2ae ntdll: Take stack guarantee into account when handling stack overflows.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-26 12:04:25 +02:00
Alexandre Julliard 14e34bedbf ntdll: Share dynamic exception table functions across platforms.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-19 13:21:47 +02:00
Rémi Bernon 6672fc9d85 ntdll: Use custom internal zero_bits_64 parameter format.
The zero_bits parameter can be a pointer mask on Win64 and WoW64 and it
was incorrectly truncated to 16bits in APCs. Testing shows that only the
leading zeroes are used in the mask, so we can safely use the 64 based
number of leading zeroes everywhere instead.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-13 12:29:45 +02:00
Rémi Bernon 1aa963efd7 ntdll: Add alloc_type parameter to virtual_map_section and top_down to map_image.
NtMapViewOfSection also accepts the MEM_TOP_DOWN parameter that can
be used in combination with zero_bits to map memory on the highest
possible address.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-13 12:11:02 +02:00
Alexandre Julliard 32fdffac42 include: Implement some inline functions in C instead of assembly.
This way the same code can be used on all platforms.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-26 23:08:53 +02:00
Zebediah Figura 90c3b78bec ntdll: Implement RtlCreateUserStack() and RtlFreeUserStack().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-17 20:50:10 +02:00
Rémi Bernon 00451d5edf ntdll: Clarify NtAllocateVirtualMemory zero_bits parameter semantics.
This parameter was misinterpreted as an alignment parameter for the
lower bits of the allocated memory region, although it is a constraint
on the higher bits.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-13 20:55:35 +02:00
Huw Davies 13e11d3fcb kernel32: Move the implementation of GetTickCount() to kernel32.
Fixes regression caused by 3e927c4aec.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47265
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-30 21:53:27 +02:00
Huw Davies 3e927c4aec ntdll: Extend NtGetTickCount() to return 64-bits. Forward kernel32 functions to it.
Marking the function as DECLSPEC_HOTPATCH to avoid reopening
https://bugs.winehq.org/show_bug.cgi?id=36486 .  Even with -fno-PIC,
without DECLSPEC_HOTPATCH the generated code has a pushl at offset 7
that triggers the failure.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-16 20:54:23 +02:00
Martin Storsjo 044461e8a6 ntdll: Avoid truncating a nonzero exit code to zero in unix.
On Windows, the exit codes can use the full 32 bit range, while
on unix, they are truncated to the lowest 8 bits. If the intended
exit code is nonzero, to indicate failure, but the lower 8 bits
are zero (like when winedbg tries to exit with EXCEPTION_WINE_STUB,
80000100), the observed exit code used to be zero, indicating
successful execution.

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-15 22:04:39 +02:00
Alexandre Julliard d5a372abbb include: Move inline assembly definitions to a new wine/asm.h header.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-14 13:45:07 +02:00
Alexandre Julliard c9bf52502c ntdll: Store offsets instead of pointers in the debug_info structure.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-03 19:28:19 +02:00
Piotr Caban 073bb1d0b4 ntdll: Use NTDLL_tolower instead of toupper.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-26 13:50:22 +01:00
Piotr Caban 3588e5abd4 ntdll: Use _stricmp instead of strcasecmp.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-26 13:50:20 +01:00
Paul Gofman ba42efdb14 ntdll: Pass async parameter to add_fd_completion server call.
Signed-off-by: Paul Gofman <gofmanp@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-21 16:07:07 +01:00
Alexandre Julliard 5ecea50170 ntdll: Make the CPU information global.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-14 19:53:25 +01:00
Alexandre Julliard 9f0d669239 ntdll: Rename attach_dlls() to LdrInitializeThunk().
Based on a patch by Andrew Wesie.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-14 17:57:09 +01:00
Alexandre Julliard a95d7f6c4f ntdll: Recreate the process parameters structure once everything has been initialized.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-13 19:45:24 +01:00
Alexandre Julliard 7a122604ea ntdll: Reimplement init_user_process_params() using RtlCreateProcessParametersEx().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-12 11:31:53 +01:00
Alexandre Julliard e24b16247d ntdll: Pass an NT filename to get_load_order().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-08 22:19:47 +01:00
Zebediah Figura 0ea963a406 ntdll: Call the select request directly in RtlWaitOnAddress().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-04 16:13:10 +01:00
Alexandre Julliard c998667bf0 ntdll: Also return the SECTION_IMAGE_INFORMATION data from RtlCreateUserProcess().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-24 16:58:08 +02:00
Alexandre Julliard 03e05c1f57 ntdll: Implement RtlSetUnhandledExceptionFilter().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-09 14:49:54 +02:00
Alexandre Julliard da60ea1c33 ntdll: Add a wrapper to call the unhandled exception filter.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-09 14:42:30 +02:00
Alexandre Julliard 2cab0ec389 server: Don't return the process exe file to the client.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-24 22:41:30 +02:00
Alexandre Julliard 36371075f8 ntdll: Pass the server context to get/set_thread_context().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-12 14:01:35 +02: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 73d1b89a12 ntdll: Get rid of the vm86 structure in the TEB.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-05 17:16:44 +01:00
Alexandre Julliard 60e6331520 ntdll: Move file mapping functionality to a helper function.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-30 15:10:23 +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 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 7e9f1878db ntdll: Run the thread/process detach code on the thread stack.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-12-14 10:54:56 +01:00
Alexandre Julliard b526a48a24 ntdll: Pass the stack pointer to virtual_clear_thread_stack().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-12-04 15:03:55 +01:00
Alexandre Julliard 23ec3ce2a3 ntdll: Start process execution directly at the kernel32 process entry point.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-12-04 15:03:55 +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 c3dd077d34 ntdll: Run the entire thread initialization code on the thread stack on remaining platforms.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-12-01 19:26:10 +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 6c61ea6a13 ntdll: Suspend a thread with its start context explicitly before attaching dlls.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-30 12:15:51 +01:00
Alexandre Julliard 53e4c36ef8 ntdll: Add a platform-specific helper for starting a thread.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-29 20:15:30 +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 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 51d348c8c2 ntdll: Add helpers to lock the user output buffer during file reads.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-22 15:10:42 +02:00
Alexandre Julliard a20c4e11df ntdll: Add a helper to lock the user output buffer during a server call.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-22 15:10:21 +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 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 3bfd7973a4 ntdll: Don't do partial writes in virtual_uninterrupted_write_memory.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-06 17:31:00 +02:00
Alexandre Julliard ca20bddefc ntdll: Remove support for relay debugging of register functions.
The only remaining ones in krnl386 have been removed.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-26 10:41:27 +02:00
Alexandre Julliard b87c66dd65 ntdll: Move the plaform-independent thread data to the GdiTebBatch TEB field.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-19 19:13:29 +02:00
Alexandre Julliard ce46de5a94 ntdll: Move NtGetContextThread implementation to the platform-specific files.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-18 20:43:32 +02:00
Alexandre Julliard 675e8218f0 ntdll: Move NtSetContextThread implementation to the platform-specific files.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-18 20:43:32 +02:00
Alexandre Julliard fe0924625f ntdll: Add a helper to validate attributes in open calls, and use a common pattern in all calls.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-29 21:25:11 +09:00
Alexandre Julliard 3198fb0c1c ntdll: Add a helper function to allocate the full object_attributes structure.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-16 00:05:57 +09:00
Qian Hong 604c4dba80 ntdll: Correctly document the offset of ntdll_thread_data.
This is a follow up of 16ddc62405.
2015-04-21 14:30:45 +09:00
Sebastian Lackner 6bec132c7a ntdll: Try to handle write-watches while we're on the signal stack. 2015-02-27 14:59:08 +09:00
Hans Leidekker faf70e2fbd ntdll: Fix calculation of process and thread affinity masks on systems with a large number of processors. 2015-01-21 15:31:16 +01:00
Erich E. Hoover ca51e113e4 ntdll: Unify retrieving the attributes of a file. 2014-12-17 19:42:23 +01:00
Sebastian Lackner 34b2d920b4 ntdll: Improve check_atl_thunk to prevent passing exceptions to the usermode application. 2014-10-15 11:52:06 +09:00
Alexandre Julliard e54503f708 ntdll: Allocate TLS data in all running threads on module load. 2013-12-23 18:39:58 +01:00
Frédéric Delanoy 502fc1aef9 ntdll: Use boolean type where appropriate. 2013-12-09 11:45:50 +01:00
Alexandre Julliard f21961cc14 ntdll: Add a configure check for the tcdrain function.
Also remove the tcgetattr check that is no longer used.
2013-09-05 13:18:21 +02:00
Alexandre Julliard fcb3e60332 ntdll: Implement the RunOnce functions. 2013-08-28 22:27:31 +02:00
Alexandre Julliard 5c0b5f4dcb ntdll: Move the select and APC support to server.c. 2013-08-26 20:36:56 +02:00
Alexandre Julliard a56ffb6326 ntdll: Rename NTDLL_wait_for_multiple_objects to server_select since it's more generic now. 2013-08-26 20:36:22 +02:00
Alexandre Julliard 947e337480 server: Make signal and wait a separate select operation. 2013-08-26 20:34:28 +02:00
Alexandre Julliard cbdc0ec72d ntdll: Pass a select operation structure to NTDLL_wait_for_multiple_objects. 2013-08-26 20:32:19 +02:00
Nikolay Sivov 5ce01b3597 ntdll: Implement compatible FindActCtxSectionString() for window class section. 2013-08-02 14:36:12 +02:00
Nikolay Sivov 9e5097187e ntdll: Implement RtlHashUnicodeString(). 2013-07-24 14:35:09 -05:00
Alexandre Julliard cd03a51e7d ntdll: Set the address space limit before running application code. 2013-04-04 13:28:43 +02:00
Alexandre Julliard 99d89b347f ntdll: Add a helper function to check that a fault address lies in a known virtual memory view. 2013-02-12 19:56:19 +01:00
Alexandre Julliard 90e90e3b6a ntdll: Make the page_size variable global. 2013-01-08 16:35:30 +01:00
Alexandre Julliard 62b7069fa9 ntdll: Unwind the stack before calling exit/abort_thread on i386 the same way we do on x86_64. 2011-10-19 16:38:52 +02:00
Alexandre Julliard f4024eaa49 ntdll: Fetch the windows directory from the shared user data. 2011-06-16 12:29:21 +02:00
Marcus Meissner 0f0692716b ntdll: Mark FILE_umask with hidden visibility. 2011-05-27 12:21:39 +02:00
Marcus Meissner 2802d3344d ntdll: Mark internal functions as hidden. 2011-04-25 13:01:52 +02:00
Alexandre Julliard b41cc4865c ntdll: Get rid of support for register entry points on x86_64. 2011-01-27 14:12:41 +01:00
Hans Leidekker 71beac3219 ntdll: Don't call NtClose directly in delete_view. 2010-12-02 12:47:42 +01:00
Alexandre Julliard 177a7e5683 Revert "ntdll: Fix possible deadlock in vectored exception handling."
This reverts commit eb0e82a755.
It's causing different deadlocks, notably when a thread tries to
remove a handler inside a handler.
2010-11-10 19:17:41 +01:00
Krzysztof Nowicki eb0e82a755 ntdll: Fix possible deadlock in vectored exception handling. 2010-10-12 12:30:48 +02:00
Marcus Meissner 2ca5513a62 ntdll: Set correct protection flags on sections in builtin DLLs. 2010-08-24 17:22:32 +02:00
Alexandre Julliard 9055e9e3dd ntdll: Set the heap debug flags based on the GlobalFlag value. 2010-01-22 12:33:03 +01:00
Alexandre Julliard 102dd9e92f winebuild: Rename __wine_call_from_32_regs for consistency with 64-bit. 2010-01-16 15:41:48 +01:00
Alexandre Julliard 574eace36e ntdll: Return a correct name also for file objects in NtQueryObject. 2010-01-08 13:16:57 +01:00
Alexandre Julliard 9c789f4025 ntdll: Add support for the FILE_OPEN_BY_FILE_ID flag in NtCreateFile. 2009-12-03 10:10:06 +01:00
Alexandre Julliard d97149b708 ntdll: Add support for converting file names to Unix when a root directory is specified. 2009-12-01 17:24:26 +01:00
Alexandre Julliard 16ddc62405 ntdll: Merge the thread data and thread regs structure, and make sure i386 regs are not available on other platforms. 2009-11-19 12:27:09 +01:00
Alexandre Julliard d4f1fffacc ntdll: Moved the TEB allocation routines to the platform-specific files. 2009-11-19 12:25:52 +01:00
Alexandre Julliard da1df74147 ntdll: Use the common fill_stat_info function from the directory code too. 2009-11-18 21:58:23 +01:00
Alexandre Julliard 4e77222820 ntdll: Move the window and system dir variables to directory.c 2009-10-22 19:55:06 +02:00
Eric Pouech 57f714f3eb ntdll: Reuse kernel32's cpu info to implement NtQuerySystemInformation(SystemProcessInformation). 2009-09-22 16:51:16 +02:00
Alexandre Julliard 690cf4a6c8 ntdll: Use a more drastic (and simpler) method for unwinding the stack on thread exit. 2009-08-29 16:48:30 +02:00
Alexandre Julliard 8101a2fa1e ntdll: Move the abort_thread() function to the CPU-specific files to allow redefining it. 2009-08-28 11:54:50 +02:00
Alexandre Julliard b46cf438f8 ntdll: Add a ret to DEFINE_REGS_ENTRYPOINT to make copy protections happy. 2009-08-12 17:04:20 +02:00
Alexandre Julliard 12c90b04dc ntdll: Support querying the Wow64 state of other processes. 2009-07-07 11:38:19 +02:00
Alexandre Julliard 747d58d211 ntdll: Add management of the Wow64 filesystem redirection flag. 2009-07-06 15:08:39 +02:00
Alexandre Julliard 6f68b774d7 ntdll: Avoid the close-on-exec race with pipe() on kernels that support pipe2(). 2009-07-01 12:13:34 +02:00
Alexandre Julliard 09712593c8 ntdll: Release some address space after the process initialization is done. 2009-06-25 14:33:34 +02:00