First, we have to distinguish between the "bind count" and the "allocation size"
of variables.
The "allocation size" affects the starting register id for the resource to
be allocated next, while the "bind count" is determined by the last field
actually used. The former may be larger than the latter.
Currently we are calling `hlsl_reg.bind_count` to what should be `hlsl_reg.allocation_size`.
So it is renamed in 2/4.
The proper "bind count" (now computed when needed in 3/4) is important because it is what should appear in the RDEF
table and some resource allocation rules depend on it
For instance, for this shader:
```
texture2D texs[3];
texture2D tex;
float4 main() : sv_target
{
return texs[0].Load(int3(0, 0, 0)) + tex.Load(int3(0, 0, 0));
}
```
the variable "texs" should show a "bind count" of 1, even though its "allocation size" is 3:
```
// Resource Bindings:
//
// Name Type Format Dim HLSL Bind Count
// ------------------------------ ---------- ------- ----------- -------------- ------
// texs texture float4 2d t0 1
// tex texture float4 2d t3 1
```
In particular, as shown in the tests in 1/4, textures go in this order:
1. Textures created from SM1-style samples. Those whose "bind count" is larger than 1, in the order of the tex1D/tex2D/tex3D/texCube instructions that create them.
2. Textures created from SM1-style samples. Those whose "bind count" is equal to 1, in the order of the tex1D/tex2D/tex3D/texCube instructions that create them.
3. Regular textures in order of declaration.
Note that the difference between 1 and 2 is not given by the "allocation size" but the "bind count".
This order is enforced in 4/4.
--
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/299
On Mon Aug 7 15:46:06 2023 +0000, Maxim Karasev wrote:
> Which `whoami` was tested? If it was the current in-tree one, then it
> works because it already uses `ConsoleWriteW()`.
Yes, I tested current Wine.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3473#note_41507
On Thu Aug 3 17:58:39 2023 +0000, Hans Leidekker wrote:
> I tried a username with non-ascii characters on Windows 10 and Wine and
> whoami behaves the same. Non-ascii characters are rendered on the
> console. When redirecting output non-ascii characters are replaced with '?'.
Which `whoami` was tested? If it was the current in-tree one, then it works because it already uses `ConsoleWriteW()`.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3473#note_41503
It's no problem to send fewer of these per MR. I have included the complete set because all but the last introduce no functional changes, and upstreaming a smaller set would leave the changes in a half-done state with unnecessary buffering.
--
v2: vkd3d: Store command list commands in a buffer until executed.
vkd3d: Store WriteBufferImmediate() arguments in a buffer.
vkd3d: Store ExecuteIndirect() arguments in a buffer.
vkd3d: Store SetPredication() arguments in a buffer.
vkd3d: Store ResolveQueryData() arguments in a buffer.
vkd3d: Store EndQuery() arguments in a buffer.
vkd3d: Store BeginQuery() arguments in a buffer.
vkd3d: Store d3d12_command_list_clear_uav() arguments in a buffer.
vkd3d: Store ClearRenderTargetView() arguments in a buffer.
vkd3d: Store ClearDepthStencilView() arguments in a buffer.
vkd3d: Store OMSetRenderTargets() arguments in a buffer.
vkd3d: Store SOSetTargets() arguments in a buffer.
vkd3d: Store IASetVertexBuffers() arguments in a buffer.
vkd3d: Store IASetIndexBuffer() arguments in a buffer.
vkd3d: Store d3d12_command_list_set_root_descriptor() arguments in a buffer.
vkd3d: Store d3d12_command_list_set_root_cbv() arguments in a buffer.
vkd3d: Store d3d12_command_list_set_root_constants() arguments in a buffer.
vkd3d: Store d3d12_command_list_set_descriptor_table() arguments in a buffer.
vkd3d: Store d3d12_command_list_set_root_signature() arguments in a buffer.
vkd3d: Add an internal refcount to struct d3d12_root_signature.
vkd3d: Store ResourceBarrier() arguments in a buffer.
vkd3d: Store SetPipelineState() arguments in a buffer.
vkd3d: Store OMSetStencilRef() arguments in a buffer.
vkd3d: Store OMSetBlendFactor() arguments in a buffer.
vkd3d: Store RSSetScissorRects() arguments in a buffer.
vkd3d: Store RSSetViewports() arguments in a buffer.
vkd3d: Store IASetPrimitiveTopology() arguments in a buffer.
vkd3d: Store ResolveSubresource() arguments in a buffer.
vkd3d: Store CopyResource() arguments in a buffer.
vkd3d: Store CopyTextureRegion() arguments in a buffer.
vkd3d: Store CopyBufferRegion() arguments in a buffer.
vkd3d: Store Dispatch() arguments in a buffer.
vkd3d: Store DrawIndexedInstanced() arguments in a buffer.
vkd3d: Store DrawInstanced() arguments in a buffer.
This merge request has too many patches to be relayed via email.
Please visit the URL below to see the contents of the merge request.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/294
I tried build a real Windows application (mimikatz) and had troubles with some wine headers incompatibility. The patch set improves headers to allow build the foreign application with Wine.
--
v2: include: Add standalone LSA_OBJECT_ATTRIBUTES prototype if ntdef.h is not included.
include: Add initial activeds.h.
include: Add missed PCWCHAR to winnt.h.
include: Include ncrypt.h in wincrypt.h.
include: Add specstrings_strict.h with some defines.
include: Use compatible file guard name (_NTSECAPI_, _NTSECPKG_).
include: Add some missed defines.
ntdll: Use COMPRESSION_FORMAT_MASK instead of ~COMPRESSION_ENGINE_MAXINUM.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3506
This fixes an issue when the path includes non-ASCII characters.
Signed-off-by: Jactry Zeng <jzeng(a)codeweavers.com>
--
v7: mshtml: Call UrlUnescapeW() with URL_UNESCAPE_AS_UTF8 in is_gecko_path().
shlwapi/tests: Test UrlUnescapeW() with URL_UNESCAPE_AS_UTF8.
https://gitlab.winehq.org/wine/wine/-/merge_requests/585
- The initial development was done by Matthew Wong in 2019. I split his v2 patch into testing and implementation commits, making changes needed to get it to compile.
- Some of the feedback given on the v2 patch was addressed by Myah Caron's updated patch versions in 2020, which I split out into a few separate commits.
- I also addressed some of the feedback, expanded the tests, and fixed some results based on those tests.
_(Following is the commit message from Matthew Wong's v2 patch)_
Implement functions used by some games (notably LEGO Island) for
determining which 3D object in a scene was clicked by the mouse cursor.
Fighting Steel also uses this function for mouse over. Previous stubs
would cause LEGO Island to crash upon any click and Fighting Steel
to crash on game start. A patch posted years ago on the bug thread
provided the minimum functionality to prevent crashes, but still
rendered large portions of the game inaccessible without them
implemented correctly.
Picking has been implemented by adding a "pick mode" in
d3d_execute_buffer_execute() which skips any drawing functions
leaving just the vertex processing. Adds click tests for each triangle
when in pick mode for creating an array of D3DPICKRECORDs.
Add a D3DPICKRECORD array and DWORD counter to d3d_device. These are
initiated in d3d_device_init(), allocated/written in
d3d_execute_buffer_execute(), and accessed/read in
d3d_device1_GetPickRecords(). The counter is used to determine the array
size (0 meaning array is not allocated). The array is free'd whenever
the data is no longer necessary by d3d_execute_buffer_execute(),
d3d_device1_GetPickRecords(), and d3d_device_inner_Release().
Add a compliance test to ddraw1 to test whether certain screen points
result in successful picks or not, as well as whether the data returned
from GetPickRecords() is valid and correct.
Stress testing reveals this patch's Pick() implementation may have
slight inaccuracies to the original function; occasionally pixels right
on triangle edges result in successful picks when they don't with the
original function (and vice versa). It may be some sort of floating
point rounding error or other algorithm difference that would be
difficult to determine without seeing the original code. In practice, I
believe this inaccuracy is so negligible that it won't produce any
undesirable results for the user.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=10729
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3420
Still working in progress.
--
v2: temp
winegstreamer: Implement wg_muxer.
winegstreamer: Introduce array_reserve to unix lib.
winegstreamer: Add mpeg4 sink class factory.
winegstreamer: Add enum wg_container_type.
winegstreamer: Make find_element accept NULL caps.
winegstreamer: Add async command handling to media sink.
winegstreamer: Add IMFClockStateSink stubs for media sink.
winegstreamer: Implement IMFMediaEventGenerator for media sink.
winegstreamer: Add stubs for stream sink.
winegstreamer: Add stubs for media sink.
mf/tests: Test IMFClockStateSink in shutdown state.
mf/tests: Test sample processing for MPEG4 media sink.
mf/tests: Use IMFMediaEventGenerator interface in event wait helper.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3303
This is required to avoid silencing (potentially fatal) exceptions from timer procedures.
--
v4: win32u: Ignore unhandled info index in NtUserSetObjectInformation.
win32u/tests: Add tests for NtUserSetObjectInformation.
user32: Implement UOI_TIMERPROC_EXCEPTION_SUPPRESSION.
user32/tests: Add tests for UOI_TIMERPROC_EXCEPTION_SUPPRESSION.
include: Add definition for UOI_TIMERPROC_EXCEPTION_SUPPRESSION
user32/tests: Make test_unicode_wm_char robust against superfluous messages.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3454
IMHO this should be made consistent with how `NtTerminateProcess()` handles NULL process handle.
There's no special logic for NULL handles in the client[^wineserver] side of `NtTerminateProcess()`:[^NtTerminateProcess]
```c
/******************************************************************************
* NtTerminateProcess (NTDLL.@)
*/
NTSTATUS WINAPI NtTerminateProcess( HANDLE handle, LONG exit_code )
{
unsigned int ret;
BOOL self;
SERVER_START_REQ( terminate_process )
{
req->handle = wine_server_obj_handle( handle ); /* <-- no NULL check here */
req->exit_code = exit_code;
ret = wine_server_call( req );
self = reply->self;
}
SERVER_END_REQ;
(...snip...)
return ret;
}
```
Instead, `NtTerminateProcess()` passes the handle to the wineserver[^wineserver], which is actually responsible for interpreting the process handle (and thus checking for NULL handle as well):[^terminate_process]
```c
/* terminate a process */
DECL_HANDLER(terminate_process)
{
struct process *process;
if (req->handle) /* <-- NULL check here */
{
process = get_process_from_handle( req->handle, PROCESS_TERMINATE );
if (!process) return;
}
else process = (struct process *)grab_object( current->process );
reply->self = (current->process == process);
terminate_process( process, current, req->exit_code );
release_object( process );
}
```
The `terminate_thread` handle should be made to accept NULL handle as well.
[^wineserver]: Any Wine app process is a client of the *wineserver*, which emulates the core "kernel" part of the Windows.
[^NtTerminateProcess]: https://gitlab.winehq.org/wine/wine/-/blob/f1749b0808c66a0341b77409cc9338ab…
[^terminate_process]: https://gitlab.winehq.org/wine/wine/-/blob/f1749b0808c66a0341b77409cc9338ab…
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3447#note_41447
> Nothing can call PutWorkItem or use the queue after Shutdown has been called.
True, although that fact is a little obscure (especially since MFPutWorkItem() is called from a callback. That said, my concern at this point is less about correctness than idiomaticity.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3491#note_41434
On Fri Aug 4 21:02:44 2023 +0000, Zebediah Figura wrote:
> > We could maybe grab the Queue id in the cs, 0 it, and use the local
> copy for unlocking. Does that sound better?
> That does seem like an improvement; I can't say I see a better way to
> solve the problem after looking, at least. We should probably mention in
> a comment why we're releasing outside of the lock; it is not obvious at
> all from the documentation that MFUnlockWorkQueue() can block.
Nothing can call PutWorkItem or use the queue after Shutdown has been called.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3491#note_41432
Today, Wine fails to build with musl libc and Linux kernel 5.14 uAPI
header files.
musl libc doesn't supply any definitions for IPX, such as the SOL_IPX
macro. However, it still provides linux/ipx.h from Linux uAPI header
files if it exists.
Linux kernel wouldn't drop linux/ipx.h from uAPI headers until 5.15,
although IPX support has already been marked obsolete since 2018.
Fix this by not defining HAS_IPX if linux/ipx.h has been included but
nothing defines the SOL_IPX macro.
Status of IPX support from other libcs are noted below:
- bionic: netipx/ipx.h does not exist. linux/ipx.h may or may not
exist. Note that sys/socket.h defines SOL_IPX even if linux/ipx.h is
missing.
- glibc: netipx/ipx.h exists. In this case, Wine assumes IPX support
even if the operating system does not support it in runtime.
- BSD variants: netipx/ipx.h may or may not exist. linux/ipx.h does not
exist. Some BSDs supply SO_DEFAULT_HEADERS instead of SOL_IPX.
--
v2: server: Avoid relying on linux/ipx.h to define SOL_IPX.
ws2_32: Avoid relying on linux/ipx.h to define SOL_IPX.
ntdll: Avoid relying on linux/ipx.h to define SOL_IPX.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3428
> We could maybe grab the Queue id in the cs, 0 it, and use the local copy for unlocking. Does that sound better?
That does seem like an improvement; I can't say I see a better way to solve the problem after looking, at least. We should probably mention in a comment why we're releasing outside of the lock; it is not obvious at all from the documentation that MFUnlockWorkQueue() can block.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3491#note_41430
On Fri Aug 4 20:16:23 2023 +0000, Zebediah Figura wrote:
> > It doesn't matter much if the handle is invalid, as the PutWorkItem
> call will just fail.
> But the handle could in theory be reallocated for a different queue.
> Also, if queues are supposed to be refcounted, it looks quite wrong that
> a thread which doesn't have a reference to a handle is accessing it;
> that's the sort of thing that generally causes memory errors.
> It might be the case that our current implementation is preventing any
> of this from being a problem in practice, but it's fragile and
> unidiomatic, and it is rather confusing to anyone reading the code; it
> looks like an error.
We could maybe grab the Queue id in the cs, 0 it, and use the local copy for unlocking. Does that sound better?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3491#note_41426
> It doesn't matter much if the handle is invalid, as the PutWorkItem call will just fail.
But the handle could in theory be reallocated for a different queue. Also, if queues are supposed to be refcounted, it looks quite wrong that a thread which doesn't have a reference to a handle is accessing it; that's the sort of thing that generally causes memory errors.
It might be the case that our current implementation is preventing any of this from being a problem in practice, but it's fragile and unidiomatic, and it is rather confusing to anyone reading the code; it looks like an error.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3491#note_41425
On Fri Aug 4 19:58:51 2023 +0000, Zebediah Figura wrote:
> Not sure why I wasn't added as reviewer, but this looks wrong, and I
> think this doesn't fully solve the problem, either.
> As far as I can tell, if there's something else [what?] that pushes to
> the queue executing concurrently with Shutdown(), it'll end up pushing
> to an invalid queue handle after Shutdown() returns. This was already
> the case, but now it's worse, because you can't just fix it by setting
> source->async_commands_queue to NULL.
1. You were added as reviewer.
2. It doesn't matter much if the handle is invalid, as the PutWorkItem call will just fail.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3491#note_41424
The only important field at this point is cbSize, but if it's zero, the
message will not be processed.
---
The other option would be to zero the buffer and then do the equivalent of `((COMBOBOXINFO *)buffer)->cbSize = sizeof(COMBOBOXINFO)`, rather than copying the incoming lparam. That doesn't seem better to me, but I'm no expert.
--
v2: win32u: Copy an incoming COMBOBOXINFO when packing CB_GETCOMBOBOXINFO for clients.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3507
Not sure why I wasn't added as reviewer, but this looks wrong, and I think this doesn't fully solve the problem, either.
As far as I can tell, if there's something else [what?] that pushes to the queue executing concurrently with Shutdown(), it'll end up pushing to an invalid queue handle after Shutdown() returns. This was already the case, but now it's worse, because you can't just fix it by setting source->async_commands_queue to NULL.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3491#note_41413
This fixes an issue when the path includes non-ASCII characters.
Signed-off-by: Jactry Zeng <jzeng(a)codeweavers.com>
--
v6: 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().
https://gitlab.winehq.org/wine/wine/-/merge_requests/585
This fixes an issue when the path includes non-ASCII characters.
Signed-off-by: Jactry Zeng <jzeng(a)codeweavers.com>
--
v5: 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
--
v3: mshtml: Use unlink and destructor in the vtbl for HTMLNamespaceCollection.
mshtml: Use unlink and destructor in the vtbl for HTMLPerformance.
mshtml: Use unlink and destructor in the vtbl for HTMLPerformanceNavigation.
mshtml: Use unlink and destructor in the vtbl for Navigator.
mshtml: Use unlink and destructor in the vtbl for HTMLMimeTypesCollection.
mshtml: Use unlink and destructor in the vtbl for HTMLPluginsCollection.
mshtml: Use unlink and destructor in the vtbl for History.
mshtml: Use unlink and destructor in the vtbl for HTMLScreen.
mshtml: Use unlink and destructor in the vtbl for HTMLDOMImplementation.
mshtml: Use unlink and destructor in the vtbl for HTMLDOMAttribute.
mshtml: Use unlink and destructor in the vtbl for HTMLTxtRange.
mshtml: Use unlink and destructor in the vtbl for HTMLDOMRange.
mshtml: Use unlink and destructor in the vtbl for HTMLSelectionObject.
mshtml: Use unlink and destructor in the vtbl for HTMLStorage.
mshtml: Unlink variants using a helper function.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3482
Currently if a native Unix thread (created by our Unix lib or a native library) is crashing the process just silently terminates without any log record. That happens because segv_handler gets segfault on the first attempt to access TEB (e. g., for logging anything but not just). I think having at least some note of the fact that happened is helpful.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3496
The only important field at this point is cbSize, but if it's zero, the
message will not be processed.
---
The other option would be to zero the buffer and then do the equivalent of `((COMBOBOXINFO *)buffer)->cbSize = sizeof(COMBOBOXINFO)`, rather than copying the incoming lparam. That doesn't seem better to me, but I'm no expert.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3507
I tried build a real Windows application (mimikatz) and had troubles with some wine headers incompatibility. The patch set improves headers to allow build the foreign application with Wine.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3506
On Thu Aug 3 10:09:59 2023 +0000, Maxim Karasev wrote:
> Printing a non-english username.
> `wprintf()` by default doesn't print non-english letters at all (I
> remember testing various system LC_ALL variants, like `C.UTF-8`,
> `en_US.UTF-8`, `ru_RU.UTF-8`, and none of that took an effect).
> With `setlocale(LC_ALL, something)` it does print the letters, but
> 1. Only of a language that is set, so I presume it chooses something
> like a `cp1251` equivalent (an 8-bit language-specific encoding?).
> 2. It isn't used in any of other wine programs, while that
> `ConsoleWriteW()` hack is used at least in present whoami and xcopy
> implementations (probably more).
> This implementation, in turn, behaves exactly like the Windows whoami.
> Also when testing the `klist` I noticed that on Windows it was printing
> `?` signs instead of `Server` string (somehow hooked up a translation?),
> so `ConsoleWriteW()` seems to be necessary for any translatable console
> programs if one wants to avoid `setlocale()`.
I tried a username with non-ascii characters on Windows 10 and Wine and whoami behaves the same. Non-ascii characters are rendered on the console. When redirecting output non-ascii characters are replaced with '?'.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3473#note_41261
On Thu Aug 3 16:39:16 2023 +0000, Yuxuan Shui wrote:
> Yes, what you said makes sense.
> > something that's pretty much always been within Wine's scope to fix.
> I want to assure you I 100% understand that. After all, this MR is
> exactly trying to fix such a case.
And I think it's better if I clarify what I mean when I say "invalid".
In this example, this use of `ReleaseSRWLockExclusive` is clearly invalid w.r.t. the official description of the API, and that's why I called it so.
Real world applications do make use of APIs in invalid ways, and Wine has to support those usages. However this doesn't make such uses less invalid.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3504#note_41257
- Fixed the queue memory leak
- Created a critical section for the queue
- I removed the allocator lock when it calls NotifyRelease, I didn't add a case for being able to call NotifyRelease inside the lock because NotifyRelease never receives a pointer to the allocator so I don't think there is a need to still lock while running NotifyRelease.
- Moved process_input to NotifyRelease.
- Also removed the test because it doesn't reproduce the bug reliably specially in the testbot, but I can add it again if it's needed or try to look for a way to make it reliable.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3319#note_41256
I'm not sure how could I test this behavior, right now the test I wrote works but there are times where it doesn't enter into the deadlock.
--
v4: evr: Remove process input handling from streaming thread.
evr: Don't lock allocator in NotifyRelease call.
evr: Create critical section for sample queue.
evr: Release sample queue when streaming ends.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3319
On Thu Aug 3 16:09:52 2023 +0000, Zebediah Figura wrote:
> > I feel that is a bit overkill for a single application, which is using
> the lock in an invalid way anyway.
> Maybe, but I don't like the way this patch basically feels like it's
> hacking around the current behaviour.
> I'd also assert that "invalid" is often not a very meaningful word when
> it comes to Wine. There's documented API, sure, but programs making
> assumptions about internals is commonplace, and something that's pretty
> much always been within Wine's scope to fix.
Yes, what you said makes sense.
> something that's pretty much always been within Wine's scope to fix.
I want to assure you I 100% understand that. After all, this MR is exactly trying to fix such a case.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3504#note_41253
> I feel that is a bit overkill for a single application, which is using the lock in an invalid way anyway.
Maybe, but I don't like the way this patch basically feels like it's hacking around the current behaviour.
I'd also assert that "invalid" is often not a very meaningful word when it comes to Wine. There's documented API, sure, but programs making assumptions about internals is commonplace, and something that's pretty much always been within Wine's scope to fix.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3504#note_41252
On Thu Aug 3 15:49:48 2023 +0000, Yuxuan Shui wrote:
> I feel that is a bit overkill for a single application, which is using
> the lock in an invalid way anyway.
Had some discussions with @huw and agreed we do need to do this properly.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3504#note_41250
On Thu Aug 3 15:44:45 2023 +0000, Jinoh Kang wrote:
> > ending up re-using the same mapping because it is created with the
> desktop name.
> Then I think we should unlink the mapping object (but keep it alive),
> and create a *new* mapping object with the same.
> Perhaps this was obvious at first, but there was some complication that
> I failed to notice. Do you mind elaborating if this is the case?
Sure, we should perhaps unlink the mapping object too.
Although that's probably a good thing to do, I'm not sure to see how it makes any difference wrt this `shared_ptr` member, and why we should get rid of this member.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3103#note_41249
v2: Use pointer to const when possible for the desktop_shm_t, make it writable only within SHARED_WRITE_BEGIN/END. Remove the recursive sequence number and the related asserts.
I rebased and pushed the update to quickly apparently, Gitlab UI messed it up, the range-diff is 8bf8fb91603...8cd46e3de73.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3103#note_41246
Instead of creating a new directory object, how about we just make the desktop object itself a namespace and implement `object_ops::lookup_name`?
Instead of
WindowsStations\__wine_desktop_mappings\WinSta0\Default
, we'd open
WindowsStations\WinSta0\Default\__wine_desktop_mapping
.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3103#note_41245
On Thu Aug 3 15:48:53 2023 +0000, Zebediah Figura wrote:
> > @zfigura I think this is unfortunately a case of the application
> looking at the internal state of something that's supposed to be opaque.
> >
> > The application here is specifically creating a `SRWLOCK`,
> manipulating its internal state not through the APIs, then calling
> `ReleaseSRWLockExclusive` and inspecting the result.
> >
> > And if the result is different from what it expects, it opens a
> KeyedEvent for `"\\KernelObjects\\CritSecOutOfMemoryEvent"`, and waits
> on it in a loop.
> >
> > I can't tell you why it's doing that.
> That makes some amount of sense (not that I know why the application
> thinks it needs to mess with lock state manually, but, well, It
> Happens). In that case I suppose the answer is that we probably need to
> change our SRW lock implementation to match Windows'.
I feel that is a bit overkill for a single application, which is using the lock in an invalid way anyway.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3504#note_41229
> @zfigura I think this is unfortunately a case of the application looking at the internal state of something that's supposed to be opaque.
>
> The application here is specifically creating a `SRWLOCK`, manipulating its internal state not through the APIs, then calling `ReleaseSRWLockExclusive` and inspecting the result.
>
> And if the result is different from what it expects, it opens a KeyedEvent for `"\\KernelObjects\\CritSecOutOfMemoryEvent"`, and waits on it in a loop.
>
> I can't tell you why it's doing that.
That makes some amount of sense (not that I know why the application thinks it needs to mess with lock state manually, but, well, It Happens). In that case I suppose the answer is that we probably need to change our SRW lock implementation to match Windows'.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3504#note_41228
@zfigura I think this is unfortunately a case of the application looking at the internal state of something that's supposed to be opaque.
The application here is specifically creating a `SRWLOCK`, manipulating its internal state not through the APIs, then calling `ReleaseSRWLockExclusive` and inspecting the result.
And if the result is different from what it expects, it opens a KeyedEvent for `"\\KernelObjects\\CritSecOutOfMemoryEvent"`, and waits on it in a loop.
I can't tell you why it's doing that.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3504#note_41224
--
v2: mshtml: Use unlink and destructor in the vtbl for HTMLNamespaceCollection.
mshtml: Use unlink and destructor in the vtbl for HTMLPerformance.
mshtml: Use unlink and destructor in the vtbl for HTMLPerformanceNavigation.
mshtml: Use unlink and destructor in the vtbl for Navigator.
mshtml: Use unlink and destructor in the vtbl for HTMLMimeTypesCollection.
mshtml: Use unlink and destructor in the vtbl for HTMLPluginsCollection.
mshtml: Use unlink and destructor in the vtbl for History.
mshtml: Use unlink and destructor in the vtbl for HTMLScreen.
mshtml: Use unlink and destructor in the vtbl for HTMLDOMImplementation.
mshtml: Use unlink and destructor in the vtbl for HTMLDOMAttribute.
mshtml: Use unlink and destructor in the vtbl for HTMLTxtRange.
mshtml: Use unlink and destructor in the vtbl for HTMLDOMRange.
mshtml: Use unlink and destructor in the vtbl for HTMLSelectionObject.
mshtml: Use unlink and destructor in the vtbl for HTMLStorage.
mshtml: Unlink variants using a helper function.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3482
This comes from behavioral study of Windows, which doesn't seem to check if the
lock is actually exclusively held, and just simply decrement the value stored
in the lock.
This fixes a dead lock which prevents WeCom from starting up.
--
v2: ntdll: Handle invalid locks in ReleaseSRWLockExclusive.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3504
OPEN_MAX is 10240, which is usually lower than the kern.maxfilesperproc sysctl
value. Said value from sysctl works on Mojave to Monterey (and most likely
earlier Mac OS versions, but I can't test). Since Big Sur we can successfully
set the reported rlim_max value.
--
v2: ntdll: Try to raise the file limit above OPEN_MAX on MacOS.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3503