Commit Graph

104 Commits

Author SHA1 Message Date
Alexandre Julliard 2b03b2873e ntdll: Free the initial process parameters once they are copied.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-25 21:13:00 +02:00
Gijs Vermeulen 2f2cdc8bb1 ntdll: Don't fail when trying to remove the value of a non-existant variable in RtlSetEnvironmentVariable().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51035
Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-21 22:11:27 +02:00
Alexandre Julliard 7929b21ede ntdll: Define NtCurrentTeb64() on 64-bit to avoid some #ifdefs.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-01 12:25:21 +02:00
Alexandre Julliard 47fed8f5bc ntdll: Don't set the DllPath parameter by default.
Recent Windows versions don't set it either.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-24 20:43:49 +01:00
Alexandre Julliard 28fe84da45 ntdll: Load the main image from the Unix side.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-24 20:43:49 +01:00
Alexandre Julliard 662730a1bf ntdll: Set the Wow64 environment variables from the Unix side.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-24 20:43:48 +01:00
Alexandre Julliard ec5925a8a2 ntdll: Set the additional environment variables from the Unix side.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-23 20:50:50 +01:00
Rémi Bernon f69e5478d5 ntdll: Fix environment memcpy read overflow (valgrind).
Invalid read of size 1
     at 0x7BC5C5E3: memcpy (string.c:109)
     by 0x7BC267F7: RtlCreateProcessParametersEx (env.c:785)
     by 0x7B04EB57: create_process_params (process.c:183)
     by 0x7B04EB57: CreateProcessInternalW (process.c:544)
     by 0x7B0508E3: CreateProcessW (process.c:668)
     by 0x403B1E: runCmd (wineboot.c:1055)
     by 0x403B1E: process_run_key (wineboot.c:1126)
     by 0x404228: ProcessRunKeys (wineboot.c:1159)
     by 0x406DB1: main (wineboot.c:1707)
   Address 0x7ffffe00331a is 0 bytes after a recently re-allocated block of size 12,074 alloc'd
     at 0x7BC2D209: notify_alloc (heap.c:260)
     by 0x7BC2D209: RtlAllocateHeap (heap.c:1713)
     by 0x7BC25BAC: RtlSetEnvironmentVariable (env.c:515)
     by 0x7BC25EE0: set_env_var (env.c:61)
     by 0x7BC26C37: set_wow64_environment (env.c:228)
     by 0x7BC26C37: init_user_process_params (env.c:891)
     by 0x7BC3B01B: process_init (loader.c:3991)
     by 0x7BC3CD24: __wine_set_unix_funcs (loader.c:4095)
     by 0x469604E: start_main_thread (loader.c:1752)
     by 0x469604E: __wine_main (loader.c:2083)
     by 0x7D001231: main (main.c:157)

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-09 21:33:43 +01:00
Alexandre Julliard 0599347e96 ntdll: Launch wineboot from the Unix side.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-04 21:43:26 +01:00
Alexandre Julliard f6e64c55f2 ntdll: Set environment variables from the registry on the Unix side.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-04 21:41:44 +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 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 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
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
Jacek Caban 6bcc1b9225 ntdll: Pass RTL_USER_PROCESS_PARAMETERS to get_initial_console.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-21 19:24:19 +02:00
Chao Long 655ab7a84f ntdll: Fix a ImagePathName memory leak (Valgrind).
Signed-off-by: Chao Long <longchao@uniontech.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-10 21:56:34 +02:00
Alexandre Julliard f8d42a31c6 ntdll: Set a better exit status when the main image fails to load.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49593
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-21 15:23:28 +02:00
Alexandre Julliard 398cfe4807 ntdll: Move some system stub functions to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-17 23:16:51 +02:00
Alexandre Julliard 8a169390c9 ntdll: Build with msvcrt.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-30 12:25:08 +02:00
Alexandre Julliard 15c3eaafbb ntdll: Move retrieving the startup info to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-29 19:51:47 +02:00
Alexandre Julliard b9f531a0e8 ntdll: Move the console handle initialization to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-29 19:51:46 +02:00
Alexandre Julliard 438abad27c ntdll: Set the Wine paths environment variables from the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-24 18:31:09 +02:00
Alexandre Julliard df5e476487 ntdll: Move the current directory initialization to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-17 16:27:24 +02:00
Alexandre Julliard ee5c842e53 ntdll: Move the creation of the initial environment to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-11 15:51:18 +02:00
Alexandre Julliard a240abf12b ntdll: Avoid overflowing the command line buffer.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49314
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-09 21:23:33 +02:00
Alexandre Julliard ca13f489e1 ntdll: Make the windows directory a global variable.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-21 17:06:04 +02:00
Alexandre Julliard e619429035 ntdll: Move configuration paths setup to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-19 12:35:54 +02:00
Alon Barzilai 058f86958c ntdll: Add missing RtlQueryEnvironmentVariable function.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48773
Signed-off-by: Alon Barzilai <alon.barzilai@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-18 19:48:34 +02:00
Alexandre Julliard 45a63e5b3c ntdll: Store main() arguments in the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-17 16:54:39 +02:00
Zebediah Figura e012bd5811 ntdll: Avoid leaking the previous environment in RtlSetCurrentEnvironment().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-07 11:30:11 +02:00
Alexandre Julliard ba1495f7c2 ntdll: Avoid using wine_dll_enum_load_path() from libwine.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-27 12:35:39 +02:00
Alexandre Julliard 3e0c90e4c7 ntdll: Avoid using wine_get_build/data_dir() from libwine.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-27 12:35:19 +02:00
Alexandre Julliard 9122bc1096 ntdll: Avoid using wine_get_user_name() from libwine.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-27 12:34:45 +02:00
Alexandre Julliard e5030a4ac0 ntdll: Avoid using wine_get_config_dir() from libwine.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-27 12:34:07 +02:00
Sven Baars 9ce4383128 ntdll: Fix a string leak in init_user_process_params (Valgrind).
Signed-off-by: Sven Baars <sbaars@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-20 12:49:11 +02:00
Alexandre Julliard 52bf0fbd47 ntdll: Export Unix user name in WINEUSERNAME variable.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-16 22:10:04 +02:00
Alexandre Julliard e003b9884e ntdll: Use wcslen() instead of strlenW().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-31 15:53:53 +02:00
Alexandre Julliard 6de0ab276b ntdll: Use wcschr() instead of strchrW().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-31 15:53:53 +02:00
Alexandre Julliard 80005ee016 ntdll: Use wcscat() instead of strcatW().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-31 15:53:53 +02:00
Alexandre Julliard 18411a19b4 ntdll: Use wcscpy() instead of strcpyW().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-31 15:53:53 +02:00
Alexandre Julliard eb1b2e5486 ntdll: Avoid using sprintfW().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-30 23:10:06 +02:00
Alexandre Julliard 186f189107 ntdll: Avoid using memchrW().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-30 23:10:06 +02:00
Alexandre Julliard 2f7cc584ce ntdll: Use RtlCompareUnicodeStrings() instead of strncmpiW().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-27 21:16:13 +01:00
Alexandre Julliard f831b3bd3d ntdll: Use wcsnicmp() instead of strncmpiW() where possible.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-27 21:16:13 +01:00
Alexandre Julliard 9b01eda7c8 ntdll: Use external codepage tables for the Unix codepage too.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-02-11 09:15:19 +01:00
Zebediah Figura 230a09b707 ntdll: Fix a typo in get_current_directory().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48415
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-01-05 17:34:17 +01:00
Alexandre Julliard 331947c993 kernel32: Move some initialization code to ntdll.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-04 16:03:48 +01:00
Alexandre Julliard f206081241 ntdll: Keep a valid DOS name if the initial current directory is a Unix dir.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48114
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-28 20:45:46 +01:00