Called by IE11.
Signed-off-by: Mohamad Al-Jaf <mohamadaljaf(a)gmail.com>
v3: Fix failed test.
Don't know how to change the subject version number.
--
v2: shell32: Add SHBindToFolderIDListParent tests.
shell32: Implement SHBindToFolderIDListParent.
https://gitlab.winehq.org/wine/wine/-/merge_requests/566
--
v3: mshtml: Implement document.mimeType.
mshtml: Get rid of a EVENTID_LAST special case.
mshtml: Allow null or undefined func in addEventListener.
mshtml: Allow null or undefined listeners in attachEvent/detachEvent.
jscript: Implement VariantChangeType for VT_DISPATCH and VT_UNKNOWN.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1172
So indeed attachEvent only does that when the ChangeType fails (no matter the error code).
Getting the mime type thing correct is challenging, but at least I managed to have all tests pass. I think I got it for the most part, and it should be fine for us to do it like this, but I had to add one "special case" in the tests for the w1064v1809 testbot VM because, for whatever reason, it uses the .htm extension to lookup the name, while .html is specified in the database. The CLSID also does not work correctly for it, either (it would show "HTML Document" instead of "HTM file")... I don't think this quirk is worth replicating.
Basically, first it looks up the Extension value in the database for that MIME type. If that is not found, or the extension lookup itself fails later or doesn't exist, it tries the CLSID from the database to obtain the ProgID.
I also test it in scripts via external.getExpectedMimeType, even though it seems overkill for now, because it will be useful later when testing more doc mime types (XHR response as well, for instance) and from others (anchors, etc). So it will be useful to have.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1172#note_12385
Enforce proper atomic update so that other threads do not read stale
data from IO_STATUS_BLOCK.
Signed-off-by: Jinoh Kang <jinoh.kang.kr(a)gmail.com>
--
v8: ntdll: Fix reading stale Information from IOSB.
https://gitlab.winehq.org/wine/wine/-/merge_requests/155
Enforce proper atomic update so that other threads do not read stale
data from IO_STATUS_BLOCK.
Signed-off-by: Jinoh Kang <jinoh.kang.kr(a)gmail.com>
--
v7: ntdll: Fix reading stale Information from IOSB.
https://gitlab.winehq.org/wine/wine/-/merge_requests/155
This change is adding DWARF (CFI) unwind information to the
hand-written assembly of the `__wine_syscall_dispatcher` function.
This enables unwinding through the dispatcher from the Linux stack
into (and through) the Windows stack.
The general idea is that the `syscall_frame` struct contains the
content of the callee-save registers before the function call
(in particular the stack pointer and the return address). At any
point of the execution, we have a pointer into the `syscall_frame`
in $ebx, $ecx, $ebp, or $esp.
For the CFI codes the general idea is that we are defining the
computations of the callee-save registers based on the
`syscall_frame` using DWARF’s `breg` instruction, rather than
relative to CFA.
cc/ @florian-kuebler
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1182
Overwatch 2 verifies that every kernel callback that is run, lives in user32. Introduce a callback in user32 that just forwards to the other modules' callbacks.
I don't know what to call this kind of callback, I just called it "user32 callback" for now because it's going through user32 but that's not really a good name.
It also sadly necessitates a private \_\_wine export from user32, unless someone has a better idea for how to register the callbacks with user32.
--
v3: user32: Remove NtUserDriverCallback* kernel callbacks.
winex11.drv: Convert kernel callbacks to user32 callbacks.
winemac.drv: Convert kernel callbacks to user32 callbacks.
wineandroid.drv: Convert kernel callbacks to user32 callbacks.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1180
Overwatch 2 verifies that every kernel callback that is run, lives in user32. Introduce a callback in user32 that just forwards to the other modules' callbacks.
I don't know what to call this kind of callback, I just called it "user32 callback" for now because it's going through user32 but that's not really a good name.
It also sadly necessitates a private \_\_wine export from user32, unless someone has a better idea for how to register the callbacks with user32.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1180
Overwatch 2 verifies that every kernel callback that is run, lives in user32. Introduce a callback in user32 that just forwards to the other modules' callbacks.
I don't know what to call this kind of callback, I just called it "user32 callback" for now because it's going through user32 but that's not really a good name.
It also sadly necessitates a private \_\_wine export from user32, unless someone has a better idea for how to register the callbacks with user32.
--
v2: user32: Remove NtUserDriverCallback* kernel callbacks.
winex11.drv: Convert kernel callbacks to user32 callbacks.
winemac.drv: Convert kernel callbacks to user32 callbacks.
wineandroid.drv: Convert kernel callbacks to user32 callbacks.
winevulkan: Convert kernel callbacks to user32 callbacks.
user.exe16: Convert kernel callbacks to user32 callbacks.
user32: Add user32 callback infrastructure.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1180
Currently, unwinding the unix libraries (or full ELF builds) requires having libunwind available.
When starting up a wine environment, an exception of type `RPC_S_SERVER_UNAVAILABLE` gets thrown - and if libunwind isn't available, this breaks the startup. Thus, currently on ARM/ARM64, libunwind is essentially mandatory.
Additionally, at least on ARM, libunwind seems brittle (commits in latest git master breaks the unwinding use cases in Wine, see e.g. https://github.com/libunwind/libunwind/pull/203#issuecomment-984126066.
This MR tries to resolve all of this, by including the preexisting DWARF parser from x86_64 in the aarch64 version too. This bit was mostly quite straightforward.
For ARM, libunwind has currently relied on DWARF debug info in the `.debug_frame` section, since Linux on ARM doesn't use DWARF for runtime unwinding. This MR adds ARM EHABI unwind opcodes where necessary, and adds a local reimplementation of an ARM EHABI/EXIDX/EXTBL unwinder, similar to the DWARF one.
With these changes, unwinding on both ARM and ARM64 seems to work fine, even without libunwind.
See the individual commit messages for more commentary on the decisions taken so far (I've tried to write up all relevant considerations there - it's a fair amount of commentery).
A couple open questions:
- So far, the shared DWARF code was put in a header, `dwarf.h`. Do you want to make this a proper standalone `.c` file too?
- I wrote the ARM EHABI unwind code mostly with `stdint.h` types like `uint32_t`(as it's in the ntdll/unix directory anyway), but I can rewrite it with `DWORD` or similar if that's preferred.
- The ARM EHABI opcodes are enabled for `defined(__arm__) && defined(__ELF__) && defined(__GNUC__) && !defined(__SEH__) && !defined(__ARM_DWARF_EH__)` - there's no define to check for for knowing it's used and enabled, but it has to be implicitly assumed if no other other unwind mechanism is signaled.
- The `dl_iterate_phdr` function, used for finding the EXIDX section for locating ARM EHABI unwind info, is used within `#ifdef linux`. It might be available on other OSes too (like FreeBSD etc). Or should I go ahead and add a configure check for it?
CC @julliard @rbernon @AndreRH
--
v2: ntdll: Use the local dwarf implementation on arm64
ntdll: Add support for aarch64 in the dwarf implementation
ntdll: Move the dwarf reading routines to a shareable header
https://gitlab.winehq.org/wine/wine/-/merge_requests/1134
--
v3: vkd3d-shader/hlsl: Propagate copies for resource store instructions.
vkd3d-shader/hlsl: Write SM4 UAV store instructions.
vkd3d-shader/hlsl: Parse UAV stores.
vkd3d-shader/hlsl: Implement typed UAV loads.
vkd3d-shader/hlsl: Write SM4 UAV declarations.
vkd3d-shader/hlsl: Allocate UAVs.
tests: Add a test for storing to a UAV array.
tests: Add more tests for UAV allocation.
tests: Fix constructor declaration in the partial UAV write test.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/36
--
v3: win32u: Implement NtUserDisplayConfigGetDeviceInfo(DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_NAME).
win32u: Store output id in monitors cache.
win32u: Move NtUserDisplayConfigGetDeviceInfo implementation from user32.
win32u: Store GPU luid in adapters cache.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1157
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50955
The problem which this patchset aims to solve is (sometimes) huge timeout on TCP listening port availability on Linux after the listening socket was closed one or another way. By default, the listening port will also be blocked for the whole time accepted socket waits through lengthy timeouts (sometimes; most surely when the listening process with an active connection was force killed, but not limited to this condition).
BSD SO_REUSEADDR socket option is aimed mainly to avoid that extra wait on binding already closed listening socket address. From [1]: "Indicates that the rules used in validating addresses supplied in a bind(2) call should allow reuse of local addresses. For AF_INET sockets this means that a socket may bind, except when there is an active listening socket bound to the address.".
Unix SO_REUSEADDR does not really allow reusing address in the Winsock sense. It will just allow to ditch the timeout (which is always the case on Windows without any specific options). Unfortunately it is not the only effect of the option. It still won't allow listening on the address simultaneously (unlike Winsock SO_REUSEADDR which allows simultaneous listening), or binding to an address which is being listened. But it will allow to bind different sockets for the same address which is not the Winsock behaviour when Winsock SO_REUSEADDR is set.
So the patchset enables SO_REUSEADDR on every TCP socket and introduces the bound address tracking which will allow to return an error from bind() when needed.
Not related to this patchset, but Winsock SO_REUSEADDR is somewhat closer to BSD SO_REUSEPORT, although is different in a way that _REUSEPORT will load balance connections between listeners while with Winsock _REUSEADDR the connections will always go to the first listener.
I hope that the bound addresses tracking introduced in these patches may be reused in the future. E. g., maybe it might be helpful on the way of implementing the todos introduced by my extended tests (those todos are not related to this patchset and exist both with and without it).
1. https://man7.org/linux/man-pages/man7/socket.7.html
--
v4: ws2_32/tests: Also test bind to any together with loopback in a different order.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1111
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50955
The problem which this patchset aims to solve is (sometimes) huge timeout on TCP listening port availability on Linux after the listening socket was closed one or another way. By default, the listening port will also be blocked for the whole time accepted socket waits through lengthy timeouts (sometimes; most surely when the listening process with an active connection was force killed, but not limited to this condition).
BSD SO_REUSEADDR socket option is aimed mainly to avoid that extra wait on binding already closed listening socket address. From [1]: "Indicates that the rules used in validating addresses supplied in a bind(2) call should allow reuse of local addresses. For AF_INET sockets this means that a socket may bind, except when there is an active listening socket bound to the address.".
Unix SO_REUSEADDR does not really allow reusing address in the Winsock sense. It will just allow to ditch the timeout (which is always the case on Windows without any specific options). Unfortunately it is not the only effect of the option. It still won't allow listening on the address simultaneously (unlike Winsock SO_REUSEADDR which allows simultaneous listening), or binding to an address which is being listened. But it will allow to bind different sockets for the same address which is not the Winsock behaviour when Winsock SO_REUSEADDR is set.
So the patchset enables SO_REUSEADDR on every TCP socket and introduces the bound address tracking which will allow to return an error from bind() when needed.
Not related to this patchset, but Winsock SO_REUSEADDR is somewhat closer to BSD SO_REUSEPORT, although is different in a way that _REUSEPORT will load balance connections between listeners while with Winsock _REUSEADDR the connections will always go to the first listener.
I hope that the bound addresses tracking introduced in these patches may be reused in the future. E. g., maybe it might be helpful on the way of implementing the todos introduced by my extended tests (those todos are not related to this patchset and exist both with and without it).
1. https://man7.org/linux/man-pages/man7/socket.7.html
--
v3: ws2_32/tests: Also test bind to any together with loopback in a different order.
server: Set Unix SO_REUSEADDR on all the TCP sockets.
server: Track SO_REUSEADDR value.
ntdll: Move SO_REUSEADDR handling to server.
ws2_32/tests: Also test TCP6 in test_so_reuseaddr().
ws2_32/tests: Add tests for reusing address without SO_REUSEADDR.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1111
Interpreting the fist two bytes of the `sockaddr` struct as `sa_family`
produces incorrect behaviour on macOS and (presumbly) BSD.
This change uses both Unix and Windows socket headers to convert the libpcap provided sockaddr before duplicating it.
This fixes sockaddr being always NULL on macOS/BSD and ipv6 addresses not working in general since `AF_INET6` differs on Windows(23), macOS(30) and Linux(10)
For reference https://www.ibm.com/docs/en/i/7.3?topic=family-af-inet-address and this is from the <sys/socket.h> on macOS
```
/*
* [XSI] Structure used by kernel to store most addresses.
*/
struct sockaddr {
__uint8_t sa_len; /* total length */
sa_family_t sa_family; /* [XSI] address family */
char sa_data[14]; /* [XSI] addr value (actually larger) */
};
```
--
v6: wpcap: Build devices in unixlib for find_all_devices.
wpcap: Split device allocation and build in find_all_devices.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1015
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50955
The problem which this patchset aims to solve is (sometimes) huge timeout on TCP listening port availability on Linux after the listening socket was closed one or another way. By default, the listening port will also be blocked for the whole time accepted socket waits through lengthy timeouts (sometimes; most surely when the listening process with an active connection was force killed, but not limited to this condition).
BSD SO_REUSEADDR socket option is aimed mainly to avoid that extra wait on binding already closed listening socket address. From [1]: "Indicates that the rules used in validating addresses supplied in a bind(2) call should allow reuse of local addresses. For AF_INET sockets this means that a socket may bind, except when there is an active listening socket bound to the address.".
Unix SO_REUSEADDR does not really allow reusing address in the Winsock sense. It will just allow to ditch the timeout (which is always the case on Windows without any specific options). Unfortunately it is not the only effect of the option. It still won't allow listening on the address simultaneously (unlike Winsock SO_REUSEADDR which allows simultaneous listening), or binding to an address which is being listened. But it will allow to bind different sockets for the same address which is not the Winsock behaviour when Winsock SO_REUSEADDR is set.
So the patchset enables SO_REUSEADDR on every TCP socket and introduces the bound address tracking which will allow to return an error from bind() when needed.
Not related to this patchset, but Winsock SO_REUSEADDR is somewhat closer to BSD SO_REUSEPORT, although is different in a way that _REUSEPORT will load balance connections between listeners while with Winsock _REUSEADDR the connections will always go to the first listener.
I hope that the bound addresses tracking introduced in these patches may be reused in the future. E. g., maybe it might be helpful on the way of implementing the todos introduced by my extended tests (those todos are not related to this patchset and exist both with and without it).
1. https://man7.org/linux/man-pages/man7/socket.7.html
--
v2: server: Set Unix SO_REUSEADDR on all the TCP sockets.
server: Track SO_REUSEADDR value.
ntdll: Move SO_REUSEADDR handling to server.
ws2_32/tests: Also test TCP6 in test_so_reuseaddr().
ws2_32/tests: Add tests for reusing address without SO_REUSEADDR.
ws2_32/tests: Make test_so_reuseaddr() more conclusive.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1111
Overwatch 2 doesn't like the win32u `-syscall` conversion that happened a while back, because it hooks KiUserCallbackDispatcher. This MR fixes it up to match what Overwatch 2 expects.
--
v2: ntdll: Pass KiUserCallbackDispatcher parameters on stack.
ntdll: Add 5-byte nop to start of KiUserCallbackDispatcher.
ntdll: Align stack pointer when calling KiUserCallbackDispatcher.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1152
--
v2: vkd3d-shader/hlsl: Propagate copies for resource store instructions.
vkd3d-shader/hlsl: Write SM4 UAV store instructions.
vkd3d-shader/hlsl: Parse UAV stores.
vkd3d-shader/hlsl: Implement typed UAV loads.
vkd3d-shader/hlsl: Write SM4 UAV declarations.
vkd3d-shader/hlsl: Allocate UAVs.
tests: Add a test for storing to a UAV array.
tests: Add more tests for UAV allocation.
tests: Fix constructor declaration in the partial UAV write test.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/36
Signed-off-by: Jinoh Kang <jinoh.kang.kr(a)gmail.com>
--
v5: server: Don't invalidate the newly exposed child region on the parent if it doesn't clip children.
server: Redraw composited window child when its z-order changes.
server: Correctly expose composited parent window and its child on position change.
https://gitlab.winehq.org/wine/wine/-/merge_requests/231
On Wed Oct 19 09:55:18 2022 +0000, Patrick Hibbs wrote:
> The same issue with strings occurs with Texture and shader types.
> I.e. Paramater is rendered irretrievable. Calling it's relevant GetXXX()
> function causes a crash if it's a scalar. Calling GetParamaterByName()
> will return an invalid handle.
Oh, interesting. GetParameterByName() failing afterwards is probably an indication that the SetRawValue() call overwrote parts of some internal data structure and broke the effect object to some degree. BTW, you're supposed to set texture parameters to a IDirect3DBaseTexture9 / IUnknown pointer (and similarly the value for a string parameter should probably be a string pointer rather than the string contents).
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/979#note_12212
On Wed Oct 19 11:26:44 2022 +0000, Patrick Hibbs wrote:
> Done in v3 of the patch.
> Should I respond to all of these if I think it's been done?
> Should I mark the thread resolved if I think it's been done, or is that
> something the reviewer should do?
Feel free to mark the threads that you think are done with as resolved (I think I can still reopen them if I happen to disagree)
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/979#note_12213
On Wed Oct 19 09:48:02 2022 +0000, Patrick Hibbs wrote:
> Actually it seems that the strings are rendered irretrievable by the
> call to SetRawValue().
> Calling GetString() on a scalar string after the destruction causes a
> crash in win10. While calling it with a string vector doesn't crash, but
> returns D3DERR_INVALIDCALL instead.
> I've updated the tests in v3 of the patch to check for this.
Ah, that explains it I guess. Weird, but not too surprising.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/979#note_12211
On Wed Oct 19 11:23:25 2022 +0000, Patrick Hibbs wrote:
> Sorry about the unexpected push, I'll be more careful next time.
> With regards to the bool fixups, are we sure we want to just write the
> raw data given to us? I ask because I've also noticed that SetRawValue()
> has a tendency to promote datatypes when given a single value and a
> vector / matrix paramater. I.e. float and int become a float4 and int4
> respectively for both vectors and matrices. (MSDN calls this behavior a
> "cast.") This results in the next 3 values in the paramater's buffer
> being set to zero.
> Assuming SetRawValue() shouldn't fix the bool values itself, should it
> also avoid fixing the ints and floats? If so, how should we indicate the
> need for a fixup to other functions? There doesn't seem to be any
> infrastructure to support that in wine currently. (We could abuse the
> paramater block support for that, but see the speculation below.)
> The float and int promotions were the reason I didn't clear the
> paramater after each test. As doing so would cause us to miss the writes
> to the next 3 values in the paramater. As they would already be set to
> zero before the call. Should I still go ahead and clear the paramaters
> after each test anyway?
> As a dirty hack, I added a call to zero out the paramaters after each
> test with a 4x4 matrix of zero ints in v3 of the test. That call is
> commented out in the push, but if you enable it it will succeed for most
> of the tests under win10. (I disabled it before I fixed the string test
> crashes. So it may work fine now, I haven't checked.) I haven't tried
> checking the paramaters after the current one for alterations. I was
> going to put that in it's own set of tests.
> This part is speculation but, if it is a valid use of SetRawValue() to
> set adjacent paramaters regardless of type with one call, then the
> entire set of paramaters for a given effect needs to be in the same
> memory block. (Which seems to be not the case in wine, as there are
> plenty of calls to heap_alloc() / heap_realloc() using the param->data
> pointer in effect.c.) That would also imply that there is a specific
> ordering of paramaters in memory as well. Which would need to be tested
> for. If this behavior is combined with the bool assumption above, then
> we'd also need to test for order of operations too.
> Assuming all of that needs to be done, how do we split this up? Because
> I have a feeling that this patchset is going to be rather large in
> scope. (If all of the assumptions and speculation are true that is.)
Unfortunately I keep being unable to reply promptly. Anyway...
> With regards to the bool fixups, are we sure we want to just write the raw data given to us? I ask because I've also noticed that SetRawValue() has a tendency to promote datatypes when given a single value and a vector / matrix paramater. I.e. float and int become a float4 and int4 respectively for both vectors and matrices. (MSDN calls this behavior a "cast.") This results in the next 3 values in the paramater's buffer being set to zero.
Is that what happens or is just the rest of the parameter being set to 0?
> Assuming SetRawValue() shouldn't fix the bool values itself, should it also avoid fixing the ints and floats?
How should they be fixed? I'm still assuming that SetRawValue() more or less does what it says i.e. it just sets the value of parameters by mere byte-for-byte copy, without any kind of conversion or fixup. Do we have evidence that's not the case?
> The float and int promotions were the reason I didn't clear the paramater after each test. As doing so would cause us to miss the writes to the next 3 values in the paramater. As they would already be set to zero before the call. Should I still go ahead and clear the paramaters after each test anyway?
It might make sense to clear them to a non-zero value (e.g. some variation of the usual 0xdeadbeef marker) to make those results more evident.
> This part is speculation but, if it is a valid use of SetRawValue() to set adjacent paramaters regardless of type with one call, then the entire set of paramaters for a given effect needs to be in the same memory block. (Which seems to be not the case in wine, as there are plenty of calls to heap_alloc() / heap_realloc() using the param->data pointer in effect.c.) That would also imply that there is a specific ordering of paramaters in memory as well. Which would need to be tested for. If this behavior is combined with the bool assumption above, then we'd also need to test for order of operations too.
Yes, that wouldn't quite work right away. It's fine to just add a FIXME() for straddling parameters for the time being, if it turns out that native actually supports that. Similarly for the test.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/979#note_12210
Also unifies hidden file handling.
Fixes bug [53826](https://bugs.winehq.org/show_bug.cgi?id=53826).
--
v7: ntdll: Try to avoid requesting the file name for a handle.
ntdll: Ensure that attributes are kept the same when renaming a file.
ntdll: Set xattr in NtCreateFile if inferred and requested attributes don't match.
ntdll: Only infer hidden attribute from file name if xattr is not present.
ntdll: Handle hidden file names in fd_get_file_info.
ntdll: Pass file path into fd_get_file_info if available.
ntdll: Do not compute file attributes for info classes that don't need them.
ntdll: Handle hidden file names inside get_file_info instead of after it.
ntdll: Do not open-code hidden file handling in get_dir_data_entry.
ntdll/tests: Add test for file attributes of files with names beginning with a dot.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1148
Also unifies hidden file handling.
Fixes bug [53826](https://bugs.winehq.org/show_bug.cgi?id=53826).
--
v5: ntdll: Ensure that attributes are kept the same when renaming a file.
ntdll: Set xattr in NtCreateFile if inferred and requested attributes don't match.
ntdll: Only infer hidden attribute from file name if xattr is not present.
ntdll: Handle hidden file names in fd_get_file_info.
ntdll: Pass file path into fd_get_file_info if available.
ntdll: Do not compute file attributes for info classes that don't need them.
ntdll: Handle hidden file names inside get_file_info instead of after it.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1148
--
v3: comctl32: Add support for adding extra data in CreatePropertySheetPage.
comctl32: Fix PROPSHEETPAGE[AW] structure content in messages and callbacks.
comctl32: Don't use PROPSHEETPAGE structure to store internal HPROPSHEETPAGE data.
comctl32: Create page if PROPSHEETPAGE was passed as HPROPSHEETPAGE to PropertySheetAW or PSM_INSERTPAGE.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1122
Based on [a patch](https://www.winehq.org/mailman3/hyperkitty/list/wine-devel@winehq.or… by Jinoh Kang (@iamahuman) from February 2022.
I removed the need for the event object and implemented fast paths for Linux.
On macOS 10.14+ `thread_get_register_pointer_values` is used on every thread of the process.
On Linux 4.14+ `membarrier(MEMBARRIER_CMD_GLOBAL_EXPEDITED, ...)` is used.
On x86 Linux <= 4.13 `madvise(..., MADV_DONTNEED)` is used, which sends IPIs to all cores causing them to do a memory barrier.
On non-x86 Linux <= 4.2 and on other platforms the fallback path using APCs is used.
--
v5: ntdll: Add thread_get_register_pointer_values-based fast path for NtFlushProcessWriteBuffers.
https://gitlab.winehq.org/wine/wine/-/merge_requests/741
Also unifies hidden file handling.
Fixes bug [53826](https://bugs.winehq.org/show_bug.cgi?id=53826).
--
v4: ntdll: Ensure that attributes are kept the same when renaming a file.
ntdll: Set xattr in NtCreateFile if inferred and requested attributes don't match.
ntdll: Only infer hidden attribute from file name if xattr is not present.
ntdll: Consistently handle dot files in file functions.
ntdll: Do not open-code hidden file handling in get_dir_data_entry.
ntdll/tests: Add test for file attributes of files with names beginning with a dot.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1148
On Tue Oct 25 21:12:39 2022 +0000, Esme Povirk wrote:
> There are two different kinds of "locking" going on here. There's
> GdipLockBitmapBits, which isn't a locking mechanism at all but a way of
> accessing bitmap data, and the mutex we have protecting Bitmap objects.
> Also, error 7 is a gdiplus Status enum value named Win32Error, not a
> win32 error code, so this isn't ERROR_ARENA_TRASHED.
> This test case is entirely single-threaded, so it's not a race
> condition. The mutex-lock isn't really involved. It seems like gdiplus
> does not account for GdipImageRotateFlip being called while a bitmap is
> bits-locked. I would guess that RotateFlip changes the location of the
> image data, invalidating the state that UnlockBits needs to function
> correctly. What "should" happen in this situation is probably that
> GdipImageRotateFlip fails with WrongState, but it seems Windows doesn't
> do that.
> The patches here bring us closer to the (broken) Windows behavior,
> although I'm really not sure how Wine will end up handling this
> situation in practice.
Ah, okay, I made a lot of assumptions, and didn't actually examine the test case. Sorry about that.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1003#note_12127
On Tue Oct 25 21:03:54 2022 +0000, Zebediah Figura wrote:
> That behaviour sounds an awful lot like gdiplus isn't thread-safe after
> all. E.g. error 7 is ERROR_ARENA_TRASHED. Should this code really have a
> lock at all?
There are two different kinds of "locking" going on here. There's GdipLockBitmapBits, which isn't a locking mechanism at all but a way of accessing bitmap data, and the mutex we have protecting Bitmap objects.
Also, error 7 is a gdiplus Status enum value named Win32Error, not a win32 error code, so this isn't ERROR_ARENA_TRASHED.
This test case is entirely single-threaded, so it's not a race condition. The mutex-lock isn't really involved. It seems like gdiplus does not account for GdipImageRotateFlip being called while a bitmap is bits-locked. I would guess that RotateFlip changes the location of the image data, invalidating the state that UnlockBits needs to function correctly. What "should" happen in this situation is probably that GdipImageRotateFlip fails with WrongState, but it seems Windows doesn't do that.
The patches here bring us closer to the (broken) Windows behavior, although I'm really not sure how Wine will end up handling this situation in practice.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1003#note_12125
On Sun Oct 23 20:06:50 2022 +0000, Esme Povirk wrote:
> I think that behavior is strange enough that we shouldn't worry about
> it, at least not until we see a real app doing this. Thank you for checking.
That behaviour sounds an awful lot like gdiplus isn't thread-safe after all. E.g. error 7 is ERROR_ARENA_TRASHED. Should this code really have a lock at all?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1003#note_12119
This is wine-7.0.1-rc1, so not ready yet to merge.
--
v5: Release 7.0.1.
gitlab: Import the gitlab CI from the master branch (devel tree)
winetest: Don't require an email if we have a URL.
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/wine/-/merge_requests/955
When we are clipping (due to fullscreen), certain operations are bugged (such as creating another window on top, grabbing the window during a size-move operation, changing mouse capture, etc) so we must temporarily unclip first.
Seems unclipping it temporarily during such operation is enough to fix this.
This probably wasn't very obvious in practice because most times "fullscreen" means a single non-resizeable window with no menus and so on (e.g. fullscreen games), but that's not always the case.
--
v2: winex11.drv: Correctly handle clipping for fullscreen windows.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1153
This is wine-7.0.1-rc1, so not ready yet to merge.
--
v4: Release 7.0.1.
gitlab: Import the gitlab CI from the master branch (devel tree)
makefiles: Add install-test target to install winetest.exe.
makedep: Make the handling of install rules more generic.
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/wine/-/merge_requests/955
Implement UiaGetUpdatedCache, as well as some UI Automation ConditionTypes.
--
v2: uiautomationcore: Add support for ConditionType_Not conditions.
uiautomationcore/tests: Add ConditionType_Property tests.
uiautomationcore/tests: Add tests for boolean UIA ConditionTypes.
uiautomationcore: Add basic UiaCondition support to UiaGetUpdatedCache.
uiautomationcore: Implement UiaGetUpdatedCache.
uiautomationcore: Add UiaGetUpdatedCache stub.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1150
When we are clipping (due to fullscreen), certain operations are bugged (such as creating another window on top, grabbing the window during a size-move operation, changing mouse capture, etc) so we must temporarily unclip first.
Seems unclipping it temporarily during such operation is enough to fix this.
This probably wasn't very obvious in practice because most times "fullscreen" means a single non-resizeable window with no menus and so on (e.g. fullscreen games), but that's not always the case.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1153