Michael Stefaniuc
c5ff8ff27e
kernel32: Use wide-char string literals.
...
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-17 09:52:27 +01:00
Paul Gofman
94f22b56a8
kernel32: Align stack in get_proc_address_wrapper().
...
Fixes crash on start in Nier Automata after switching
kernel32 to PE.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-27 20:26:03 +01:00
Alexandre Julliard
0c631ebb23
kernel32: Build with msvcrt.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-28 19:38:42 +02:00
Alexandre Julliard
98d7f90d1d
kernel32: Get rid of obsolete 16-bit relay functions.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-25 13:44:43 +02:00
Alexandre Julliard
876d7af94e
kernel32: Move the psapi functions to kernelbase.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-06 16:24:24 +02:00
Zebediah Figura
ea753c384e
include: Rename the other In*OrderModuleList fields to In*OrderLinks for consistency.
...
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-24 10:13:49 +02:00
Zebediah Figura
09db718d99
include: Rename BaseAddress to DllBase.
...
To match Microsoft's public definition.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-24 10:13:46 +02:00
Zebediah Figura
feeb1c7c24
include: Rename LDR_MODULE to LDR_DATA_TABLE_ENTRY.
...
This name is used in Microsoft's public winternl.h.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-24 10:13:39 +02:00
Martin Storsjo
fbda8db334
kernel32: Add a special case to EnumProcessModules for the local process.
...
LLVM's libunwind uses EnumProcessModules for locating .eh_frame
sections when unwinding dwarf exceptions (used on i686).
When running wine in docker (without adding custom additional
permissions), EnumProcessModules currently fails as it uses
ReadProcessMemory, which requires the SYS_PTRACE capability.
The current implementation also is slower than necessary (by a
couple orders of magnituide), for accessing the current process.
Currently, unwinding 10000 exception throws with libunwind on i686
takes 24 seconds when run in wine, while it runs in less than 0.1
second with this patch.
Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-04 22:43:01 +01:00
Alexandre Julliard
c5dc41e980
kernel32: Move LoadLibrary functions to kernelbase.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-03 22:58:06 +02:00
Alexandre Julliard
619bd16e7a
kernel32: Move dll path functions to ntdll.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-03 22:56:14 +02:00
Alexandre Julliard
a0a2b25a44
kernel32: Move Get/SetDllDirectory() implementation to ntdll.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-01 15:14:08 +02:00
Alexandre Julliard
14fbecee65
kernel32: Add set_ntstatus() helper.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-01 09:43:27 +02:00
Alexandre Julliard
0f5538b9e3
kernel32: Move delay-load functions to kernelbase.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-26 19:36:10 +02:00
Alexandre Julliard
3ca42e0a97
kernel32: Add .seh annotations for x86_64.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-21 11:52:05 +02:00
Alexandre Julliard
05d00276c6
kernel32: Move some module functions to kernelbase.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-12 12:46:59 +02:00
Alexandre Julliard
0d9d816fc3
kernel32: Fix handling of LOAD_WITH_ALTERED_SEARCH_PATH when other search flags are specified.
...
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46809
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-05 21:40:55 +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
35d202fc09
kernel32: Validate handle before freeing a LOAD_LIBRARY_AS_DATAFILE module.
...
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46019
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-05 22:16:30 +02:00
Michael Stefaniuc
099303c459
kernel32: Remove redundant not 0 check (coccinellery).
...
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-20 23:12:51 +01:00
Alexandre Julliard
c827e3f6af
kernel32: Fix handling of NULL argument in SetDllDirectoryA().
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-05 21:46:29 +01:00
Alexandre Julliard
8b492467d9
kernel32: Move MODULE_get_binary_info implementation to process.c.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-27 13:27:28 +02:00
Alexandre Julliard
1060567cc5
kernel32: Remove the DOS/Win16/OS2 binary distinction.
...
They all need to be run through winevdm.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-25 21:45:04 +02:00
Alexandre Julliard
57512807b9
kernel32: Reimplement GetBinaryTypeW to rely on the server for header parsing.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-25 21:45:04 +02:00
Michael Stefaniuc
fe70e0e58f
kernel32: Use the ARRAY_SIZE() macro.
...
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-14 10:15:59 +02:00
Zebediah Figura
0250693354
kernel32: Allow GetModuleInformation() to succeed on a WoW64 process.
...
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-30 22:26:49 +02:00
Zebediah Figura
54f287d88a
kernel32: Allow GetModuleFileNameEx() to succeed on a WoW64 process.
...
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-30 22:26:49 +02:00
Zebediah Figura
72e3fdf0a2
kernel32: Allow GetModuleBaseName() to succeed on a WoW64 process.
...
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-30 22:26:49 +02:00
Zebediah Figura
54186a4c9f
kernel32: Allow EnumProcessModules() to succeed on a WoW64 process.
...
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-30 22:26:49 +02:00
Alexandre Julliard
e55101715c
kernel32: Implement the LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE flag.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-01 19:25:57 +01:00
Alexandre Julliard
e1d8c176ef
kernel32: Implement the LOAD_LIBRARY_AS_IMAGE_RESOURCE flag.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-01 19:25:57 +01:00
Huw Davies
1e945155f9
kernel32: Save xmm0 - 3 to work around a Delphi bug on x86_64.
...
When delay loading a symbol, Delphi saves rcx, rdx, r8 and r9 to the
stack. It then calls GetProcAddress(), pops the saved registers and
calls the function. This works fine if all of the parameters are
ints. However, since it does not save xmm0 - 3, it relies on
GetProcAddress() preserving these registers if the function takes
floating point parameters.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-07 19:38:29 +01:00
Akihiro Sagawa
844ae22fcf
kernel32: Return the list of module handles even if the last argument is null.
...
Touhou Shinpiroku relies on this behaviour.
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-19 19:46:19 +01:00
Alexandre Julliard
21149e6331
kernel32: Properly detect ELF binaries that are position independent executables.
...
Based on a patch by Sebastian Lackner.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-12-18 11:19:34 +01:00
Martin Payne
e562d4de81
kernel32: Don't report valid non-Win16 NE executables (e.g. OS/2) as broken.
...
Signed-off-by: Martin Payne <development@martinpayne.me.uk>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-12-13 20:14:14 +01:00
Alexandre Julliard
1d49a57e77
kernel32: Also set the preloader range for 64-bit binaries.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-10-23 11:45:25 +02:00
Alexandre Julliard
a8d291c0c0
kernel32: Implement safe search mode for SearchPath.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-08-29 15:51:27 +02:00
Alexandre Julliard
3b399bbbf8
kernel32: Implement LOAD_LIBRARY_SEARCH_* flags.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-08-29 11:30:27 +02:00
Alexandre Julliard
8abbfbbe24
kernel32: Add helper functions for building the load path.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-08-29 09:33:07 +02:00
Alexandre Julliard
12167d2e36
kernel32: Implement AddDllDirectory and RemoveDllDirectory.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-08-29 08:16:52 +02:00
Alexandre Julliard
8d82ab4ae7
kernel32: Add support for LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE flag.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-08-28 14:19:47 +02:00
Alexandre Julliard
e99811aee2
kernel32: Implement SetDefaultDllDirectories.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-08-28 13:29:22 +02:00
Alexandre Julliard
66e302f80b
kernel32: Implement safe dll search mode.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-08-28 12:47:34 +02:00
Michael Müller
bd17022c90
kernel32: Set ERROR_DLL_NOT_FOUND as error code in load_library for Win 9x compatibility.
...
Newer operating systems return ERROR_MOD_NOT_FOUND.
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-03-31 15:57:32 +09:00
Olivier F. R. Dierick
c3f95eddc1
kernel32: Fail gracefully in K32EnumProcessModules with NULL pointer.
2015-07-06 17:09:49 +09:00
Charles Davis
2ace215b9a
kernel32: Recognize 64-bit Mach-O modules, too.
2015-01-23 11:10:57 +01:00
Sebastian Lackner
cacc9ae888
psapi: Implement semi-stub for K32EnumProcessModulesEx.
2014-12-16 17:25:36 +01:00
Alexandre Julliard
ea1689e7b0
kernel32: Add detection of fake dlls when determining a binary type.
2014-08-22 12:44:24 +02:00
Nikolay Sivov
5a8d73283c
ntdll: Fix LdrLockLoaderLock()/LdrUnlockLoaderLock() on 64bit.
2014-06-11 13:05:39 +02:00
Nikolay Sivov
a2bcfa28d4
kernel32: Add more LoadLibraryEx() flags defines and mark them as unsupported.
2013-11-25 15:15:52 +01:00