Commit Graph

4010 Commits

Author SHA1 Message Date
Alexandre Julliard ab9c5625ec ntdll: Print thread id by default in all traces.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-25 11:42:28 +01:00
Hans Leidekker fdc51fc278 ntdll: Fix size returned from RtlMakeSelfRelativeSD on 64-bit.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-24 16:48:02 +01:00
Alexandre Julliard 5e3cf758d1 ntdll: Set the initial process context on ARM.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-21 21:47:42 +01:00
Alexandre Julliard 9e093936e2 ntdll: Use a separate stack when starting new threads.
Based on a patch by Sebastian Lackner.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-21 15:05:50 +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 03993b456c ntdll: Also check for EACCES to detect noexec failures.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-17 12:02:16 +01:00
Alexandre Julliard 2e364d25cc ntdll: Fall back to read() on noexec filesystems also for non-image mappings.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-17 12:02:16 +01:00
Alexandre Julliard 42b79375d3 ntdll: Fall back to read() earlier on noexec filesystems.
This avoid running into problems setting permissions later on.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-16 21:48:44 +01:00
Sebastian Lackner 959d240cbe ntdll: Avoid crash when trying to access page prot of address beyond address space limit.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-16 14:14:01 +01:00
Alexandre Julliard 5996398360 ntdll: Don't change packing of fd cache entries.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-02 19:12:08 +01:00
Alexandre Julliard a5b67f3fdd ntdll: Use WINAPIV calling convention for variadic functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-02 10:16:54 +01:00
Nikolay Sivov 3a3392acc6 ntdll: RtlGetCurrentDirectory_U() returns length, not status.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-10-23 10:33:50 +02:00
Nikolay Sivov 86370cc345 ntdll: Added RtlDosPathNameToNtPathName_U_WithStatus().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-10-23 10:33:44 +02:00
Andrey Gusev 4895156369 ntdll: Remove redundant comparison.
Signed-off-by: Andrey Gusev <andrey.goosev@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-10-12 15:59:24 +02:00
Zebediah Figura 7477792b4c server: FSCTL_PIPE_LISTEN on a pipe client should return STATUS_ILLEGAL_FUNCTION.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-10-10 19:52:36 +02:00
Zebediah Figura cd4dc08b30 ntdll/tests: Don't abort if NtCancelFileIoEx() is missing.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-10-10 19:52:22 +02:00
Jacek Caban f449146ae3 ntdll: Remove no longer needed handling of FD_TYPE_PIPE.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-10-09 19:53:59 +02:00
Jacek Caban 4e17ff7c98 ntdll/tests: Remove no longer needed Sleep calls.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-10-09 19:52:38 +02:00
Huw Davies 2175852f5a ntdll: Add free list buckets for every arena size up to 0x100.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-10-09 19:52:29 +02:00
Alexandre Julliard 49d3cac9ce ntdll: Don't try to unmap system views on the server side.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-10-09 10:45:10 +02:00
Alexandre Julliard 0374d86c57 ntdll: Ignore the preload start address if it is zero.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-10-09 10:45:10 +02:00
Jacek Caban 1e87417e7f ntdll: Always use server ioctl for FSCTL_PIPE_PEEK.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-10-05 19:33:09 +02:00
Louis Lenders 9a53298eed ntdll: Add stub for RtlGetUnloadEventTrace.
Signed-off-by: Louis Lenders <xerox.xerox2000x@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-10-04 22:27:00 +02:00
Jacek Caban 7eb7854161 server: Use server side named pipe implementation in byte mode.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-10-04 21:40:56 +02:00
Alexandre Julliard dc203dd833 ws2_32: Lock the user output buffer during receives.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-10-03 13:38:29 +02:00
Jacek Caban 3f07c6e256 server: Add FileFsDeviceInformation implementation for named pipes.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-10-03 09:41:19 +02:00
Jacek Caban 2ab2f31f18 server: Allow server side NtQueryVolumeInformationFile implementation.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-10-03 09:39:52 +02:00
Akihiro Sagawa f9a5ad1348 ntdll: Treat CIFS/SMB2 file systems as remote devices.
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-10-02 10:14:13 +02:00
Alex Henrie 71e04aaa38 ntdll: Add stub for RtlIpv4StringToAddressW.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-28 11:01:49 +02:00
Michael Müller e0392c3ba8 ntdll: Fix parameters of RtlIpv4StringToAddressExW.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-28 11:01:41 +02:00
Alexandre Julliard a27f187503 ntdll: Support loading binaries that start inside the DOS area.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-27 09:30:05 +02:00
Alexandre Julliard 5fa8713ddc ntdll: No longer store the mapping handle with the view.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-26 17:01:45 +02: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 aa90910e93 server: Implement NtAreMappedFilesTheSame functionality on the server side.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-26 17:01:45 +02:00
Alexandre Julliard 26314a56d3 server: Access the list of committed ranges directly from the mapped view.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-26 17:01:44 +02:00
Alexandre Julliard a557934c76 server: Keep track of mapped memory views.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-26 17:01:44 +02:00
Jacek Caban 4df0162caf ntdll/tests: Test NtQueryVolumeInformationFile calls on named pipe object.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-25 23:29:10 +02:00
Stefan Dösinger bf6025e0e1 ntdll: Do not queue a completion status if pipe ops fail synchronously.
This fixes random crashes when exiting Chromium or shutting down CEF.
It is similar to 7a1142035d, just for pipes.

Signed-off-by: Stefan Dösinger <stefan@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-25 23:29:10 +02: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 af045a52e2 ntdll: Add helper functions for verifying write access to a memory range.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-22 15:05:26 +02:00
Alexandre Julliard 8bc95aa74b ntdll: Handle pages faults without fetching the view pointer when possible.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-22 15:05:26 +02:00
Alexandre Julliard 1049acc28f ntdll: Handle stack faults without fetching the view pointer.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-22 15:05:25 +02:00
Alexandre Julliard 872228da4c ntdll: Remove some unnecessary parameters in helper functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-22 15:05:25 +02:00
Alexandre Julliard 0eefa76791 ntdll: Suspend the process before attaching dlls, using the process initial context.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-19 12:43:00 +02:00
Alexandre Julliard e6f68708c5 ntdll: Set the initial process context on x86_64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-19 12:24:31 +02:00
Alexandre Julliard 8b929bd759 ntdll: Set the initial process context on i386.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-19 12:14:11 +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 bf8e71bcab ntdll: Don't use the mapping handle to detect file mappings.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-13 11:49:19 +02:00
Alexandre Julliard 3f0362ec3c ntdll: Also release memory past the last view in remove_reserved_area.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-13 10:12:14 +02:00
Jonathan Doron fbf2631dcb ntdll: Apply owner and group regardless of the SE_OWNER_DEFAULTED or SE_GROUP_DEFAULTED flags.
Signed-off-by: Jonathan Doron <jond@wizery.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-13 08:41:29 +02:00
Alexandre Julliard b8d0a59a2e ntdll: Get rid of the VPROT_VALLOC flag.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-12 20:32:01 +02:00
Alexandre Julliard 1c8a36a91c ntdll: Pass the mapping file access instead of the protection bits to the server.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-12 20:32:01 +02:00
Alexandre Julliard f448be618b ntdll: Verify page protection against the mapping protections in VirtualAlloc and VirtualProtect.
This partially reverts 3a5ee02735.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-12 20:32:01 +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
Alexandre Julliard 78ab8aa46a ntdll: Trace views once they are properly initialized.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-11 19:51:43 +02:00
Alexandre Julliard 8dc8b3e9c0 ntdll: Avoid accessing builtin views outside of the critical section.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-11 19:50:30 +02:00
Alexandre Julliard 26c59d845e ntdll: Ignore attempts to commit pages in an already committed anonymous mapping.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-08 16:23:15 +02:00
Alexandre Julliard 5073beaefe ntdll: Store the SEC_* section flags directly in the view protection.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-08 16:23:15 +02:00
Alexandre Julliard b2624ab99a ntdll: Remove the no longer used VPROT_NOEXEC flag.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-08 16:23:15 +02:00
Alexandre Julliard 08acac0864 ntdll: Disallow changing PAGE_NOCACHE flag for individual pages.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-08 16:23:15 +02:00
Alexandre Julliard 2967e3efb6 ntdll: Store memory views in a binary tree instead of a list.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-07 19:32:29 +02:00
Alexandre Julliard 917d98a457 ntdll: Use the find_view_range helper function to check for overlapping views.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-07 19:07:32 +02:00
Stefan Dösinger af35aada9b ntdll: Make RtlDeregisterWaitEx(handle, INVALID_HANDLE_VALUE) thread safe.
Chromium signals the wait semaphore and calls DeregisterWaitEx with
CompletionHandle = INVALID_HANDLE_VALUE in close succession. Sometimes
the worker thread decides to run the callback, but before it sets
CallbackInProgress RtlDeregisterWaitEx decides that the callback is not
running and returns STATUS_SUCCESS. Chromium then releases resources
that the callback needs to run, resulting in random crashes.

Signed-off-by: Stefan Dösinger <stefan@codeweavers.com>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-06 20:32:07 +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 a0f64e1231 ntdll: Allocate views out of a memory block instead of using a heap.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-06 10:01:07 +02:00
Alexandre Julliard 2e12f7cdd6 ntdll: Remove the view parameter from the page protection helpers.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-05 16:53:37 +02:00
Alexandre Julliard 3ecf069e45 ntdll: Allocate the per-page protection byte separately from the view.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-05 16:53:37 +02:00
Alexandre Julliard eb5c187254 ntdll: Pass the allocation size to the alloc_virtual_heap function.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-05 16:22:38 +02:00
Alexandre Julliard 4069c4a4d1 ntdll: Add a helper function for applying page protection bytes with mprotect.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-05 16:22:37 +02:00
Alexandre Julliard e4b5e5da8a ntdll: Add a helper function for setting bits in page protection bytes.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-05 16:21:47 +02:00
Alexandre Julliard 727b94842e ntdll: Add helper functions for getting and setting page protection bytes.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-05 16:21:45 +02:00
Alexandre Julliard b31583770f ntdll: Store the PEB lock pointer in the PEB.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-08-31 10:08:01 +02:00
Alistair Leslie-Hughes cb13ee3bf1 ntdll: Use standard wine_dbgstr_longlong.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-08-25 12:47:14 +02:00
Sebastian Lackner dee9eaa248 ntdll: Fix a TRACE in NtGetContextThread.
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-08-12 11:11:55 +09:00
Alistair Leslie-Hughes 3b05f552e2 ntdll/tests: Use standard wine_dbgstr_longlong.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-08-08 20:13:55 +09: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
Alexandre Julliard abe0b1c57b server: Initialize debug registers in new threads if necessary.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-27 17:04:04 +02:00
Alexandre Julliard f680ccb898 ntdll/tests: Test hardware breakpoints in newly created thread.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-26 22:14:00 +02:00
Michael Müller 26f9c73eb0 ntdll/tests: Test debug register values in newly created thread.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-26 22:13:58 +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 bab6ece637 ntdll: Set thread context directly in assembly instead of using generated code.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-26 10:22:05 +02:00
Alexandre Julliard 38d45cbcc8 ntdll: Mark function that are only called from assembly as hidden.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-25 11:48:24 +02:00
André Hentschel 2e9611bbd0 ntdll: Make sure the stack is quad-word aligned on ARM64.
Signed-off-by: André Hentschel <nerv@dawncrow.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-24 20:05:19 +02:00
Alexandre Julliard dc63fbf98d ntdll: Use RtlCaptureContext also in RtlUnwind.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-24 18:58:30 +02:00
Alexandre Julliard 2bb668b1da ntdll: Get some values from the parent stackframe in RtlCaptureContext.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-24 18:58:30 +02:00
Alexandre Julliard 1c49905182 ntdll: Add an assembly wrapper to return correct values for the current thread in NtGetContextThread.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-24 18:58:29 +02:00
Alexandre Julliard 143143ad00 ntdll: Add small assembly wrappers for snooping instead of saving/restoring the entire context.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-20 16:18:45 +02:00
Alexandre Julliard a75e3f734d ntdll: Call NtRaiseException directly from RtlRaiseException on i386.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-20 13:54:43 +02:00
Alexandre Julliard 1522280e68 ntdll: Remove the raise_exception helper function on x86-64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-20 13:30:58 +02:00
Alexandre Julliard ac6244b55a ntdll: Call NtRaiseException directly from RtlRaiseException on x86-64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-20 13:00:10 +02:00
Alexandre Julliard a1b563f41c ntdll: Add support for debug registers in exceptions on x86-64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-19 19:13:30 +02:00
Alexandre Julliard 9e59362ae3 ntdll: Move the plaform-specific thread data to the SystemReserved2 TEB field.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-19 19:13:30 +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 f1ef8a4d9d ntdll: Add platform-specific versions of the thread data structure.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-19 19:13:29 +02:00
Alexandre Julliard fed30058bb ntdll: Don't copy cached debug registers from the parent thread.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-18 20:43:32 +02:00