try following locations for wineserver directory:
- `${XDG_RUNTIME_DIR}/wine`
- `/run/user/${uid}/wine`
- `${TMPDIR}/wine` - only if `${TMPDIR}` is owned by user
- `${TMPDIR}/.wine-${uid}`
- `/tmp/.wine-${uid}`
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=39013
Signed-off-by: Konstantin Demin <rockdrilla(a)gmail.com>
--
v4: server: Try isolate wineserver directory.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3381
try following locations for wineserver directory:
- `${XDG_RUNTIME_DIR}/wine`
- `/run/user/${uid}/wine`
- `${TMPDIR}/wine` - only if `${TMPDIR}` is owned by user
- `${TMPDIR}/.wine-${uid}`
- `/tmp/.wine-${uid}`
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=39013
Signed-off-by: Konstantin Demin <rockdrilla(a)gmail.com>
--
v3: server: Try isolate wineserver directory.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3381
The read and pread syscalls are permitted to return fewer bytes than requested (unlike the fread libc call which will only perform a short read on error or EOF). This is most likely to occur when binaries are located on slower filesystems (e.g. NFS or 9pfs)
ffab9d9 is a relatively recent regression here, but a lot of the code appears to be much older (e.g. the read call in 341b7dc)
In this MR I've focused on ntdll, but I see a lot of similar mishandling of the pread return value in `server/`. I will raise a bug as I don't intend to create a follow up MR at this time.
--
v2: ntdll: Correctly handle pread short reads
https://gitlab.winehq.org/wine/wine/-/merge_requests/3390
The read and pread syscalls are permitted to return fewer bytes than requested (unlike the fread libc call which will only perform a short read on error or EOF). This is most likely to occur when binaries are located on slower filesystems (e.g. NFS or 9pfs)
ffab9d9 is a relatively recent regression here, but a lot of the code appears to be much older (e.g. the read call in 341b7dc)
In this MR I've focused on ntdll, but I see a lot of similar mishandling of the pread return value in `server/`. I will raise a bug as I don't intend to create a follow up MR at this time.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3390
try following locations for wineserver directory:
- `${XDG_RUNTIME_DIR}/wine`
- `/run/user/${uid}/wine`
- `${TMPDIR}/wine` - only if `${TMPDIR}` is owned by user
- `${TMPDIR}/.wine-${uid}`
- `/tmp/.wine-${uid}`
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=39013
Signed-off-by: Konstantin Demin <rockdrilla(a)gmail.com>
--
v2: server: Avoid wineserver directory race.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3381
On Wed Jul 19 19:55:17 2023 +0000, Davide Beatrici wrote:
> The function declaration. For that reason I believe it's not worth
> removing the comment, as it's only going to increase the amount of
> changes in the commit/MR.
!3380
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3260#note_39797
I suspect the intent of this test was to verify that httpapi really doesn't bind
to that port. That HttpAddUrlToUrlGroup() fails implies this, but paranoia in a
case like this is rarely unwarranted.
However, this test cannot reliably succeed; some other operating system
component may open a TCP port in the meantime, and it appears that on Windows 10
this does in fact happen.
Since the goal of the test is just extra paranoia, I don't think it's worth
keeping.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55127
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3378
@jacek sorry I somehow missed your comment on the other MR
I'm not sure I like the patch as is...
- I wonder if kernelbase.CtrlRoutine should only be called for CUI programs... MSDN doc is as usual imprecise (it speaks about all descendants, and all descendants attached to the same console)
- quick test show that a GUI process isn't killed by GenerateConsoleCtrlEvent
+ tested parent + console, cp_flags=0 and pgid = parent's pgid
+ tested parent + console, cp_flags=detached + new group, pgid = child.id
=> it doesn't fully anwser whether CtrlRoutine is called or not for GUI
- it assumes pgid are inherited for gui (but we don't have proper tests AFAICT)
moreover it means that we'd want two different behaviors when receiving SIGINT (whether it's a genuine unix signal or one sent by the server if we follow the tests result above)
perhaps, the solution would be in the default_ctrl_handler to only terminate the program if attached to a console, or in the program group of a unix console
remark: Wine unix console is the sole case where launching a GUI program from command line doesn't return immediately to prompt (native & builtin cmd implementation only wait on CUI programs completion). But that's conform to unix behavior.
note: I'm not even sure tweeking with setsid whould be useful as anyway the unix console is in raw mode, so only conhost regenerates the signals
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3312#note_39749
CFI directives allow the context stored on the stack by raise_func_trampoline
to be used to unwind to any exception handlers as required when dispatching
an exception. As the dispatcher may change its input context in e.g.
BTCpuResetToConsistentState and these changes also need to be used when
unwinding make sure to pass this copy of the context to
KiUserExceptionDispatcher as opposed to the copy initially stored on the stack,
which is not taken into account when unwinding.
--
v2: ntdll: Avoid storing a second ctx copy in the aarch64 raise trampoline
ntdll: Add aarch64 DWARF register definitions.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3365
What about my suggestion from !3290? Something like the attached [patch](/uploads/86c669e3c725b4f009338e80379552f4/patch.diff) should make it work, but we'd probably need some adjustments to `setsid` heuristics as well.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3312#note_39734
rebased in order to get rid of error of compilation on mac
failure on amstream is still present: looks like a generic issue when exiting gstreamer in 32bit (can repro locally without that MR applied)
@julliard need to do something else?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3312#note_39733
CFI directives allow the context stored on the stack by raise_func_trampoline
to be used to unwind to any exception handlers as required when dispatching
an exception. As the dispatcher may change its input context in e.g.
BTCpuResetToConsistentState and these changes also need to be used when
unwinding make sure to pass this copy of the context to
KiUserExceptionDispatcher as opposed to the copy initially stored on the stack,
which is not taken into account when unwinding.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3365
Windows 10 [received support](https://devblogs.microsoft.com/commandline/af_unix-comes-to-window… for AF_UNIX sockets in Insider Build 17063. This merge request adds basic support for AF_UNIX sockets to ws2_32 and wineserver.
Of particular note is the difficulty in handling `sun_path`. Most of the functions that allow for translating Windows paths to Unix paths are not accessible from ws2_32. I considered the following options:
* Pass the Windows path to wineserver and do the conversion there.
* This is, as far as I can tell, not possible without major rearchitecting. wineserver does not have functions to translate Windows paths to Unix paths, for obvious reasons.
* Obtain the current working directory of the requesting process and temporarily change directories to there.
* This only handles relative paths and fails for absolute paths, UNC paths, etc.
* Conditionally change directories based on whether the path is relative or not.
* This is error-prone and wineserver does not have the requisite functions to do this cleanly.
I ultimately decided to pass the translated Unix path to wineserver, which changes directories to `dirname(path)`. It then provides `bind` and `connect` with `basename(path)`. This is not threadsafe, but wineserver is not (currently) multithreaded.
Abstract sockets are supported by this patch.
--
v45: ws2_32/tests: Add test for AF_UNIX sockets fix.
server: Fix getsockname() and accept() on AF_UNIX sockets.
server: Introduce error when attempting to create a SOCK_DGRAM AF_UNIX socket.
server: Allow for deletion of socket files.
ws2_32: Add support for AF_UNIX sockets.
ntdll/unix: Add support for AF_UNIX sockets to multiple functions.
ws2_32: Add afunix.h header.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2786
`getpeername()` is currently handled in ntdll. This merge request changes ntdll to forward `getpeername()` to wineserver. The implementation utilises new `peer_addr` and `peer_addr_len` fields in wineserver's `struct sock`.
This fixes multiple `todo_wine`s in `ws2_32/tests` and allows for more accurate peer names to be provided in case the address the socket is bound to on the Unix side does not match what `bind()` was called with on the Windows side.
*This merge request was originally intended to be included in !2786 (Add support for AF_UNIX sockets) but was split into its own merge request because this is not an insignificant change.*
--
v22: server: Move getpeername() implementation from ntdll/unix.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3074
This is probably the most ugly and controversial bit of API. I don't really know
if this is the right approach to solving this.
sm4 registers match by register index, such that shaders can mostly be compiled
in isolation. sm1 does not—registers may be specified in any order in the vertex
and pixel shaders, and will be matched by usage and usage index.
By itself this is not much of a problem. Where it gets hairy is that we want to
do some degree of caching, as well as pre-compilation, and avoid recompiling
either shader every time it's matched with a new one.
Wine currently deals with this problem, for GLSL, by generating a "main" GLSL
shader for the vertex shader, and then an extra function setup_vs_output(), and
linking the two together every time a new pixel shader is used. This could in
theory be used for SPIR-V, but it requires the use of extra, probably external,
code to link SPIR-V shaders together, which I do not particularly anticipate
being well-received.
(I'm not sure how Wine deals with this problem in the ARB backend. It seems to
take the pixel shader signature into account when generating the vertex shader—
cf. init_output_registers()—but it doesn't take it into account when looking up
a vertex shader variant? I didn't look too closely at the code, so maybe I'm
missing something.)
--
The vkd3d parts of this patch are quite straightforward, and looking at them, I
think the design is quite intuitive in isolation. There may be some room for
internal refactoring (in particular with an eye to not so much overloading
the "register_index" field of struct shader_signature_element) but I'm
relatively happy with the way it turned out. In isolation, that is.
The Wine part is worse. I've uploaded branches for vkd3d and Wine that use this
API, and correctly handle shaders with some nontrivial reordering:
https://gitlab.winehq.org/zfigura/vkd3d/-/commits/himavant5https://gitlab.winehq.org/zfigura/wine/-/commits/himavant_cb
The test can be run, as before, like so:
make tests/shader_runner.exe && WINE_D3D_CONFIG=renderer=vulkan wine tests/shader_runner.exe ../vkd3d/tests/hlsl/sm1-interstage-interface.shader_test
The interesting Wine parts are concentrated in a single patch, 5cfb9d930f11e.
The patch takes a few shortcuts, partly because I wanted not to block the vkd3d
API design questions, but also because while writing it I came up with a couple
of problems that I wasn't sure how to fix. There are two main problems I see:
(1) This patch has the user pass the signature from the pixel shader when
compiling the vertex shader, and looks up register indices already
arbitrarily allocated by the pixel shader. This is problematic when trying
to use this signature as a cache key, by virtue of it not being clear (or
even defined) which fields are key elements and which aren't. It's also not
particularly kind to lookup, on account of not being directly comparable
with memcmp(). There are a few options I see:
(a) Provide an internal function to compare key elements. This feels... odd,
like a very special-purpose function, but perhaps workable.
(b) Just make the user deal with it, and assert that all fields are key
elements.
(c) Use some alternative, perhaps shortened structure as a field of
vkd3d_shader_next_stage_info. This has the disadvantage that it is not
as simple for a hypothetical user to retrieve from the pixel shader, but
we would presumably provide a function to generate one from a shader
signature. This would probably also be kinder to cache lookup if it's
shorter.
(d) Make caching vkd3d's responsibility, to some degree. This seems
daunting, but the more we optimize, the more difficult it may be to
design API that allows for nice caching.
(2) Assuming we use signatures, there is a memory management problem that
5cfb9d930f11e spells out. This is probably a matter of "just fix it", but
I suppose another option is to take the GLSL or ARB architecture.
--
April is the cruellest month, breeding
Lilacs out of the dead land, mixing
Memory and desire, stirring
Dull roots with spring rain.
--
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/280
On Fri Jul 21 01:25:37 2023 +0000, Henri Verbeet wrote:
> > For the d3d12 and shader runner tests I've been using an environment
> variable to specify the path to DXC, HLSL source declarations in
> d3d12.c, and an `[enable]` directive in shader runner. Are those
> acceptable for upstream?
> It's of course not ideal to depend on DXC/dxcompiler for the DXIL shader
> runner tests like that, but I think we can work with that, yes. There's
> some precedent as well, because we can also use d3dcompiler for running
> shader runner tests.
> In terms of the checksum, the most practical way to make that work in
> the shader runner is probably to introduce a flag like
> "VKD3D_SHADER_PARSE_DXBC_IGNORE_CHECKSUM" for vkd3d_shader_parse_dxbc(),
> then use that to parse the DXBCs produced by Linux DXC, and use
> vkd3d_shader_serialize_dxbc() to create a DXBC blob to pass to
> d3d12/vkd3d. Also, would we need to use DXC, or could we use the
> dxcompiler library?
Using dxcompiler would be preferable, but instead of COM interfaces it uses C++ linking, and when I tried using it a while ago I couldn't get the calling conventions to match up, even if the C declaration was explicitly declared the same convention as the dxcompiler function. It worked if I added a wrapper in a C++ source file, but we probably don't want that. I'll take another look and see if they can be made to match up.
--
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/278#note_39702
It's a clean-room reimplementation that mimics Windows 10 program's output format.
It prints all the information that is available via KerbQueryTicketCacheMessage.
Also tested to work on Windows if dynamically linked + built with winegcc.
For further extension of the functonality, implementing
KerbQueryTicketCacheEx{,2,3}Message is required.
--
v12: klist: Add a program that lists Kerberos tickets.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3347
`wcsncpy` and `GetLocaleInfoEx` take length in number of characters, but `size` and `ret` counts number of bytes.
Previous commit changed a call to `GetLocaleInfoW` which counts lenght in `TCHAR`s (aka bytes), to the current `GetLocaleInfoEx`, which is probably the source of this confusion.
--
v4: msvcrt: Fix out-of-bound access in create_locinfo.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3358
Shader visibility is currently ignored, but we don't want to create Vulkan descriptor sets for CPU heaps.
--
v3: vkd3d: Do not create Vulkan descriptor sets for non-shader-visible heaps.
vkd3d: Return a null handle from GetGPUDescriptorHandleForHeapStart() for non-shader-visible heaps.
tests: Test GetGPUDescriptorHandleForHeapStart() on a non-shader-visible heap.
vkd3d: Enable Vulkan-backed heaps for each heap instead of per device.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/272
Recap:
I implemented relative addressing in !229, but I was suggested to handle register indexes by moving all the registers to the heap, which I did in https://gitlab.winehq.org/fcasas/vkd3d/-/commits/nonconst-offsets-6. A part of this implementation required !269, but I was asked to try to turn the sm4 register structs into the vkd3d-shader register structs instead, to get closer to a common low level IR.
This is the first part of that transformation. The whole thing is in https://gitlab.winehq.org/fcasas/vkd3d/-/commits/use_vkd3d_reg.
This is built on top of !225 (the first two patches), so it may be good to get that upstream first.
---
This patch series aims to do the following replacements:
```
struct sm4_register -> struct vkd3d_shader_register
struct sm4_dst_register -> struct vkd3d_shader_dst_param
struct sm4_src_register -> struct vkd3d_shader_src_param
```
to get us closer to a common level IR and simplify the implementation of relative-addressing.
To achieve this, the fields in the sm4 register structs are replaced with fields in the vkd3d-shader structs or removed altogether, one at the time.
As can be seen when looking at the whole branch, it is possible to do this transformation without having to add additional fields to `struct vkd3d_shader_register`, by restricting each register type to a single `enum vkd3d_sm4_dimension` (and its src registers to a single `enum vkd3d_sm4_swizzle_type`) by default.
The only exception we need so far is for registers sampler registers: They always have dimension NONE, except when used as arguments of gather instructions, in which case they have dimension VEC4 and SCALAR swizzle. This, and similar exceptions we may find in the future, can be handled using the opcode_info, as in 7/8 (81e17506ba2cb1fbf4d021159ab1692af0940d06).
--
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/281
`wcsncpy` and `GetLocaleInfoEx` take length in number of characters, but `size` and `ret` counts number of bytes.
Previous commit changed a call to `GetLocaleInfoW` which counts lenght in `TCHAR`s (aka bytes), to the current `GetLocaleInfoEx`, which is probably the source of this confusion.
--
v2: msvcrt: fix out-of-bound access in create_locinfo
https://gitlab.winehq.org/wine/wine/-/merge_requests/3358
It's a clean-room reimplementation that mimics Windows 10 program's output format.
It prints all the information that is available via KerbQueryTicketCacheMessage.
Also tested to work on Windows if dynamically linked + built with winegcc.
For further extension of the functonality, implementing
KerbQueryTicketCacheEx{,2,3}Message is required.
--
v11: klist: Add a program that lists Kerberos tickets.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3347
It's a clean-room reimplementation that mimics Windows 10 program's output format.
It prints all the information that is available via KerbQueryTicketCacheMessage.
Also tested to work on Windows if dynamically linked + built with winegcc.
For further extension of the functonality, implementing
KerbQueryTicketCacheEx{,2,3}Message is required.
--
v10: klist: Add a program that lists Kerberos tickets.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3347
Shader visibility is currently ignored, but we don't want to create Vulkan descriptor sets for CPU heaps.
--
v2: vkd3d: Do not create Vulkan descriptor sets for non-shader-visible heaps.
vkd3d: Return a null handle from GetGPUDescriptorHandleForHeapStart() for non-shader-visible heaps.
tests: Test GetGPUDescriptorHandleForHeapStart() on a non-shader-visible heap.
vkd3d: Enable Vulkan-backed heaps for each heap instead of per device.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/272
Sufficient for compiling a no-op pixel shader.
This should probably be rebased on top of !263 because it introduces vkd3d_spirv_get_type_id_for_data_type(), which 263 renders unnecessary.
!263 is not essential, but I think using two different type systems in the backend is not ideal.
--
v3: vkd3d-shader/dxil: Emit undefined constants.
vkd3d-shader/spirv: Introduce an undefined register type.
vkd3d-shader/dxil: Emit the shader instructions.
vkd3d-shader/spirv: Do not normalise Shader Model 6 shaders.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/278
Logically the change here is that the parent shell folder resolves
each child path in 'FORPARSING' mode, instead of resolving itself
and doing a bunch more string concatenation for assumed simple child
pidls.
This also removes hacks for change notifications in the delete path
by actually performing notifications for deletion and trash operations
within the shell op.
Background:
I noticed a comment in the ReactOS version which suggested the first
change, it makes sense to not query the children in this way here.
The notifications hack also seemed really off. I'm not sure why the shell
operation wasn't performing these notifications already.
Testing:
All tests pass, and loading up wine explorer was easy to test the deletion.
Items were deleted (or trashed) and the shell folder was notified.
Unfortunately, copy and paste seem very broken at the moment, as the
paste_pidls function only calls ISFHelper_CopyItems with one pidl at a time,
and it itself seems to fail to correctly resolve the from path.
I did some hacking so that it did work correctly if the 'from' folder was the
desktop, and it worked fine with these changes (but those hacks wouldn't pass
review).
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3360
This fixes an issue when the path includes non-ASCII characters.
Signed-off-by: Jactry Zeng <jzeng(a)codeweavers.com>
--
v3: mshtml: Call UrlUnescapeW() with URL_UNESCAPE_AS_UTF8 in is_gecko_path().
shlwapi/tests: Test UrlUnescapeW() with URL_UNESCAPE_AS_UTF8.
kernelbase: Implement URL_UNESCAPE_AS_UTF8 for UrlUnescapeW().
shlwapi/tests: Test UrlUnescapeW() with independent data.
https://gitlab.winehq.org/wine/wine/-/merge_requests/585
`wcsncpy` and `GetLocaleInfoEx` take length in number of characters, but `size` and `ret` counts number of bytes.
Previous commit changed a call to `GetLocaleInfoW` which counts lenght in `TCHAR`s (aka bytes), to the current `GetLocaleInfoEx`, which is probably the source of this confusion.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3358