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
Alexandre Julliard
70e1f845c7
ntdll: Make the __wine_spec_unimplemented_stub() copy cdecl.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-12 22:38:52 +02:00
Zebediah Figura
07e86d3c9d
ntdll: Try to avoid an unnecessary syscall in fast_release_srw_exclusive().
...
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-11 18:20:31 +02:00
Zebediah Figura
e2411ebecb
ntdll: Add a futex-based implementation of SRW locks.
...
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-11 18:20:24 +02:00
Zebediah Figura
d741296676
ntdll: Remove no longer used interlocked_dec_if_nonzero().
...
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-11 18:19:40 +02:00
Rémi Bernon
8878492d3b
ntdll/tests: Add NtAllocateVirtualMemory tests for zero_bits behavior.
...
The zero_bits parameter doesn't behave as expected, and some 64bit code
use it to allocate memory in the lower 32bit address space.
The expected full behaviour is:
* zero_bits == 0: no constraint on address range
* 0 < zero_bits <= 15: returned address should have as many upper bits
set to 0, starting at bit 31. In 64bit mode,
upper 32bits should all be 0 as well.
* 15 < zero_bits <= 31: unsure, but probably same as zero_bits == 15.
* zero_bits > 31: (64bit/WoW64 only) zero_bits behaves as a bitmask, as
if it was set to the number of leading 0 in the
bitmask, works in the whole 64bit range.
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-11 18:18:49 +02:00
Rémi Bernon
f39c1eee49
ntdll/tests: Move NtAllocateVirtualMemory tests that were in kernel32.
...
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-11 18:18:39 +02:00
Alexandre Julliard
c36b3d3e4a
ntdll: Don't use native subsystem heuristic against builtin modules.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-11 18:15:31 +02:00
Alexandre Julliard
9019c12fac
ntdll: Load the file we got when we can't locate the corresponding builtin.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-05 21:40:55 +02:00
Alexandre Julliard
370abd32d1
ntdll: Add a helper function to load a dll from a .so file.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-05 21:40:55 +02:00
Alexandre Julliard
295f10aa80
ntdll: Add a helper function to find a module from its dlopen handle.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-05 17:26:35 +02:00
Alexandre Julliard
d96fd000d3
ntdll: Fix off-by-one allocation error.
...
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47311
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-03 10:28:29 +02:00
Sven Baars
539ebebc94
ntdll/tests: Fix a string leak (Valgrind).
...
Signed-off-by: Sven Baars <sven.wine@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-31 21:32:26 +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
Alexandre Julliard
60df3b14b5
include: Make the Wine exception handlers cdecl.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-30 15:04:06 +02:00
Alexandre Julliard
1943fb29bf
ntdll: Don't pass DLL_WINE_PREATTACH to the TLS callbacks.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-24 11:25:44 +02:00
Jacek Caban
a55a287cab
server: Always block overlapped device requests until driver dispatches them.
...
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-23 22:18:32 +02:00
Jacek Caban
c09a903bfa
ntdll: Introduce wait_async helper.
...
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-23 22:18:31 +02:00
Alexandre Julliard
b8743f1f0b
ntdll: Set LDR_WINE_INTERNAL flag also for PE builtins.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-20 10:15:17 +02:00
Alexandre Julliard
6c41cc6152
winebuild: Support relay debugging for PE builtin dlls.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-16 22:55:50 +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
Huw Davies
6b47a72e4a
ntdll: Mark monotonic_counter() as inline.
...
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-16 20:54:23 +02:00
Alexandre Julliard
170bd8f361
include: Pass function name directly to the __ASM_STDCALL macro.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-16 19:00:10 +02:00
Alexandre Julliard
10584d2057
include: Use the __fastcall attribute directly for the Windows build.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-16 14:07:15 +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
Hans Leidekker
4872747b27
ntdll: Fix breakpoint exception address on 64-bit Linux.
...
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-15 22:04:39 +02:00
Alexandre Julliard
62fa748f23
include: Define fastcall assembly wrappers globally.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-15 19:59:33 +02:00
Huw Davies
5c8ea25014
ntdll: Use CLOCK_REALTIME_COARSE for NtQuerySystemTime() if it has sufficient resolution.
...
This will only affect users running with HZ=1000. On an i7-8700 CPU @
3.20GHz it cuts the call cost from ~30ns to ~12ns.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-14 20:26:46 +02:00
Huw Davies
aa4570fedd
ntdll: Implement RtlGetSystemTimePrecise().
...
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-14 20:24:45 +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
6fc259a57d
ntdll: Use strncmpiW instead of memicmpW for strings without embedded nulls.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-08 08:34:32 -05:00
Alexandre Julliard
6466a17a8e
ntdll: Reset stdio file descriptors when passed invalid handles.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-07 15:03:58 -05:00
Alexandre Julliard
7c0385bdb4
ntdll: Check for time conversion error to silence a compiler warning.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-30 20:25:11 +02:00
Nikolay Sivov
fe0f8a150f
ntdll: Initialize critical section debug info with correct pointer value.
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-30 20:08:04 +02:00
Nikolay Sivov
9fcb2c8822
ntdll: Account for null terminating char in unload traces (Coverity).
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-30 20:05:27 +02:00
Michael Stefaniuc
21f3bf53dc
ntdll/tests: Avoid the comma operator.
...
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-29 22:23:34 +02:00
Jacek Caban
c448550e74
ntoskrnl.exe/tests: Add more NtOpenThread tests.
...
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-23 23:50:45 +02:00
Alexandre Julliard
70d17d3929
ntdll: Use the correct type for %llu scanf format.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-23 23:50:45 +02:00
Nikolay Sivov
5431409bd3
ntdll: Implement RtlGetUnloadEventTrace()/RtlGetUnloadEventTraceEx().
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-23 23:50:44 +02:00
Nikolay Sivov
91763843b7
ntdll/tests: Add some tests for unloaded modules traces.
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-23 23:50:44 +02:00
Vijay Kiran Kamuju
99ba65a1ea
ntdll: Report system information SystemPerformanceInformation info class.
...
Based on patch from Michael Müller.
Signed-off-by: Vijay Kiran Kamuju <infyquest@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-22 19:48:28 +02:00
André Hentschel
ed968c23d6
ntdll: Reuse signal to trap translation for FreeBSD on ARM.
...
Signed-off-by: André Hentschel <nerv@dawncrow.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-22 19:48:28 +02:00
Alexandre Julliard
948fc85186
ntdll: Add support for loading PE builtin dlls.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-22 11:40:33 +02:00
Alexandre Julliard
ea9cc97e2e
ntdll: Only pass the NT path name to open_dll_file().
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-22 11:36:39 +02:00
Alexandre Julliard
f7cf3c1806
ntdll: Move open_dll_file() to avoid forward declarations.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-22 11:34:55 +02:00
Alexandre Julliard
546fa12755
server: Add flag for builtin dlls in the image information.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-22 11:34:25 +02:00
Nikolay Sivov
19bf03ed4b
ntdll: Add NtSuspendProcess()/NtResumeProcess() implementation.
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-19 12:13:36 +02:00
Louis Lenders
89bfcfc645
ntdll: Add DECLSPEC_HOTPATCH to NtQueryValueKey.
...
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45703
Signed-off-by: Louis Lenders <xerox.xerox2000x@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-19 12:02:58 +02:00
Nikolay Sivov
f9301c2b66
ntdll/tests: Add some tests for thread suspend/resume.
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-15 21:33:07 +02:00
Louis Lenders
3a0ffe5a37
ntdll: Add DECLSPEC_HOTPATCH to NtQueryDirectoryFile.
...
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45703
Signed-off-by: Louis Lenders <xerox.xerox2000x@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-15 12:50:25 +02:00