If the malloc(3) has failed to allocate the memory in the
init_xdg_dirs(), the latter returns nonzero value, but the 'file' handle
is kept open. This closes the handle before return from the
init_xdg_dirs() if the malloc(3) has failed.
--
v4: shell32: Fix possible handle leak
https://gitlab.winehq.org/wine/wine/-/merge_requests/5827
These patches fix painting in an application that draws outside of a CS_PARENTDC child
client area in its WM_PAINT handler.
Comments and suggestions are welcome.
--
v3: win32u: Use parent rectangle for visible region calculations of a CS_PARENTDC child.
win32u: Don't clip update region to the window client rectangle.
win32u: GetUpdateRect() should clip update rectangle to the window client area.
win32u: GetUpdateRgn() should clip update region to the window client area.
win32u: Clip PAINTSTRUCT.rcPaint to the window client area.
server: For a CS_PARENTDC child use parent for visible region calculations.
server: If the being validated region covers whole window then validate everything.
user32/tests: Add a message test for listbox redrawing after LB_SETCOUNT.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5665
--
v3: d3d11/tests: Teste UpdateSubresource() for NV12 textures.
d3d11/tests: Test without render target.
tests/d3d11: 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 the first step in moving the various D3DXCreateTextureFromFileInMemory functions over to using shared code.
--
v2: d3dx9: Add support for specifying which mip level to get pixel data from to d3dx_image_get_pixels().
d3dx9: Cleanup texture value argument handling in D3DXCreateTextureFromFileInMemoryEx().
d3dx9: Add support for specifying a starting mip level when initializing a d3dx_image structure.
d3dx9: Use struct volume inside of struct d3dx_image for storing dimensions.
d3dx9: Use d3dx_image structure inside of D3DXCreateTextureFromFileInMemoryEx().
d3dx9: Refactor texture creation and cleanup in D3DXCreateTextureFromFileInMemoryEx().
d3dx9/tests: Add more tests for loading files with multiple mip levels into textures.
d3dx9/tests: Add tests for the source info argument of D3DXCreateTextureFromFileInMemoryEx().
https://gitlab.winehq.org/wine/wine/-/merge_requests/5801
UCRT's FILE struct and fd struct have different layouts, and their locks are different.
Implementation in Wine does not match UCRT in Windows, causing ABI issues.
see:
https://bugs.winehq.org/show_bug.cgi?id=53960
--
v39: ucrtbase: Fix FILE _flag values.
ucrtbase: Always use CRITICAL_SECTION for FILE locking.
msvcrt: Don't use custom standard streams definition.
ucrtbase: Add FILE structure tests.
ucrtbase: Fix _iobuf struct layout.
msvcp140: Use _get_stream_buffer_pointers() to access FILE internal buffers.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5752
--
v2: d3d11/tests: Teste UpdateSubresource() for NV12 textures.
d3d11/tests: Test without render target.
tests/d3d11: Do not check pitches.
d3d11/tests: Mark NV12 textures as broken on Windows 7.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5818
If the malloc(3) had failed to allocate the memory, it returned nonzero
value, but the 'file' handle was kept open. This closes the handle
before return from the `init_xdg_dirs()` if the malloc(3) has failed.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5827
First part of Proton shared memory series. The full branch can be seen at https://gitlab.winehq.org/rbernon/wine/-/commits/mr/shared-memories.
--
v41: win32u: Use the desktop shared data for GetCursorPos.
server: Move the last cursor time to the desktop session object.
server: Move the cursor position to the desktop session object.
win32u: Open the desktop shared object in NtUserSetThreadDesktop.
server: Return the desktop object locator in (get|set)_thread_desktop.
server: Allocate shared session object for desktops.
include: Add ReadNoFence64 inline helpers.
server: Create a global session shared mapping.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3103
If a DSN is System wide, we need to write to the HKEY_LOCAL_MACHINE
part of the registry not HKEY_CURRENT_USER which it's currently doing.
--
v2: odbccp32: SQLWritePrivateProfileStringW check for existing DSN first
odbccp32: Support System wide ODBC DSN keys
https://gitlab.winehq.org/wine/wine/-/merge_requests/5812
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.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5816
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.
--
v15: kernel32: Add tests for large page mapping support.
ntdll: Validate parameters to NtCreateSection if large pages are requested.
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.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5769
On Thu Jun 6 19:38:37 2024 +0000, Jacek Caban wrote:
> > Well, I expect them to behave like JS functions. If it were a JS
> function, it would check to see if the object type matches, and then do
> its thing. If you think of it like this, it wouldn't make much sense for
> it to use another object type's function.
> I'm not talking about another objects' functions, I'm talking about
> separate objects having the same prototypes in JS sense but being
> otherwise separate implementations of the same interfaces in C.
I see, if you look at it that way it makes sense to use IID, yeah (I was
thinking of the functions as complete separate entities rather than
interface implementations).
I still think it's slightly better to just pass/store func_info_t as a
container though—it's not just the args but everywhere else we need to
store it (like in ProxyFunction as I mentioned), now it's one less field
to worry about. And besides, if we ever do need to change it at some
point later, it will be much easier without affecting call sites.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5444#note_72649
Also: Add new timeouts to NETCON calls impacted by change
Timeout values are able to be set on all hInternet handles, so they should be able to set in a unified way.
Submitting what I have so far for review.
Known TODO: Tests, verify timeouts are set where NETCON is used, verify ULONG vs DWORD usage rules.
--
v7: wininet: unify timeout values closer to hInternet
https://gitlab.winehq.org/wine/wine/-/merge_requests/3518
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.
--
v14: kernel32: Add tests for large page mapping support.
ntdll: Validate parameters to NtCreateSection if large pages are requested.
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
Also: Add new timeouts to NETCON calls impacted by change
Timeout values are able to be set on all hInternet handles, so they should be able to set in a unified way.
Submitting what I have so far for review.
Known TODO: Tests, verify timeouts are set where NETCON is used, verify ULONG vs DWORD usage rules.
--
v5: wininet: unify timeout values closer to hInternet
https://gitlab.winehq.org/wine/wine/-/merge_requests/3518
On Wed Jun 5 23:33:45 2024 +0000, Jacek Caban wrote:
> Setting the timeout on the socket is quite expensive (requires a
> wineserver call). Maybe we could store the last set timeout separate
> from configure timeout and update socket timeout only when they don't match?
Would this proposal be only for `read_more_data` or in the broader scope of any call to `NETCON_set_timeout`?
If it is for the latter, it could be tracked in `netconn_t`. I can add that into a separate merge.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3518#note_72609
On Wed Jun 5 23:33:45 2024 +0000, Jacek Caban wrote:
> Do we still need it? I think that with implementation in both
> `set_global_option` and `INET_SetOption`, we could simply remove those
> cases from `InternetSetOptionW` fallback.
If we can assume that `vtbl->SetOption` is guaranteed to handle its own implementation of each timeout (or fallback to `INET_SetOption`), I could see dropping these cases from `InternetSetOptionW`.
I'll amend those changes.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3518#note_72608
> Well, I expect them to behave like JS functions. If it were a JS function, it would check to see if the object type matches, and then do its thing. If you think of it like this, it wouldn't make much sense for it to use another object type's function.
I'm not talking about another objects' functions, I'm talking about separate objects having the same prototypes in JS sense but being otherwise separate implementations of the same interfaces in C.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5444#note_72607
On Thu Jun 6 19:05:56 2024 +0000, Jacek Caban wrote:
> > In such case, instead of failing, it would call the other function
> that was looked up, since it matches in IID and DISPID. It won't crash,
> but I don't think it would be quite correct, either.
> That's the whole point, the reason it's safe and I don't see why you
> think it's incorrect. BTW, IID is intentionally abstract in my proposal;
> a bit closer to the actual meaning would be to use something like
> prototype ID once we have those (interface ID is just already available
> and close enough).
> > Continuing the above, IMO the following would make it the most robust:
> we look it up as mentioned from the func_info_t's dispid and IID, and
> then compare to see if it's the same `func_info_t` pointer.
> Sure, but it can't compare `func_info_t`s by a pointer, it would need to
> compare IID or something like that anyway. So in your proposal, the
> opaque pointer serves as (ID,IID) carrier, nothing else.
> > BTW, is there a reason you renamed `IWineJSDispatchHost` to just
> `IJSDispatchHost` when it's Wine's own interface? I thought it's better
> to avoid ambiguity with a native interface, especially if we're to
> extend it (obviously we can't touch native interfaces), makes it a lot
> more obvious.
> It's all Wine code, I don't see how putting "wine" in random places
> makes it any cleaner, but it's not a strong preference and I won't
> insist either way.
Well, I expect them to behave like JS functions. If it were a JS
function, it would check to see if the object type matches, and then do
its thing. If you think of it like this, it wouldn't make much sense for
it to use another object type's function.
As for Wine prefix, we typically have that already for our own custom
interfaces in mshtml, and even though it's all Wine code, it makes it
clearer for someone unfamiliar to understand that the interface is not
something from Windows—so they can find its documentation/code in Wine
code with grep instead of a Google search, and can freely change them
around, etc.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5444#note_72606
> In such case, instead of failing, it would call the other function that was looked up, since it matches in IID and DISPID. It won't crash, but I don't think it would be quite correct, either.
That's the whole point, the reason it's safe and I don't see why you think it's incorrect. BTW, IID is intentionally abstract in my proposal; a bit closer to the actual meaning would be to use something like prototype ID once we have those (interface ID is just already available and close enough).
> Continuing the above, IMO the following would make it the most robust: we look it up as mentioned from the func_info_t's dispid and IID, and then compare to see if it's the same `func_info_t` pointer.
Sure, but it can't compare `func_info_t`s by a pointer, it would need to compare IID or something like that anyway. So in your proposal, the opaque pointer serves as (ID,IID) carrier, nothing else.
> BTW, is there a reason you renamed `IWineJSDispatchHost` to just `IJSDispatchHost` when it's Wine's own interface? I thought it's better to avoid ambiguity with a native interface, especially if we're to extend it (obviously we can't touch native interfaces), makes it a lot more obvious.
It's all Wine code, I don't see how putting "wine" in random places makes it any cleaner, but it's not a strong preference and I won't insist either way.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5444#note_72605
On Thu Jun 6 15:55:43 2024 +0000, Gabriel Ivăncescu wrote:
> Actually you don't even need to query IID anymore. Just look up the
> function by dispid, and then check if it's same func_info_t, that's enough.
BTW, is there a reason you renamed `IWineJSDispatchHost` to just `IJSDispatchHost` when it's Wine's own interface? I thought it's better to avoid ambiguity with a native interface, especially if we're to extend it (obviously we can't touch native interfaces), makes it a lot more obvious.
And to add to what I said above, what I meant with "retrieving a potentially different function" is mostly theoretical, because as you said current mshtml likely has only one struct layout per interface. **But** if we were to assume this is not the case (addressing the original concern), then two objects could have same IID but different struct layouts and different functions. In such case, instead of failing, it would call the other function that was looked up, since it matches in IID and DISPID. It won't crash, but I don't think it would be quite correct, either. And it still makes the code simpler anyway.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5444#note_72601
--
v3: winegstreamer: Request the new transform output format explicitly.
winegstreamer: Use a caps to store the desired output format.
winegstreamer: Only report format changes when frontend supports it.
winegstreamer: Rename allow_size_change to allow_format_change.
winegstreamer: Enforce default stride presence in the video processor.
winegstreamer: Enforce default stride value in the video decoder.
winegstreamer: Allow to clear video decoder input/output types.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5732
This reduce the chance of buffer allocating issue for Kirikiri2 games(eg. Super Naughty Maid) when the game is trying to play videos.
--
v3: qasf/dmowrapper: Sync Stop() and Receive() for dmo wrapper filter.
qasf/dmowrapper: Return VFW_E_WRONG_STATE in dmo_wrapper_sink_Receive.
qasf/dmowrapper: Allocate output samples before calling ProcessInput().
qasf/dmowrapper: Return failure in dmo_wrapper_sink_Receive if samples allocating fails.
qasf/dmowrapper: Introduce release_output_samples.
qasf/dmowrapper: Introduce get_output_samples.
qasf/tests: Add more tests for dmo_wrapper_sink_Receive.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5717
On Thu Jun 6 15:51:53 2024 +0000, Gabriel Ivăncescu wrote:
> > But then you assume that all objects implementing the interface will
> use the same struct layout for that. I can't think of an example inside
> MSHTML where it's currently not the case, but that's not generally a
> promise that QI gives.
> In theory, there's a similar concern when looking up the function via
> IID and DISPID, specifically, that it might find a different function.
> In practice as you said it probably doesn't happen but…
> > So what's the point of it then? Avoiding one argument in a call?
> Continuing the above, IMO the following would make it the most robust:
> we look it up as mentioned from the func_info_t's dispid and IID, and
> then compare to see if it's the same `func_info_t` pointer. If not,
> return E_UNEXPECTED since it's the wrong function. And yes, one less
> argument to keep track of, but also one less thing to keep track of (in
> the ProxyFunction for instance, and everywhere else).
> > I think that you misinterprets your observations. Here is a test
> proving that currentStyle should have a setter that throws an error
> (unless used for modifiable style object):
> Okay, thanks for the test, I guess there's more at play here indeed.
Actually you don't even need to query IID anymore. Just look up the function by dispid, and then check if it's same func_info_t, that's enough.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5444#note_72595
Didn't notice that it was failing until I did the same for winemac with https://gitlab.winehq.org/wine/wine/-/merge_requests/5798. It was silently falling back to copies while winemac can't do that.
--
v3: gdi.exe16: Fix some incorrect usage of NtGdiDdDDICreateDCFromMemory.
winex11: Fix some incorrect usage of NtGdiDdDDICreateDCFromMemory.
winex11: Wrap more window surface formats with NtGdiDdDDICreateDCFromMemory.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5799
> But then you assume that all objects implementing the interface will use the same struct layout for that. I can't think of an example inside MSHTML where it's currently not the case, but that's not generally a promise that QI gives.
In theory, there's a similar concern when looking up the function via IID and DISPID, specifically, that it might find a different function. In practice as you said it probably doesn't happen but…
> So what's the point of it then? Avoiding one argument in a call?
Continuing the above, IMO the following would make it the most robust: we look it up as mentioned from the func_info_t's dispid and IID, and then compare to see if it's the same `func_info_t` pointer. If not, return E_UNEXPECTED since it's the wrong function. And yes, one less argument to keep track of, but also one less thing to keep track of (in the ProxyFunction for instance, and everywhere else).
> I think that you misinterprets your observations. Here is a test proving that currentStyle should have a setter that throws an error (unless used for modifiable style object):
Okay, thanks for the test, I guess there's more at play here indeed.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5444#note_72591
> Yeah, I forgot to validate it in my branch. In BuiltinFuncCall, something like this would work:
But then you assume that all objects implementing the interface will use the same struct layout for that. I can't think of an example inside MSHTML where it's currently not the case, but that's not generally a promise that QI gives.
> Alternatively, we can pass around `func_info_t` instead of dispid and tid, but still look it up like in your branch.
So what's the point of it then? Avoiding one argument in a call?
> I mean the test will simply start failing if it picks `IHTMLCSSStyleDeclaration` because the assignment does not throw exception anymore (when it should be!).
I think that you misinterprets your observations. Here is a test proving that currentStyle should have a setter that throws an error (unless used for modifiable style object):
```
sync_test("currentStyle", function() {
if (document.documentMode < 9)
return;
var s = document.body.currentStyle;
var d = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(s)), "zoom");
ok(typeof(d.get) === "function", "d.get = " + d.get);
ok(typeof(d.set) === "function", "d.set = " + d.set);
d.set.call(document.body.style, "1");
try {
d.set.call(s, "1");
ok(false, "exception expected");
}catch(e) { trace("MSG: " + e.message); }
});
```
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5444#note_72588