Commit Graph

78 Commits

Author SHA1 Message Date
Zebediah Figura 97afac469f ntdll: Avoid accessing the I/O status block in wait_async().
Steam uses WSASend() with completion ports, reusing OVERLAPPED structures as
soon as they are returned from GetQueuedCompletionStatus(). Since completion is
queued during the select request in wait_async(), the I/O status block can be
reused even before the call to NtDeviceIoControl exits.

This works fine with current Wine, because WSASend() doesn't access the I/O
status block after queuing completion. However, a patch that changes it to use
wait_async() like other async requests causes NtDeviceIoControlFile to
consistently return garbage status codes.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-24 11:32:28 +02:00
Sven Baars 2d218c924d ntdll: Fix some memory leaks (Valgrind).
Signed-off-by: Sven Baars <sbaars@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-03 20:42:29 +02:00
Alexandre Julliard df1c03a007 ntdll: Fix drive letter of current directory in get_full_path().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51057
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-25 16:38:08 +02:00
Rémi Bernon b3f6f21d01 ntdll: Make sure unix_name is zero terminated (valgrind).
In nt_to_unix_file_name_no_root.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-22 10:30:52 +02:00
Gijs Vermeulen 749f8c25e2 ntdll: Return STATUS_INFO_LENGTH_MISMATCH when len is too small in NtQueryObject(ObjectBasicInformation).
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50791
Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-16 22:39:46 +02:00
Alexandre Julliard 4e6da5942e ntdll: Get rid of the rebuild_nt_name() helper.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-15 17:30:50 +02:00
Alexandre Julliard 7ef35b3393 ntdll: Reimplement file system redirection using NT pathname comparisons.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-15 17:30:50 +02:00
Alexandre Julliard 35cd411547 ntdll: Always pass object attributes to nt_to_unix_file_name().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-14 17:04:35 +02:00
Alexandre Julliard 90024e492d ntdll: Move nt_to_unix_file_name_attr() to avoid forward declarations.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-14 17:04:35 +02:00
Alexandre Julliard 060b28b9ba ntdll: Allow a second backslash after the drive letter.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-14 17:04:35 +02:00
Alexandre Julliard 405666b736 ntdll: Reject NT path names that are not in canonical form.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-13 13:05:29 +02:00
Alexandre Julliard 302d44004e ntdll: Reuse the Unix name buffer for get_dos_device().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-13 13:05:29 +02:00
Alexandre Julliard cdb1f3ae55 ntdll: Cleanup the path with collapse_path() in unix_to_nt_file_name().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-12 19:32:15 +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 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
Rémi Bernon 0eb3258a69 ntdll: Initialize mountmgr_unix_drive before NtDeviceIoControlFile (valgrind).
Syscall param writev(vector[...]) points to uninitialised byte(s)
     at 0x4189DA3: writev (writev.c:26)
     by 0x46A5A1B: send_request (server.c:213)
     by 0x46A5A1B: server_call_unlocked (server.c:273)
     by 0x46CA54F: virtual_locked_server_call (virtual.c:2993)
     by 0x4681C9A: server_ioctl_file (file.c:4789)
     by 0x468B326: NtDeviceIoControlFile (file.c:5620)
     by 0x468B7AF: get_mountmgr_fs_info (file.c:1986)
     by 0x468B7AF: get_mountmgr_fs_info (file.c:1955)
     by 0x468FCBB: NtQueryVolumeInformationFile (file.c:6483)
     by 0x4677E88: __wine_syscall_dispatcher_xsave (in /home/rbernon/Code/build-wine/wine64/dlls/ntdll/ntdll.so)
     by 0x7BC0DEB3: NtQueryVolumeInformationFile (in /home/rbernon/Code/build-wine/wine64/dlls/ntdll/ntdll.dll)
     by 0x7B01F127: GetFileInformationByHandle (file.c:2938)
     by 0x7096A5C3: _fstat64 (file.c:1791)
     by 0x7096A941: _fstat64i32 (file.c:1877)
   Address 0x7ffffe30e520 is in a rw- anonymous segment

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
Roman Pišl dabba3cc86 ntdll: Don't set error status if volume serial number is missing.
Fixes regression from b14eee69c7.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50781
Signed-off-by: Roman Pišl <rpisl@seznam.cz>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-09 21:33:43 +01:00
Alexandre Julliard 16b0994412 ntdll: Make the open_hkcu_key() helper available globally.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-04 10:42:35 +01:00
Alexandre Julliard 285830f5ec ntdll: Add a helper to initialize a UNICODE_STRING on the Unix side.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-04 10:42:34 +01:00
Alexandre Julliard 305cb8af27 ntdll: Initialize the ShowDotFiles option on the Unix side.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-25 16:15:26 +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 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 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
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
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
Erich E. Hoover 773b97bb2b ntdll: Fix converting large 32-bit time_t when time_t is signed.
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-24 22:09:30 +01:00
Damjan Jovanovic 2f90b17ab2 ntdll: Document a few other filesystem case-sensitivity cases.
Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-10 17:19:44 +01:00
Damjan Jovanovic eba4f333b9 ntdll: Treat smbfs as case-insensitive on FreeBSD.
Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-10 17:19:44 +01:00
Damjan Jovanovic 9ba13fbca6 ntdll: Msdosfs was case-insensitive since FreeBSD 8 or even earlier.
Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-10 17:19:44 +01:00
Damjan Jovanovic d1c8611886 ntdll: FAT filesystems are called "msdosfs" on FreeBSD >= 5.
Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-10 17:19:44 +01:00
Damjan Jovanovic 4e6621f3a6 ntdll: Fix wrong return values in get_dir_case_sensitivity_stat().
It should be returning TRUE (= case sensitive) on failure as case
sensitive is the safe assumption, but some returns are FALSE on
failure and even TRUE when case insensitive. Fix that.

Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-10 17:19:44 +01:00
Damjan Jovanovic bf8da00ee0 ntdll: Improve character device type detection on FreeBSD and macOS.
Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-09 20:15:11 +01:00
Joachim Priesner e533a26dcf ntdll: Fix read buffer overflow in find_file_in_dir().
Signed-off-by: Joachim Priesner <joachim.priesner@web.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-22 22:02:03 +02:00
Alexandre Julliard d8f7d54573 ntdll: Add inline wrappers for pthread mutex locking.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-22 11:28:25 +02:00
Alexandre Julliard d18b566995 ntdll: Store the filesystem redirection flag in the 64-bit TEB.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-24 18:26:18 +02:00
Alexandre Julliard 688799b1f7 ntdll: Map errno to a status also in directory functions.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49523
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-21 18:30:08 +02:00
Alexandre Julliard 28bf959c5c ntdll: Move the remaining file functions to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-17 23:16:51 +02:00
Alexandre Julliard 14994715e9 ntdll: Avoid buffer underflow in find_dos_device().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-17 00:04:13 +02:00
Jacek Caban 42cb7d2ad1 ntdll: Silence server_ioctl_file debug traces.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-15 22:57:57 +02:00
Alexandre Julliard 83f9e784e4 ntdll: Use malloc() to allocate temporary filename buffers.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-14 10:33:47 +02:00
Alexandre Julliard e9abe3f739 ntdll: Use malloc() to allocate the directory cache.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-14 10:33:18 +02:00
Alexandre Julliard b2d38f1531 ntdll: Use malloc() to allocate the buffer in get_device_mount_point().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-14 10:33:05 +02:00
Alexandre Julliard 9ec5be2cea ntdll: Use malloc() to allocate the buffer in server_get_unix_name().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-14 10:32:55 +02:00
Alexandre Julliard 1037bf54bf ntdll: Use malloc() to allocate the buffer in nt_to_unix_file_name() and related helpers.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-14 10:32:31 +02:00
Alexandre Julliard ef01f6ac13 ntdll: Use malloc() to allocate the buffer in unix_to_nt_file_name().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-14 10:32:04 +02:00