On Mon May 27 20:51:49 2024 +0000, Nikolay Sivov wrote:
> It's unlikely those device strings need to be constructed in client
> library here, I'd expect those id to come from setupapi
> (DEVPKEY_Device_InstanceId?), if they are not present in mmdevice
> property store already. If application really depends on those
> attributes we could add them here as a temporary solution, but if it
> doesn't, I'd rather prefer a fixme. Device symlink is required for video
> sources I think, but for mmdevapi you'd use an endpoint id.
I didn't find a straightforward way to get it from mmdevapi. No, I don't know that anything (that is, the only app I came through) is using that link (although I think it is possible to create mmdevapi device using that path with, e. g., ActivateAudioInterfaceAsync). I will look a bit more and if no obvious way I will remove this field for now.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5734#note_71444
Nikolay Sivov (@nsivov) commented about dlls/mf/sac.c:
> +static void audio_capture_free_private(void *user_context)
> +{
> + TRACE("%p.\n", user_context);
> +}
> +
> +static const struct activate_funcs audio_capture_activate_funcs =
> +{
> + audio_capture_create_object,
> + audio_capture_shutdown_object,
> + audio_capture_free_private,
> +};
> +
> +HRESULT enum_audio_capture_sources(IMFAttributes *attributes, IMFActivate ***ret_sources, UINT32 *ret_count)
> +{
> + static const WCHAR devinterface_audio_capture_wstr[] = L"{2eef81be-33fa-4800-9670-1cd474972c3f}";
> + static const WCHAR mmdev_path_prefix[] = L"\\\\?\\SWD#MMDEVAPI";
It's unlikely those device strings need to be constructed in client library here, I'd expect those id to come from setupapi (DEVPKEY_Device_InstanceId?), if they are not present in mmdevice property store already. If application really depends on those attributes we could add them here as a temporary solution, but if it doesn't, I'd rather prefer a fixme. Device symlink is required for video sources I think, but for mmdevapi you'd use an endpoint id.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5734#note_71435
On Mon May 27 09:51:12 2024 +0000, Rémi Bernon wrote:
> What about decoupling this from the definition status? Something like `is_imported`?
I'm not sure I see how? If a type is just declared in an import, and defined in the main IDL, then we still want to define it. I don't see how to distinguish those two cases.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5724#note_71433
> I'm sorry but I've wasted enough time on this. I believe I'm still leaving more than enough time to give some feedback, either commenting on the code or even rejecting the changes for whatever reason you might find appropriate.
I'm sorry for not reviewing I find it very difficult to want to review promptly when my review is invariably met with argument, insistence that there is only one correct way to do things, and inability or unwillingness to view things from my perspective. Despite this, I am sorry, and I will try to renew my efforts to review better.
If you wish to have me removed as maintainer of winegstreamer, please propose that directly, rather than abusing GitLab to get your patches committed.
As far as comment on this patch goes, I'm sorry if this is not quite as baked as I'd like it to be, but:
* Renaming "preferred" to "current" is certainly true as far as the functionality of the code is, but it goes against its intent. The point of the "preferred" format is that it should be the one that does not require videoconvert, and therefore offers the best latency. (I know you come at things with a Media Foundation perspective, where the format is pretty much always specified by the application, but for DirectShow it's quite common to plug in a file and autoplug system components up to and including the renderer, so using GStreamer's preferred format is often perfectly feasible.) Hence I would rather see the code fixed so that the "preferred" caps remains what it is, and is not updated.
* From what I've understood, getting rid of wg_format by itself does not save that many LoC. I'm still not convinced that it's a desirable change to make. I've already told you my intentions for wg_format, and despite the fact that you dismissed them as false, claiming it's an ad-hoc struct, I still believe that it's a desirable IR. I'm not convinced that the tradeoffs that you're trying to make are good ones. I'm not convinced they're *not*, either, which is part of why I hadn't said anything yet.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5667#note_71430
On Mon May 27 23:57:31 2024 +0000, Jinoh Kang wrote:
> If you don't want to go through all the hassle, but still want to go "in
> the right direction," please read my first comment.
How's this? I don't think I need to translate the the SID itself
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5721#note_71426
Squad depends on that to properly fill audio capture device list for voice chat and handle capture device name change. The game uses mmdevapi objects for actual capturing so that fully works with this implementation (which is yet missing the actual media source implementation).
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5734#note_71429
On Mon May 27 23:57:31 2024 +0000, Jinoh Kang wrote:
> The `TOKEN_MANDATORY_LABEL` structure pointed by `ptr`, with length
> `len`. This is documented in https://learn.microsoft.com/en-us/windows/win32/api/winnt/ne-winnt-token_in….
> You need to define both `TOKEN_MANDATORY_LEVEL32` (with ULONG in place
> of pointers) and `TOKEB_MANDATORY_LABEL` (with actual pointers).
> Also, don't assume `ptr` is not "used." Maybe *right now,* but ntdll and
> wow64 are still separate components that can get out of sync without tests.
If you don't want to go through all the hassle, but still want to go "in the right direction," please read my first comment.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5721#note_71423
On Mon May 27 23:57:31 2024 +0000, Fabian Maurer wrote:
> @iamahuman There is no parameters used so what should I translate?
The `TOKEN_MANDATORY_LABEL` structure pointed by `ptr`, with length `len`. This is documented in https://learn.microsoft.com/en-us/windows/win32/api/winnt/ne-winnt-token_in….
You need to define both `TOKEN_MANDATORY_LEVEL32` (with ULONG in place of pointers) and `TOKEB_MANDATORY_LABEL` (with actual pointers).
Also, don't assume `ptr` is not "used." Maybe *right now,* but ntdll and wow64 are still separate components that can get out of sync without tests.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5721#note_71422
On Mon May 27 23:57:31 2024 +0000, Jinoh Kang wrote:
> @DarkShadow44 you also have to translate 32bit struct parameter to 64bit
> before passing to native.
@iamahuman There is no parameters used so what should I translate?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5721#note_71421
Rémi Bernon (@rbernon) commented about tools/widl/widltypes.h:
> struct location where;
> unsigned int ignore : 1;
> unsigned int defined : 1;
> + unsigned int defined_in_import : 1;
What about decoupling this from the definition status? Something like `is_imported`?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5724#note_71400
Rémi Bernon (@rbernon) commented about tools/widl/typetree.c:
> error_loc("type %s already defined at %s:%d\n", type->name, type->where.input_name, type->where.first_line );
>
> type->defined = TRUE;
> + init_location(&type->where, NULL, NULL);
It would be better to pass the explicit token location from the parser instead of relying on the implicit global last location.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5724#note_71399
Rémi Bernon (@rbernon) commented about tools/widl/widltypes.h:
>
> struct location where;
>
> - unsigned int declonly : 1;
> + /* Should we define the UDT in this var, when writing a header? */
> + bool define;
This is the first and only use of `bool` in widl. Later, you're also introducing a new `unsigned int :1` field elsewhere.
I think something like `is_definition` is also more appropriate for an object property. Same below.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5724#note_71398
We'll want to keep both copies of `merge_devmode()` in sync, so please combine these two commits into one.
Also, the subject of the commit message seems to have word-wrapped - please keep it as a single line.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5720#note_71393
Nikolay Sivov (@nsivov) commented about dlls/riched20/editor.c:
> }
> case EM_SETPARAFORMAT:
> {
> - BOOL result = editor_set_selection_para_fmt( editor, (PARAFORMAT2 *)lParam );
> + BOOL result;
> + PARAFORMAT2 fmt = *(PARAFORMAT2 *)lParam;
> + fmt.cTabCount = max(0, min(fmt.cTabCount, 32)); /* Clamp between 0 and 32 */
> + result = editor_set_selection_para_fmt(editor, &fmt);
I think this is would be better if done in para_set_fmt(). Instead of 32 please use MAX_TAB_STOPS or ARRAY_SIZE().
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5727#note_71380
I'm sorry but I've wasted enough time on this. I believe I'm still leaving more than enough time to give some feedback, either commenting on the code or even rejecting the changes for whatever reason you might find appropriate.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5667#note_71331
After an earlier rewrite, this flag works with all message types. So this expands its usage to some cases where we were using the `optional` flag for messages that are missing on Wine.
Some of the comments saying Wine is broken for not sending them turned out to be wrong - they're not always sent on Windows either - and in those cases the comments were removed.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5708
I was going to reimplement path resolution in ShellExecute, but half way through I realized that's very unnecessary.
Since what I wanted is a version of `PathResolve` that behaves differently _only_ for filespec paths, I ended up duplicating a lot of code, then I realized I can still pass filespec paths onto `PathResolve` and only deal with non-filespec paths.
--
v2: shell32: Fix ShellExecute for non-filespec paths.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5692
With [`VK_EXT_device_address_binding_report`](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_device_address_binding_report.html) we can get [debug_util](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/ht… callbacks used to track memory bindings. Since it's the host's implementation that starts the callback we have to be sure that we have a way of converting it to the client side's variant before it's added to the handle map - i.e. we don't know the host handle at that time yet.
This is [used by vkd3d-proton](https://github.com/HansKristian-Work/vkd3d-proton/pull/1962). Requires Mesa with https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28649.
before (note the missing BIND for VkDevice which actually means `VkDeviceMemory`):
```
vkd3d-proton % VKD3D_TEST_FILTER=create_placed_resource_size VKD3D_CONFIG=fault VKD3D_DEBUG=trace ~/src/wine/build/wine ./tests/d3d12.exe 2>&1 | grep vkd3d_address_binding_callback
trace:vkd3d-proton:vkd3d_address_binding_callback: BIND || VkBuffer || VA ffff800100200000 || size 0000000001000000.
trace:vkd3d-proton:vkd3d_address_binding_callback: BIND || VkImage || VA ffff800100200000 || size 000000000019a000.
trace:vkd3d-proton:vkd3d_address_binding_callback: UNBIND || VkImage || VA ffff800100200000 || size 000000000019a000.
trace:vkd3d-proton:vkd3d_address_binding_callback: UNBIND || VkBuffer || VA ffff800100200000 || size 0000000001000000.
:trace:vkd3d-proton:vkd3d_address_binding_callback: UNBIND || VkDevice || VA ffff800100200000 || size 0000000001000000.
232285.553:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: BIND || VkBuffer || VA ffff800100200000 || size 0000000001000000.
232285.553:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: UNBIND || VkBuffer || VA ffff800100200000 || size 0000000001000000.
232285.553:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: UNBIND || VkDevice || VA ffff800100200000 || size 0000000001000000.
```
after:
```
% VKD3D_TEST_FILTER=create_placed_resource_size VKD3D_CONFIG=fault VKD3D_DEBUG=trace ~/src/wine/build/wine ./tests/d3d12.exe 2>&1 | grep vkd3d_address_binding_callback
232338.036:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: BIND || VkDevice || VA ffff800100200000 || size 0000000001000000.
232338.036:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: BIND || VkBuffer || VA ffff800100200000 || size 0000000001000000.
232338.037:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: BIND || VkImage || VA ffff800100200000 || size 000000000019a000.
232338.037:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: UNBIND || VkImage || VA ffff800100200000 || size 000000000019a000.
232338.037:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: UNBIND || VkBuffer || VA ffff800100200000 || size 0000000001000000.
232338.037:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: UNBIND || VkDevice || VA ffff800100200000 || size 0000000001000000.
232338.037:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: BIND || VkDevice || VA ffff800100200000 || size 0000000001000000.
232338.037:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: BIND || VkBuffer || VA ffff800100200000 || size 0000000001000000.
232338.037:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: UNBIND || VkBuffer || VA ffff800100200000 || size 0000000001000000.
232338.037:0020:0024:trace:vkd3d-proton:vkd3d_address_binding_callback: UNBIND || VkDevice || VA ffff800100200000 || size 0000000001000000.
```
[The spec guarantees](https://registry.khronos.org/vulkan/specs/1.3-extensions/html/v… the following:
> An application can receive multiple callbacks if multiple VkDebugUtilsMessengerEXT objects are created. A callback will always be executed in the same thread as the originating Vulkan call.
As of TLS I went with a suggestion from IRC:
```
<ivyl_> There's an issue with how we handle callbacks related to VK_EXT_debug_utils and VK_EXT_debug_report. In wine_vkAllocateMemory() we call device->funcs.p_vkAllocateMemory() which may execute callback.
<ivyl_> At this point we still don't have handle mapping added because we don't know what host_memory handle will be.
<ivyl_> AFAIU there's a spec guarantee that callback will be executed in the same thread as the call causing it, so I was thinking about maybe keeping `memory` in a tls (if enable_wrapper_list) and using that?
<ivyl_> but that's I don't see any precedent of using thread local storage on the unix side
<ivyl_> tls value would be short-lived in such case - only for the duration of the call to `device->funcs.p_vkAllocateMemory()`
<jacekc_> we usually use teb on unix side, see ntuser_thread_info
```
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5658
--
v2: ddraw: Use GNU assembly syntax on clang x86_64 MSVC target.
d3d8: Use GNU assembly syntax on clang x86_64 MSVC target.
d3d9: Use GNU assembly syntax on clang x86_64 MSVC target.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5628
--
v4: quartz: Hold the streaming lock while calling ICDecompressEnd.
quartz: Use the correct stride when calculating image size in AVIDec.
quartz: Get output format from source, not sink in AVIDec.
quartz/tests: Use unaligned width in AVIDec tests to expose incorrect stride calculation.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5674
This series of patches introduces a new set of structures and functions that will enable code to be re-used across various functions in d3dx9, and eventually d3dx10-d3dx11. It might be possible to split this further, but I feel like this initial set gives better context as to where things are heading.
I have a [branch](https://gitlab.winehq.org/cmcadams/wine/-/commits/WIP/d3dx-shared-s… that uses these structures and functions in d3dx10 if further context would be useful. There are a lot of changes here, but after playing around with different approaches this was the best/cleanest way I could come up with for code sharing. I'm sure there will be things I missed or potentially ways to improve this, I'm open to suggestions of course. :)
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5666
This is the fourth part in cmd.exe's engine rewrite.
It concerns:
- start of decoupling parsing from execution by introducing
ad hoc structure to hold parsing result to be passed for
execution (done here for redirection, and if conditions),
- refactor execution code with putting into helpers:
+ change of input/output streams
+ save / restore of input/output streams before / after
execution
Note:
- the handling of fd > 2 is clearly wrong, but it just
mimics the current implementation. More work will be
required afterwards (likely using directly CRT low level
I/O),
- I kept a few specific debug channels in place. They will
be removed (or simplified at some point), but they
could be useful to debug remaining issues.
--
v3: programs/cmd: Separate IF command parsing from execution.
programs/cmd: Let errorlevel be a signed integer.
programs/cmd: Create helper to execute a command.
programs/cmd: Introduce structure CMD_REDIRECTION.
programs/cmd: Introduce a helper to set std handles.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5641
This is the fourth part in cmd.exe's engine rewrite.
It concerns:
- start of decoupling parsing from execution by introducing
ad hoc structure to hold parsing result to be passed for
execution (done here for redirection, and if conditions),
- refactor execution code with putting into helpers:
+ change of input/output streams
+ save / restore of input/output streams before / after
execution
Note:
- the handling of fd > 2 is clearly wrong, but it just
mimics the current implementation. More work will be
required afterwards (likely using directly CRT low level
I/O),
- I kept a few specific debug channels in place. They will
be removed (or simplified at some point), but they
could be useful to debug remaining issues.
--
v2: programs/cmd: Separate IF command parsing from execution.
programs/cmd: Create helper to execute a command.
programs/cmd: Introduce structure CMD_REDIRECTION.
programs/cmd: Introduce a helper to set std handles.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5641
I'm not completely sure about the mechanism, but I think it's simple enough to consider having that upstream now. This shows at least how we can leverage win32u surface changes to decide to switch surfaces on/off-screen and fallback to manual blitting.
Having the surfaces on-screen makes sure they are presented as efficiently as possible, having them off-screen we use GDI blit to indirectly call XCopyArea and this will be suboptimal, probably with visible tearing, but hopefully not too common.
--
v3: win32u: Use GDI blit to implement partial or other process presentation.
winex11: Return an offscreen HDC from vulkan_surface_detach.
win32u: Pass a HDC parameter to vulkan_surface_detach.
winex11: Create a window surface even when there is client window.
winex11: Also attach child client windows to their toplevel window.
win32u: Make sure vulkan windows have a pixel format selected.
win32u: Detach vulkan surfaces that aren't fully visible.
win32u: Detach offscreen, child or vulkan surfaces for another process.
win32u: Move vulkan surfaces to their new parent when reparenting.
win32u: Introduce a new vulkan offscreen surfaces list.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5573
This MR updates the Wayland driver keyboard code to emit the appropriate numpad virtual keys (depending on NumLock state) and also translate them to the matching WCHARs.
This is the first step in fixing https://bugs.winehq.org/show_bug.cgi?id=56397. The next step (in an upcoming MR) involves syncing of modifier (and other key) state, so we can deal with cases where the modifiers are set while the application doesn't have the keyboard focus (e.g., before it starts).
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5561
This is the fourth part in cmd.exe's engine rewrite.
It concerns:
- start of decoupling parsing from execution by introducing
ad hoc structure to hold parsing result to be passed for
execution (done here for redirection, and if conditions),
- refactor execution code with putting into helpers:
+ change of input/output streams
+ save / restore of input/output streams before / after
execution
Note:
- the handling of fd > 2 is clearly wrong, but it just
mimics the current implementation. More work will be
required afterwards (likely using directly CRT low level
I/O),
- I kept a few specific debug channels in place. They will
be removed (or simplified at some point), but they
could be useful to debug remaining issues.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5641
This should achieve the same thing as https://github.com/ValveSoftware/wine/commit/e8801e96fedf67b88e6f3f5d9f9e2d…
--
v3: win32u: Enumerate offscreen vulkan devices as GPU devices.
win32u: Query GPU memory from vulkan physical device.
win32u: Match driver GPUs with vulkan GPUS from their ids, or index.
win32u: Keep a list of vulkan GPUS in the device manager context.
win32u: Load the graphics driver vulkan functions lazily.
win32u: Fix default_update_display_devices return type to NTSTATUS.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5616
On Tue May 21 09:53:24 2024 +0000, eric pouech wrote:
> using strtol would be better and save you the str_is_number helper
I can switch to strtol, but how does it save the `str_is_number` helper? It returns 0, which is a valid (if useless) timeout value for the native program.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5691#note_71016
On Tue May 21 12:09:30 2024 +0000, eric pouech wrote:
> I'd rather see this outside the do/while loop (and moreover, the second
> count down shall be printed after this message)
Yes, but it only overrides the "Waiting for %s seconds" part, which mostly matches Windows' behavior (from the cursor position). The only difference is that Windows will end at "Waiting for N". While it's possible to replicate this, I believe it may cause issues with translations.
I can move it outside the do/while loop though.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5691#note_71014
On Tue May 21 10:23:40 2024 +0000, eric pouech wrote:
> why do you need float operations here? (int)(ticks_remaining / 1000)
> should do
It needs to be rounded because otherwise it will start with printing "Waiting for N-1 seconds" due to one or more ticks having elapsed (at least on my machine). But yes, I could do an int roundup instead (`(ticks_remaining + 500) / 1000`).
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5691#note_71013