Please upload the code to the bug and test it. This was an attempt to fix the bug based on observations. There can be issues, with the code.
I dont need you to teach me code, Please don't make it personal.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5771#note_74751
Your pull request effectively make the code worse, as `{ L"Windows.Foundation.UniversalApiContract", 10, },` means `10` or lower.
So `{ L"Windows.Foundation.UniversalApiContract", 7, },` was already included by `{ L"Windows.Foundation.UniversalApiContract", 10, },`
But due to how `is_api_contract_present` work, it only take the first element with a name into consideration.
This is a simplified pseudo code with comments of `is_api_contract_present` to show the loop stop at first name match:
```java
boolean is_api_contract_present(String name,int version) {
for (present_contract : present_contracts) // List though all entries
if (present_contract.name == name)) // Check is name is equal
return version <= present_contract.max_major; // Check if version is lower than max_major, and return
return false; // No match found, return that we didn't found anything
}
```
Note: the `return` keyword stop code execution, and return the value.
(I'm assuming you didn't understood the code you sent there, as I'm pretty sure if you understood that code before sending it you wouldn't have opened this MR)
Further more, `Windows.Foundation.UniversalApiContract` is a dotnet 5 feature. (Source: https://github.com/madewokherd/wine-mono/issues/151#issuecomment-1232824011)
Wine (and Wine-mono) currently only support up to dotnet 4 on a clean install.
If you want I can teach you code for free so you can actually read and understand the code before you are sending it to wine upstream.
In the meantime I'll see what I can do to try to get the issue fixed.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5771#note_74750
This MR adds support for creating file mapping objects backed by large pages on Linux, by making the following changes:
## wineserver
* On Linux, `create_temp_file` will first attempt to use memfds as the backing fd. If it fails, it'll return to the current codepath, creating a temporary file in either the server or config directory.
* The created memfd will be sealed against writes, if the caller requesting the appropriate page protection flags.
* This removes the requirement that FDs be only created on filesystems/directories that aren't `noexec`.
* In the server method `create_mapping` , if large pages have been requested by the caller, hold that the calling thread's token holds `SeLockMemoryPrivilege` .
* Additionally, add `SeLockMemoryPrivilege` to the list of privileges enabled for the Administrator.
## `ntdll`
* Add `virtual_get_min_large_page_size` and its exported wrapper `wine_unix_get_min_large_page_size`.
* On Linux, the minimum page size is determined by going through `/sys/kernel/mm/hugepages`. If hugepage support was not detected, `STATUS_NOT_SUPPORTED` is returned instead. On other platforms, the older hard-coded value of 2\*1024\*1024 is returned instead.
* `NtCreateSection` will validate certain parameters if large pages are requested. Specifically, it will return STATUS_INVALID_PARAMETER if the requested mapping is not anonymous/unnamed, or the size is not a multiple of the minimum supported page size.
## `kernelbase`
* `GetLargePageMinimum` will use `wine_unix_get_min_large_page_size`.
## `kernel32/tests`
* Add new test test_large_page_file_mapping, which validates privilege enforcements and parameter validation while creating large pages backed file mapping obejcts. The tests are skipped if `GetLargePageMinimum` returns 0.
--
v31: psapi: Add tests for querying information for large pages.
ntdll: Use PAGEMAP_SCAN ioctl to implement get_working_set_ex, if available.
kernel32: Add tests for large pages support.
ntdll: Support allocating virtual memory, creating and mapping files backed by large/huge pages.
server: Use memfd to back anonymous mappings on Linux.
kernelbase: Implement GetLargePageMinimum by returning the value of LargePageMinimum in _KUSER_SHARED_DATA.
server: Set LargePageMinimum in _KUSER_SHARED_DATA on Linux.
server: Require SeLockMemoryPrivilege to create large page mappings.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5769
This MR adds support for creating file mapping objects backed by large pages on Linux, by making the following changes:
## wineserver
* On Linux, `create_temp_file` will first attempt to use memfds as the backing fd. If it fails, it'll return to the current codepath, creating a temporary file in either the server or config directory.
* The created memfd will be sealed against writes, if the caller requesting the appropriate page protection flags.
* This removes the requirement that FDs be only created on filesystems/directories that aren't `noexec`.
* In the server method `create_mapping` , if large pages have been requested by the caller, hold that the calling thread's token holds `SeLockMemoryPrivilege` .
* Additionally, add `SeLockMemoryPrivilege` to the list of privileges enabled for the Administrator.
## `ntdll`
* Add `virtual_get_min_large_page_size` and its exported wrapper `wine_unix_get_min_large_page_size`.
* On Linux, the minimum page size is determined by going through `/sys/kernel/mm/hugepages`. If hugepage support was not detected, `STATUS_NOT_SUPPORTED` is returned instead. On other platforms, the older hard-coded value of 2\*1024\*1024 is returned instead.
* `NtCreateSection` will validate certain parameters if large pages are requested. Specifically, it will return STATUS_INVALID_PARAMETER if the requested mapping is not anonymous/unnamed, or the size is not a multiple of the minimum supported page size.
## `kernelbase`
* `GetLargePageMinimum` will use `wine_unix_get_min_large_page_size`.
## `kernel32/tests`
* Add new test test_large_page_file_mapping, which validates privilege enforcements and parameter validation while creating large pages backed file mapping obejcts. The tests are skipped if `GetLargePageMinimum` returns 0.
--
v30: psapi: Add tests for querying information for large pages.
ntdll: Use PAGEMAP_SCAN ioctl to implement get_working_set_ex, if available.
kernel32: Add tests for large pages support.
ntdll: Support allocating virtual memory, creating and mapping files backed by large/huge pages.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5769
This MR adds support for creating file mapping objects backed by large pages on Linux, by making the following changes:
## wineserver
* On Linux, `create_temp_file` will first attempt to use memfds as the backing fd. If it fails, it'll return to the current codepath, creating a temporary file in either the server or config directory.
* The created memfd will be sealed against writes, if the caller requesting the appropriate page protection flags.
* This removes the requirement that FDs be only created on filesystems/directories that aren't `noexec`.
* In the server method `create_mapping` , if large pages have been requested by the caller, hold that the calling thread's token holds `SeLockMemoryPrivilege` .
* Additionally, add `SeLockMemoryPrivilege` to the list of privileges enabled for the Administrator.
## `ntdll`
* Add `virtual_get_min_large_page_size` and its exported wrapper `wine_unix_get_min_large_page_size`.
* On Linux, the minimum page size is determined by going through `/sys/kernel/mm/hugepages`. If hugepage support was not detected, `STATUS_NOT_SUPPORTED` is returned instead. On other platforms, the older hard-coded value of 2\*1024\*1024 is returned instead.
* `NtCreateSection` will validate certain parameters if large pages are requested. Specifically, it will return STATUS_INVALID_PARAMETER if the requested mapping is not anonymous/unnamed, or the size is not a multiple of the minimum supported page size.
## `kernelbase`
* `GetLargePageMinimum` will use `wine_unix_get_min_large_page_size`.
## `kernel32/tests`
* Add new test test_large_page_file_mapping, which validates privilege enforcements and parameter validation while creating large pages backed file mapping obejcts. The tests are skipped if `GetLargePageMinimum` returns 0.
--
v29: psapi: Add tests for querying information for large pages.
ntdll: Use PAGEMAP_SCAN ioctl to implement get_working_set_ex, if available.
kernel32: Add tests for large pages support.
ntdll: Support allocating virtual memory, creating and mapping files backed by large/huge pages.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5769
--
v2: winex11: Remove now unnecessary window surface BITMAPINFO.
winewayland: Remove now unnecessary window surface BITMAPINFO.
wineandroid: Remove now unnecessary window surface BITMAPINFO.
winemac: Remove now unnecessary driver surface BITMAPINFO.
win32u: Get rid of the unnecessary offscreen window surface struct.
win32u: Introduce a new helper to get surface color info and bits.
win32u: Pass BITMAPINFO and color bits to window surface flush.
win32u: Introduce a new helper to update layered window surface attributes.
win32u: Move layered surface attributes to the window_surface struct.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5947
This part XII of cmd engine rewrite.
This serie implements proper support for && and || command chaining operators:
- implement proper precedence parsing
- implement semantics for the operators
- for this to work, we need to have expected success/failure from commands;
this is supported here for external commands (and calling into a label or
another BAT/CMD file), but support has to be added for all builtin
commands
- that's a big mess as behaviors is far from homogeneous among the builtins:
+ some builtin set coherent success/failure vs errorlevel information
+ some report success/failure, but only set errorlevel upon failure
(keeping errorlevel from previous commands untouched),
+ some even report success (even in case of failure) yet set errorlevel
in case of failure,
- so the next series will now concentrate on testing success/failure and
errorlevel for every builtin command (sigh)
- for now, to help the transition phase, we can distinguish if a builtin
properly reports success/failure; if a builtin with success/failure
ability is used in a chaining operator, we implement the intented
behavior of the chaining operator; otherwise,
we keep old behavior (ie always execute LHS and RHS whatever the
success/failure status).
This shall be removed when all builtin commands report success/failure.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5949
This should reflect what we actually support, while still being a superset
of what native drivers actually support.
Native driver support varies, but, as the comments document, native drivers
(at least as of windows 10) support only RGB -> RGB, YUV -> RGB, and BC -> RGB
conversions. The actual formats supported are a more limited subset than exposed
(despite that the video cards should be perfectly capable of supporting more
conversions) but erring on the side of overreporting seems safer.
--
v3: wined3d: Implement wined3d_check_device_format_conversion().
https://gitlab.winehq.org/wine/wine/-/merge_requests/5816
This should reflect what we actually support, while still being a superset
of what native drivers actually support.
Native driver support varies, but, as the comments document, native drivers
(at least as of windows 10) support only RGB -> RGB, YUV -> RGB, and BC -> RGB
conversions. The actual formats supported are a more limited subset than exposed
(despite that the video cards should be perfectly capable of supporting more
conversions) but erring on the side of overreporting seems safer.
--
v2: wined3d: Implement wined3d_check_device_format_conversion().
https://gitlab.winehq.org/wine/wine/-/merge_requests/5816
This MR adds a default implementation for `wglChoosePixelFormatARB` (in opengl32.dll) which will be used automatically if the driver populates the wgl_pixel_format ARB fields. Thus winex11 automatically uses this, and this MR removes the driver internal implementation.
The second part of this MR adds `WGL_ARB_pixel_format` support for winewayland (we can move this to a separate MR, but I wanted to have another implementation to better assess the behavior).
The `wglChoosePixelFormatARB` behavior is loosely modeled after the the AMD driver as discussed in https://gitlab.winehq.org/wine/wine/-/merge_requests/5388. I tried to keep things simple to begin with, and the results I am getting in various apps/games are sensible, but please try this out so we can refine further.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5933
This is part XI of cmd engine rewrite.
This serie moves the IF and FOR instruction into the new CMD_NODE structure.
I'm fully aware it's a large change (commit #1).
It touches simultaneously at several components:
- lexer is no longer trying to handle nested instructions; this is now
handled over to parser which will take care of it in a recursive
fashion
- moving the IF and FOR instructions into CMD_NODE; this impacts the
parser and the execution part
These three parts are so tightly linked that I can't figure out a simple
way to split first commit in smaller bits.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5942
--
v4: d3d11/tests: Test UpdateSubresource() for NV12 textures.
d3d11/tests: Test NV12 textures without render target.
d3d11/tests: Do not check pitches.
d3d11/tests: Check for NV12 texture support before testing them.
d3d11/tests: Check the result of compiling HLSL shaders.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5818
This is another step towards getting render states out of wined3d_state.
The idea here is similar to the "push constant buffers" used for d3d8/9 flat
constants, and reuses the same infrastructure. That is, we pack all of the
constants directly into a wined3d_buffer which is bound directly to the
wined3d_state as a normal constant buffer. For SPIR-V this buffer is placed in
the GPU, and the shader can simply access it directly, with no renderer-specific
changes needed other than to determine the buffer's location.
Currently this buffer is still stored on the CPU for GLSL, and the contents are
pulled back from the sysmem resource pointer, instead of being pulled from
state->render_states.
Eventually, at least for Vulkan, the idea will be to write a FFP replacement
shader which takes structured data (which, given the constraints of SPIR-V, is
broadly necessary; we cannot simply upload individual named uniforms as we can
with GLSL). In fact this will take the form of an HLSL shader compiled to Shader
Model 2 bytecode. This allows us to, once again, reuse pretty much all of the
existing infrastructure and avoid writing more backend-specific code, and has
the effect that this FFP replacement works not only with SPIR-V but also with
GLSL, allowing us to eventually remove the existing GLSL FFP pipeline, and
enabling me to develop the HLSL FFP pipeline mainly using the GL renderer [which
is useful since the Vulkan renderer is still missing a few other features].
The full branch is available at [1], and passes all tests when using the GL
renderer.
[1] https://gitlab.winehq.org/zfigura/wine/-/tree/himavant8
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5815
I'm currently, very unsuccessfully, tracking down a crash on the unix side that only happens on Gitlab, and although I'm still unable to reproduce it, it then would be useful to have gdb to attach on segfault when I will.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5367
GStreamer uses _SC_NPROCESSORS_CONF to determine 'max-threads'. On the
Steam Deck, this is configured to be 16 (which is double its number
of logical cores).
_SC_NPROCESSORS_CONF also disregards a process's CPU affinity, thus it
can create more threads than is useful, which ultimately wastes memory
resources.
Using affinity to set 'max-threads' addresses both these problems.
--
v6: winegstreamer: Set MAX_THREADS to 4 for i386.
winegstreamer: Use thread_count to determine 'max-threads' value.
winegstreamer: Use process affinity to calculate thread_count.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5923
Rémi Bernon (@rbernon) commented about dlls/winegstreamer/unixlib.c:
> return STATUS_UNSUCCESSFUL;
> }
>
> + if (SUCCEEDED(NtQueryInformationProcess( GetCurrentProcess(),
> + ProcessAffinityMask, &process_mask, sizeof(process_mask), NULL )))
> + thread_count = popcount(process_mask);
> + else
> + thread_count = 0;
```suggestion:-4+0
if (!NtQueryInformationProcess(GetCurrentProcess(),
ProcessAffinityMask, &process_mask, sizeof(process_mask), NULL)))
thread_count = popcount(process_mask);
else
thread_count = 0;
```
SUCCEEDED is for HRESULT, Nt API returns NTSTATUS and we often just check that it's 0. Also note the style fixes (no space in paren here, continuation indent is 8 spaces).
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5923#note_74517
GStreamer uses _SC_NPROCESSORS_CONF to determine 'max-threads'. On the
Steam Deck, this is configured to be 16 (which is double its number
of logical cores).
_SC_NPROCESSORS_CONF also disregards a process's CPU affinity, thus it
can create more threads than is useful, which ultimately wastes memory
resources.
Using affinity to set 'max-threads' addresses both these problems.
--
v3: winegstreamer: Set MAX_THREADS to 4 for i386.
winegstreamer: Use thread_count to determine 'max-threads' value.
winegstreamer: Use process affinity to calculate thread_count.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5923
On Wed Jun 26 07:26:50 2024 +0000, Zhiyi Zhang wrote:
> This looks correct at first glance. Do you have an application affected
> by this? It seems to me changing this only reduces some time and -1 will
> be returned if it's the last item.
Yes, I have. It fails on asserting return value of sending LVM_GETNEXTITEM message. I agree about aftereffect of this fix. Anyway, for me it doesn't make sense to handle ahead of time incorrect item (== infoPtr->nItemCount).
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5909#note_74482
Previously it was assumed that synchronous I/O fills the 64-bit IOSB, and
asynchronous I/O fills the 32-bit IOSB.
As the ntdll:wow64 tests show, this is incorrect. I/O on an overlapped handle,
whether it is synchronous or not, fills the 32-bit IOSB, and I/O on a
non-overlapped handle always fills the 64-bit IOSB.
The first half is important, since completion can be signaled before we even
return from the initial I/O call [NtReadFile() etc.] Filling the IOSB after
signaling completion is the cause of bug 56389. This patch series fixes that.
The second discrepancy does not cause any bugs, as far as I can see, and is
a bit harder to fix anyway. It is therefore not addressed by this patch series.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56389
--
v2: ntdll: Always fill the 32-bit iosb for overlapped handles, for regular read/write.
ntdll: Always fill the 32-bit iosb for overlapped handles, in set_async_direct_result().
ntdll: Always fill the 32-bit iosb for overlapped handles, in file_complete_async().
https://gitlab.winehq.org/wine/wine/-/merge_requests/5926
--
v4: mmdevapi/tests: Add test for capturing render loopback.
winepulse.drv: Implement pulse_get_loopback_capture_device().
winepulse.drv: Factor out wait_pa_operation_complete().
mmdevapi: Stub AUDCLNT_STREAMFLAGS_LOOPBACK support.
mmdevapi: Adjust timing after main loop start in client_Initialize().
https://gitlab.winehq.org/wine/wine/-/merge_requests/5870
Previously it was assumed that synchronous I/O fills the 64-bit IOSB, and
asynchronous I/O fills the 32-bit IOSB.
As the ntdll:wow64 tests show, this is incorrect. I/O on an overlapped handle,
whether it is synchronous or not, fills the 32-bit IOSB, and I/O on a
non-overlapped handle always fills the 64-bit IOSB.
The first half is important, since completion can be signaled before we even
return from the initial I/O call [NtReadFile() etc.] Filling the IOSB after
signaling completion is the cause of bug 56389. This patch series fixes that.
The second discrepancy does not cause any bugs, as far as I can see, and is
a bit harder to fix anyway. It is therefore not addressed by this patch series.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56389
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5926
This is part X of cmd engine rewrite.
This serie:
- tackles some other variable expansion issues,
- attaches redirections to CMD_NODE (where it belongs)
(eg. "> foo (IF 1==1 echo a)" is a valid command),
- preparing for next serie.
Next serie will activate he updated lexer and parser.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5932
IIUC atexit isn't exported by ucrtbase, but still exists (maybe as a builtin) and is resolved to a module-local symbol which can be used to register functions executed on module process detach. It is called implicitly by C++ compilers to register static destructors.
--
v3: include: Define __cpuid(ex) as intrinsics when _MSC_VER is defined.
include: Don't import atexit when building with ucrtbase.
include: Guard rpcndr.h DECLSPEC_UUID definition.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5915
GStreamer uses _SC_NPROCESSORS_CONF to determine 'max-threads'. On the
Steam Deck, this is configured to be 16 (which is double its number
of logical cores).
_SC_NPROCESSORS_CONF also disregards a process's CPU affinity, thus it
can create more threads than is useful, which ultimately wastes memory
resources.
Using affinity to set 'max-threads' addresses both these problems.
--
v2: winegstreamer: Set MAX_THREADS to 4 for i386.
winegstreamer: Use thread_count to determine 'max-threads' value.
winegstreamer: Provide thread_count to init_gstreamer.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5923
Zhiyi Zhang (@zhiyi) commented about dlls/comctl32/listview.c:
> {
> if ((infoPtr->uView == LV_VIEW_LIST) || (infoPtr->uView == LV_VIEW_DETAILS))
> {
> - while (nItem < infoPtr->nItemCount)
> + while (nItem < infoPtr->nItemCount - 1)
This looks correct at first glance. Do you have an application affected by this? It seems to me changing this only reduces some time and -1 will be returned if it's the last item.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5909#note_74440
On Wed Jun 26 07:15:20 2024 +0000, Ilia Docin wrote:
> To reproduce it, I moved gripper left and right to hide some buttons,
> then brought it back. On the first image chevron didn't disappear as
> expected. On the second one chevron went away as I applied fix.
Do you have a link to the software you used to demonstrate?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5706#note_74439
Zhiyi Zhang (@zhiyi) commented about dlls/comctl32/rebar.c:
> lpBand->rcChild.top, lpBand->rcChild.right + CHEVRON_WIDTH,
Please also change the commit message title to "comctl32/rebar: Hide chevron if rebar's band is resized back to full size with gripper.". Note the dot at the end of the title.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5706#note_74438
Mostly race condition fixes.
"winegstreamer: Do waits for samples on stream-specific work queues." works around a Gstreamer bug that I'll try to write a minimal reproducer for and submit to their bug tracker. For now, doing sample waits actually concurrently works around the problem.
"winegstreamer: Fixate caps in autoplug_continue_cb." so far I've only seen relevant when the source is a uridecodebin (in Proton), but I though it couldn't hurt to upstream it too.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5917
This commit replaces the SampleGrabberSink with a dedicated Video Sink,
referred to as the Simple Video Renderer (SVR).
This brings it more inline with Windows and provides the benefit of
having direct access to the IMFSample, removing the need to copy the
sample data.
--
v2: mfmediaengine: Implement SVR.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5924