Commit Graph

5648 Commits

Author SHA1 Message Date
Jacek Caban aae2e2adf0 ntdll: Fix compacted legacy xsave area handling.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-24 22:01:42 +01:00
Jacek Caban 7b95cdffa6 ntdll: Use the right cpuid for XSAVEC detection.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50713
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-24 22:01:42 +01:00
Jacek Caban 014f249aea ntdll: Don't use FeatureSet for XSAVE compaction support flag.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-24 22:01:42 +01:00
Jacek Caban 43900dd621 ntdll: Use syscall frame in x86_64 call_raise_user_exception_dispatcher implementation.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-24 22:01:42 +01:00
Alexandre Julliard 4ef8e946f1 winebuild: Set Thumb bit in CPSR register on syscall entry.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-24 22:01:42 +01:00
Zebediah Figura db0fe33813 ntdll/tests: Avoid passing an uninitialized timeout to NtNotifyChangeKey().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-24 22:01:42 +01:00
Jacek Caban a8856381ed ntdll: Use xsavec in x86_64 syscall dispatcher.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-22 20:19:17 +01:00
Jacek Caban 437bef6ac1 ntdll: Use syscall dispatcher for restoring context in x86_64 NtSetContextThread implementation.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-22 20:19:15 +01:00
Jacek Caban bdf4b3b400 ntdll: Use NtContinue in RtlRestoreContext.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-22 20:19:12 +01:00
Jacek Caban b3dfc903ef ntdll: Use NtContinue in NtRaiseException.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-22 20:19:10 +01:00
Jacek Caban 3ecd43dc6f ntdll: Use syscall frames in x86_64 NtSetContextThread implementation.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-22 20:19:07 +01:00
Jacek Caban 4de079bb72 ntdll: Use syscall frame for x86_64 YMM context in NtGetContextThread.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-19 23:46:30 +01:00
Jacek Caban 11e3d43c26 ntdll: Store x86_64 YMM context in syscall frame.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-19 23:46:30 +01:00
Jacek Caban a0a62463e3 ntdll: Introduce signal_init_syscalls.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-19 23:46:30 +01:00
Alexandre Julliard d89b304eb7 ntdll: Avoid sign conversion warnings in Thumb-2 relocation processing.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-19 23:46:25 +01:00
Alexandre Julliard 3f3f673c29 ntdll: Print the version mismatch error from the Unix side.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-19 22:54:09 +01:00
Alexandre Julliard 37600028fc ntdll: Check the prefer-native flag in the PE header for default load order.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-18 11:11:22 +01:00
Zebediah Figura 33a80885ce ntdll: Fill the object type index in System(Extended)HandleInformation.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-18 10:18:51 +01:00
Zebediah Figura 1f1d4da5f6 ntdll: Fill the handle attributes in System(Extended)HandleInformation.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-18 10:18:39 +01:00
Michael Müller 835f5fff71 ntdll: Implement NtQuerySystemInformation(SystemExtendedHandleInformation).
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-18 10:14:38 +01:00
Akihiro Sagawa d6d99e59e3 ntdll: ObjectName should also be used in NtUnloadKey.
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-17 22:21:13 +01:00
Alexandre Julliard 6f7b56a198 server: Merge the various token information queries.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-17 21:42:18 +01:00
Zebediah Figura 3c677c3f08 ntdll: Implement NtQueryInformationToken(TokenElevation).
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-17 21:42:01 +01:00
Zebediah Figura ec9244f056 ntdll: Implement NtQueryInformationToken(TokenLinkedToken).
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-17 21:41:59 +01:00
Zebediah Figura c96749790b ntdll: Implement NtQueryInformationToken(TokenElevationType).
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-17 16:28:13 +01:00
Jacek Caban be8729c9f5 winebuild: Restore x86_64 FPU context and nonvolatile registers in syscall dispatcher.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-17 15:47:28 +01:00
Jacek Caban b817eb3ec8 ntdll: Use syscall frame for volatile registers in x64_64 NtGetContextThread.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-17 15:45:57 +01:00
Jacek Caban f72940de8e ntdll: Store segment registers in x86_64 syscall frame.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-17 15:45:51 +01:00
Jacek Caban 4e5b61bb06 ntdll: Store stack pointer in x86_64 syscall frame.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-17 15:45:34 +01:00
Jacek Caban accf7a0908 ntdll: Store instruction pointer register in x86_64 syscall frame.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-17 15:45:29 +01:00
Jacek Caban 9bdd02de0c ntdll: Store eflags in x86_64 syscall frame.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-17 15:45:14 +01:00
Jacek Caban 6d2f08cfcb ntdll: Reserve space for all registers in x86_64 syscall frame.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-17 15:45:11 +01:00
Jacek Caban 8f50dde9cd ntdll: Store entire XMM context in x86_64 syscall frame.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-17 11:59:40 +01:00
Alexandre Julliard b772414328 ntdll: Remove no longer used inline function.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-16 23:01:37 +01:00
Alexandre Julliard 58eceff167 ntdll: Don't use wine/server.h from the PE side.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-16 23:01:37 +01:00
Alexandre Julliard c2c57e8dba ntdll: Use the SECTION_IMAGE_INFORMATION bitfields where possible.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-16 21:20:47 +01:00
Alexandre Julliard 584427fc89 server: Avoid redefining the DuplicateHandle() constants.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-16 21:20:47 +01:00
Alexandre Julliard d3df2b12ce server: Remove support for process-local handle tables.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-16 11:13:41 +01:00
Alexandre Julliard e941079126 ntdll: Reimplement local atom tables in user space.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-16 11:01:25 +01:00
Erich E. Hoover 1b48335762 ntdll: Allow NtQueryVolumeInformationFile to make async volume information queries.
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-15 16:09:08 +01:00
Erich E. Hoover 09c67c4809 ntdll: Use st_rdev for special devices in get_mountmgr_fs_info.
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-15 16:07:09 +01:00
Alexandre Julliard 0a6f070f5e ntdll: Also set the dynamic environment strings in the initial parameters.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-15 15:53:14 +01:00
Alexandre Julliard 528f9d3217 ntdll: Set the initial environment and command line in the process parameters on the Unix side.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-15 15:10:52 +01:00
Alexandre Julliard 0d3972ce8a ntdll: Allocate the initial process parameters on the Unix side.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-15 12:30:28 +01:00
Alexandre Julliard 9ce326eea0 server: Store a filename for memory views of .so dlls.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-15 12:24:15 +01:00
Brendan Shanks b79b158d6b ntdll: Always use MAP_FAILED as mmap()'s error value.
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-12 14:41:56 +01:00
Rémi Bernon b922b5aeef kernel32: Write the wait handle before executing the callback.
Otherwise we may execute the callback before the value is actually
returned from RegisterWaitForSingleObject.

Gears Tactics shares a pointer to the returned handle with its callbacks
and calls UnregisterWait from there. This creates a race condition that
sometimes causes a double free.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47843
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-11 22:26:36 +01:00
Rémi Bernon 26ee9134d5 ntdll: Re-implement RtlRegisterWait using TpSetWait.
This adds several internal flags to TP_WAIT object to support the
implementation:

* WT_EXECUTEONLYONCE: waits are re-queued unless it is set.

* WT_EXECUTEINWAITTHREAD: call the callback in the wait thread when set.

* WT_EXECUTEINIOTHREAD: call alertable NtWaitForMultipleObjects in wait
  thread when set, as well the callback in the wait thread, as for
  WT_EXECUTEINWAITTHREAD. The worker threads use non-alertable waits
  otherwise.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47843
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-11 22:26:36 +01:00
Rémi Bernon 304d811924 ntdll: Introduce new tp_object_execute helper.
To execute a threadpool_object callbacks.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47843
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-11 22:26:36 +01:00
Rémi Bernon 3ed3e031ff ntdll: Don't force submit wait in TpSetWait if timeout is 0.
It'll be submitted eventually, no need to force it and it makes support
for WT_EXECUTEINWAITTHREAD flag harder.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47843
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-11 22:26:36 +01:00
Rémi Bernon de6fce48ac ntdll: Move Rtl(Un)RegisterWait code below threadpool structs.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47843
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-11 22:26:36 +01:00
Alexandre Julliard e7fa4fd147 server: Remove the load/unload_dll requests and the dll list.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-11 16:31:30 +01:00
Alexandre Julliard 7c85b365d1 ntdll/tests: Relax a broken result on Windows.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-11 16:31:30 +01:00
Alexandre Julliard 7163c78234 ntdll: Close the debug port on thread exit.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-11 16:31:30 +01:00
Alexandre Julliard 4f2ed66a5f server: Use TEB->ArbitraryUserPointer to store the loaded dll names.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-11 11:49:41 +01:00
Rémi Bernon 6a45c160f4 ntdll/tests: Test RtlRegisterWait with WT_EXECUTEINWAITTHREAD flag.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47843
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-10 20:05:36 +01:00
Rémi Bernon bf846d05ed ntdll/tests: Remove traces from threadpool callbacks.
They seem to cause spurious failures.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47843
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-10 20:05:33 +01:00
Alexandre Julliard 27b9a2c621 ntdll/tests: Add some tests for NtQueryVirtualMemory(MemorySectionName).
Partly based on a patch by Dmitry Timoshkov.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-10 16:30:20 +01:00
Alexandre Julliard 3472387777 server: Implement NtQueryVirtualMemory(MemorySectionName).
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-10 16:30:18 +01:00
David Koolhoven 4f7a4146cd ntdll: Don't try to convert module to 64-bit if it doesn't contain code.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50647
Signed-off-by: David Koolhoven <david@koolhoven-home.net>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-10 09:20:46 +01:00
Alexandre Julliard 3bb5381587 server: Return the NT name for the ProcessImageFileName query.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-09 18:15:03 +01:00
Alexandre Julliard 9e255ba4e0 ntdll: Pass the NT name in the set_fd_name_info request.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-09 13:40:56 +01:00
Alexandre Julliard 76b3284388 ntdll: Pass the NT name in the create_file request.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-09 13:29:57 +01:00
Alexandre Julliard d7bdd5a554 ntdll: Pass the full NT path name to load_builtin_dll().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-09 13:23:17 +01:00
Alexandre Julliard a3c92a02cc server: Get the process entry point from the exe image info.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-08 12:10:49 +01:00
Alexandre Julliard 52d733b5c4 server: Implement retrieving the debug object of a process.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-08 12:09:44 +01:00
Zebediah Figura be98f67f10 ntdll: Check the output buffer length in NtAccessCheck().
Based on a patch by Qian Hong.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-08 11:09:25 +01:00
Zebediah Figura d14cf677b5 ntdll: Do not touch the privilege output buffers if access_check fails.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-08 11:09:23 +01:00
Zebediah Figura bdc10c65ca ntdll: Always return at least sizeof(PRIVILEGE_SET) in NtAccessCheck().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-08 11:09:21 +01:00
Rémi Bernon da3be6b0b6 ntdll: Print a warning or an error for other exceptions.
Depending on EH_NONCONTINUABLE.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-08 11:04:17 +01:00
Rémi Bernon 30ecf517e4 ntdll: Print a warning for debug print exceptions.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-08 11:00:25 +01:00
Rémi Bernon 6edf3d3b09 ntdll: Print a warning for thread rename exceptions.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-08 11:00:20 +01:00
Alexandre Julliard d4156d1da8 ntdll/tests: Add more tests for object types.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-05 22:53:46 +01:00
Alexandre Julliard b6f774df69 server: Add a request to return all object types.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-05 22:53:46 +01:00
Alexandre Julliard 4d646de90d server: Add generic mapping masks for all object types.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-05 15:38:22 +01:00
Sebastian Lackner 43de1407e9 ntdll: Return STATUS_INVALID_DEVICE_REQUEST when trying to call NtReadFile on directory.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-05 15:38:21 +01:00
Alexandre Julliard dc4e881834 server: Add support for object counts in the object type information.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-04 23:11:22 +01:00
Alexandre Julliard 928a22cd02 server: Add a data type for generic access mappings.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-04 21:25:32 +01:00
Alexandre Julliard 85c52b397a ntdll/tests: Fix a couple of test failures on older Windows versions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-04 15:41:02 +01:00
Alexandre Julliard 80898bfee0 ntdll: Fix loading of section table in get_cor_header().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50613
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-04 15:41:02 +01:00
Zebediah Figura db3e08770f ntdll: Map LANG_SERBIAN_NEUTRAL in RtlLocaleNameToLcid().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-04 15:41:02 +01:00
Dmitry Timoshkov 8d7ec7968d ntdll: Exclude large integer APIs from relay tracing.
These builtin functions use stdcall calling convention, but compilers
reference them without stdcall declarations.

Otherwise ucrtbase initialization code crashes with +relay enabled when
compiled with clang as a PE build.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-03 20:57:58 +01:00
Zebediah Figura 690a069918 ntdll: Treat '>' the same as '?' in match_filename().
They differ in strange ways, as the tests show, but the basic behaviour of '>' is similar to '?'.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=22635
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-03 09:15:37 +01:00
Zebediah Figura f2f69a8799 ntdll/tests: Add more tests for RtlDosPathNameToNtPathName_U().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-03 09:14:19 +01:00
Zebediah Figura 32854b7ee3 ntdll/tests: Check the alternate NT path only if it is present.
Makes adding new tests a bit easier...

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-03 09:14:12 +01:00
Alexandre Julliard 451663cfb8 ntdll/tests: Add tests for a few more object types.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-02 13:46:37 +01:00
Alexandre Julliard d514c64a8c server: Move the ldt_copy pointer to the init_first_thread request.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-02 10:26:20 +01:00
Alexandre Julliard 44699c324f server: Add a separate request to initialize the first thread of a process.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-02 10:22:56 +01:00
Alexandre Julliard 123023eac7 server: Fetch the data for the debug events from the process memory views.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-02 10:12:56 +01:00
Alexandre Julliard 72baffdb6d ntdll: Load the main module before the other dlls.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-02 10:12:16 +01:00
Alexandre Julliard 7999af8244 ntdll: Implement NtWaitForDebugEvent().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-01 16:48:09 +01:00
Alexandre Julliard d848a25b76 ntdll: Implement DbgUiConvertStateChangeStructure().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-01 11:39:06 +01:00
Alexandre Julliard c8f5cced47 ntdll: Implement NtDebugContinue().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-01 11:22:23 +01:00
Alexandre Julliard 7bebf7db8c ntdll: Implement NtSetInformationDebugObject().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-01 11:10:06 +01:00
Alexandre Julliard 46b84e7a83 ntdll: Implement NtDebugActiveProcess() and NtRemoveProcessDebug().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-01 11:09:01 +01:00
Alexandre Julliard 11e6f1007c ntdll: Pass a debug object in the new_process request.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-01 11:08:44 +01:00
Alexandre Julliard 964772bc8e ntdll: Support the NtCreateDebugObject() flags.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-29 12:34:46 +01:00
Alexandre Julliard a24e330b20 ntdll: Implement DbgUiConnectToDbg().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-29 10:22:39 +01:00
Alexandre Julliard f7c48da359 ntdll: Implement DbgUiGet/SetThreadDebugObject().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-29 10:22:39 +01:00
Sebastian Lackner 9c29cee638 server: Store and notify all notification events associated with a given registry handle.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-27 21:06:26 +01:00
Zebediah Figura 3c72ad33a9 ntdll/tests: Add more tests for registry notifications.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-27 21:05:01 +01:00
Alexandre Julliard 5ebc20c656 ntdll: Implement NtCreateDebugObject().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-27 11:23:11 +01:00
Alexandre Julliard 5ff2b7d98f server: Get rid of the exe_file parameter in the new_process request.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-26 16:38:56 +01:00
Alexandre Julliard ced3892c65 ntdll: Create a SEC_IMAGE view also for .so builtins.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-26 16:38:56 +01:00
Alexandre Julliard 6b90b96e21 ntdll: Fill the image information data also for .so builtins.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-26 16:38:56 +01:00
Alexandre Julliard dc90fe9a94 ntdll: Set the environment size in the process parameters.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50405
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-26 16:38:52 +01:00
Zebediah Figura 6ebf5ed093 ntdll/tests: Add an alignment helper.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-25 21:08:48 +01:00
Alexandre Julliard 5fef775ddf ntdll: Delay mapping a module until we have found the final one to load.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-23 16:50:35 +01:00
Alexandre Julliard 63b6295368 ntdll: Check for valid architecture before mapping the module.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-23 11:30:55 +01:00
Alexandre Julliard 7203ad0ecd ntdll: Load the COR header directly from the file handle.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-23 11:30:55 +01:00
Jacek Caban fadd22ed5a ntdll/tests: Don't assume 32-bit test module base.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-22 18:33:32 +01:00
Alexandre Julliard 7250f9a95b ntdll: Add some more section information data.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-22 18:33:23 +01:00
Alexandre Julliard e0dbdaac64 ntdll: Support more Dwarf pointer types.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-21 20:46:13 +01:00
Alexandre Julliard fc7c3b51ac ntdll: Always inline NtCurrentTeb() on ARM.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-21 20:46:13 +01:00
Daniel Lehman 6a971e8429 ntdll: Check event type on creation.
Signed-off-by: Daniel Lehman <dlehman25@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-21 20:46:13 +01:00
Nikolay Sivov b78285b9a3 ntdll/tests: Remove skips on missing ntdll.dll.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-20 22:10:50 +01:00
Jacek Caban 46a81fa966 ntdll: Honour alertable argument in NtContinue.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-19 21:44:24 +01:00
Daniel Lehman 37e00a8743 ntdll/tests: Fix error messages for mutant test.
Signed-off-by: Daniel Lehman <dlehman25@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-19 21:44:18 +01:00
Alexandre Julliard 37c24eabc7 ntdll: Support Thumb mode in signal handling.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-19 13:25:18 +01:00
Alexandre Julliard 54cd0e9187 ntdll: Make inline asm compatible with Thumb-2.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-19 13:24:14 +01:00
Daniel Lehman c2daea89c4 ntdll/tests: Add tests for semaphores.
Signed-off-by: Daniel Lehman <dlehman25@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-18 22:46:37 +01:00
Gabriel Ivăncescu 22dba3f0fb ntdll: Do not override existing context's RAX when dispatching user APC on x86_64.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-08 22:02:13 +01:00
Gabriel Ivăncescu 775dac0238 ntdll: Do not override existing context's EAX when dispatching user APC.
Fixes a regression introduced by 175a3649ba,
which caused Winamp's in_wave module to crash when playing a wav file
(the previous behavior only changed EAX when there was no context).

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-08 20:58:30 +01:00
Zebediah Figura 16592ca918 ntdll: Set the process detaching flag before calling FLS callbacks.
So that we will not deadlock trying to acquire fls_section.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-07 21:21:14 +01:00
Rémi Bernon c414f232e6 server: Accept DBG_EXCEPTION_HANDLED parameter in continue_debug_event.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50453
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-06 20:18:50 +01:00
Paul Gofman c181a0ad59 ntdll: Use WINAPI calling convention for stub_entry_point().
Otherwise it ends up being stdcall function in the gcc PE build and
cdecl in ELF while allocate_stub() currently assumes cdecl.

Fixes missing function details output on x64.

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-29 21:08:32 +01:00
Jefferson Carpenter 93c4852620 ntdll/tests: Clear AC flag in align check test.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49771
Signed-off-by: Jefferson Carpenter <jeffersoncarpenter2@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-28 12:27:14 +01:00
Paul Gofman 8b8ddffa21 ntdll: Preserve syscall frame when calling async IO system APC.
The frame can currently be reset from ws2_32.dll async IO callbacks
which are still in the user part and are calling 'syscall' functions.
If the user APC is processed after that during the same call to
server_select(), the call_user_apc_dispatcher() faults.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49782
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-23 22:07:50 +01:00
Paul Gofman 175a3649ba ntdll: Always copy context in call_user_apc_dispatcher() on x86.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-22 21:25:34 +01:00
Martin Storsjo a1955bfb6e ntdll: Implement a no-op __chkstk for arm64.
Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-21 16:55:53 +01:00
Alexandre Julliard cdaa72c728 ntdll: Only reset the Unix current directory on removable devices.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49545
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-18 15:21:37 +01:00
Alexandre Julliard 88a1a6933b ntdll: Pass the correct handle to NtTerminateProcess().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49832
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-17 11:58:47 +01:00
Paul Gofman 71a43335ab ntdll: Save unwind information in KiUserApcDispatcher() on x64.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-17 10:35:46 +01:00
Paul Gofman c72f52d7cc ntdll: Always copy context in call_user_apc_dispatcher() on x64.
Currently, if call_user_apc_dispatcher() is called with nonzero context,
there is no guarantee that the provided context is stored above the
rsp = context_ptr->Rsp - (sizeof(CONTEXT) + offsetof(frame,ret_addr))
being set.

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-17 10:26:52 +01:00
Jacek Caban fcf545f449 winapi: Use __alignof__ on clang.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-16 15:30:07 +01:00
Paul Gofman 0643a4fdce ntdll: Remove unwind registers save space from struct stack_layout on x64.
The unwind space used right below the context's Rsp and can currently
potentially overlap with xstate.

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-16 11:07:07 +01:00
Francois Gouget 84907a9eb1 ntdll/tests: The case-sensitivity tests don't need write access.
This fixes the tests when missing elevated privileges.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-14 17:02:39 +01:00
Francois Gouget cbff1b9540 ntdll/tests: Skip some registry tests when missing elevated privileges.
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-14 17:02:39 +01:00
Alex Henrie 7c61b303eb ntdll: Remove unnecessary call to strlen from get_dos_device.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-11 21:47:15 +01:00
Paul Gofman 0fde203cac ntdll: Don't set xstate in context if xstate features are not supported.
Fixes a regression reproducible on CPUs without XSAVE support introduced
by 419abd49a1.

The regression commit erroneously assumes that if XSAVE is not supported
then the host signal context won't have xsave data set up.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50271
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-11 21:47:15 +01:00
Biswapriyo Nath 2d0fefbc49 ntdll: Add RtlDefaultNpAcl stub.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49900
Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-08 22:25:59 +01:00
Alexandre Julliard 6ddd6e836c ntdll: Support the Android Java %fs register being a GDT selector.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-08 22:25:59 +01:00
Alexandre Julliard 758e75cc46 libwine: Move the Android JNI initialization to ntdll.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-08 22:25:59 +01:00
Alexandre Julliard 99ef6faf76 ntdll: Don't use the main exe path as bindir on Android.
The main exe can be the JVM host process.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-08 12:41:20 +01:00
Paul Gofman 183a8cf380 ntdll: Restore non-volatile registers in call_user_exception_dispatcher() on x86_64.
Required to correctly restore non-volatile registers during unwind.

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-07 22:35:29 +01:00
Paul Gofman c073b1ad40 ntdll/tests: Add a broken result for Win7u in test_extended_context().
Fixes test failures on w7u testbot machines.

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-07 22:35:29 +01:00
Piotr Caban 7d94c4f0e4 ntdll: Fix memchr implementation.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50228
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-04 17:51:07 +01:00
Michael Stefaniuc 636d398c7d ntdll: Use wide-char string literals.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-04 09:37:42 +01:00
Michael Stefaniuc 4da4e98a7a ntdll: Use wide-char string literals in version.c.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-04 09:37:12 +01:00
Michael Stefaniuc 3b4239351a ntdll: Use wide-char string literals in actctx.c.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-04 09:37:00 +01:00