A Wine user has requested the ability to interact with Unix symlinks from Win32
code.
While the generic functionality of NT reparse points is still not implemented
upstream, it will probably involve a completely different code path than this,
so there does not seem to me to be any point in waiting for that to be done
before submitting these patches.
This does not implement all the relevant functionality. FILE_OPEN_REPARSE_POINT
is now respected, but returns an fd with no fd->unix_fd. Thus far only file
disposition (i.e. deletion), renaming and hardlinking are implemented, and all
other operations return the no_fd_status, for which
STATUS_REPARSE_POINT_NOT_RESOLVED is arbitrarily chosen.
This is probably going to be controversial. As controversial patches tend to get
deferred forever, I'm going to at least try to pose some questions related to
concept and implementation which may be easier to answer.
* Do we want to expose Unix symlinks at all? This was requested by a Wine user,
and it does seem a strong argument that Wine, in general, supports some
measure of integration with the host, including exposing custom interfaces for
programs written to take advantage of it.
We also, currently, already expose Unix *directory* symlinks via
NtQueryAttributesFile(). We don't currently expose such file symlinks (and
this series does not change that particular point, but it would be done by
follow-up patches). In a sense we are expanding existing partial support.
On the other hand, Unix symlinks which are completely opaque can be useful,
and some downstream distributions (CrossOver and Proton) currently rely on
them to reduce disk space usage while keeping the application unaware of a
symlink (even if it were to use FILE_OPEN_REPARSE_POINT. Not that any
applications are currently known that would break if this were to change, and
in any case they could simply revert these patches.)
* Implementation-wise, is having unix_fd == -1 a non-starter? This can be true
of other real fds in some specific cases...
* It's also true that this current implementation suffers from some degree of
TOCTOU problems: because we only store the name and not the FD anymore, the
actual underlying object at that path can change. This would not be true on
Windows. Is this a problem?
* One alternate approach would be to use O_PATH (Linux, FreeBSD) and
O_SYMLINK (Mac). I don't see any equivalent flag for NetBSD or Solaris, so
we would probably just not be able to expose this functionality there.
Note that while the documentation seems to imply that O_PATH only stores the
path, manual testing shows that (at least on Linux) a fd opened with O_PATH
will remain pointing at the same *inode* even if it is moved or deleted. So
this would avoid the aforementioned TOCTOU problem.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8688
--
v3: win32u: Read class name from the shared memory object.
server: Keep a class object locator in the window shared object.
win32u: Use NtUserGetClass(Long|Name)W in needs_ime_window.
server: Write class name to the shared memory object.
server: Create a shared object for window classes.
https://gitlab.winehq.org/wine/wine/-/merge_requests/8850
Salvage tests and fix a leak found in another review: see https://gitlab.winehq.org/wine/wine/-/merge_requests/897#note_9175 points 1 and 2. 3. is why !897 was reverted.
This does not contain the (incorrect) changes to VariantCopyInd, but instead fixes the leak identified in VariantClear (VT_RECORD needs to free pvRecord), and the wrong allocator being used in VariantCopy (it should have been IMalloc, rather than `HeapAlloc`, as shown by the fact IMallocSpy observes these allocations).
This also cleans up some dubious behavior by the test IRecordInfoImpl, which was modifying a VARIANT that it did not own or receive as an argument in the middle of VariantClear. This was likely undefined behavior, and in any case concealed the heap leak.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1035
This has been implemented in a few different ways (see MR !7238 and MR !359), neither of which have associated tests.
This way of doing things sidesteps the need to update existing `VT_BLOB` properties by just storing/retrieving them in the same format we always have. If the registry data doesn't match a set of criteria, we treat it as `VT_BLOB` always.
--
v2: mmdevapi: Add support for storing VT_CLSID properties.
mmdevapi: Add support for storing VT_BOOL properties.
https://gitlab.winehq.org/wine/wine/-/merge_requests/8760
MobaXTerm tries to ShellExecute "/bin/sh" when running under wine. This ability
to run unix executables on the host via unix paths was accidentally removed
in the attemp to align ShellExecute more closely with native, while fixing the
problem that sometimes wrong executable is started by ShellExecute (e.g. in
Motor Race Collection).
Related: a2548c8db3096963012939c82e340f6b867f3efd
Fixes: 85d029e3b01f6dd35a86cc07796af982d66e4a03
--
v4: shell32: Restore the ability of running unix executables via unix paths
https://gitlab.winehq.org/wine/wine/-/merge_requests/8794