Fixes a regression introduced by
aa8f97e8294b0618de0e8a45ff2adef0c4e516da.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54184
For the requests which involve additional data to be sent the application might use WinHttpWriteData() before WinHttpReceiveResponse() to pass the additional request data instead of providing the optional data to WinHttpSendRequest(). In that case server reply can't be read in send_request().
I believe the first patch straightens up state handling in receive_response() by introducing a single switch processing every incoming state and avoiding additional local variable (along with making WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE notification handling less obscure).
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1851
init_argv0_dir has conditional code for different operating systems. In
case of FreeBSD a variable remains uninitialized in the error case, yet
is then used. Fix that by handling the error case.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1848
Fixes a regression introduced by
cbfe940a1eaf5e158de3127b1265462bfbfb70af.
Might be related to https://bugs.winehq.org/show_bug.cgi?id=54055, I don't yet have the confirmation but this is something probably worth fixing regardless.
lpszAutoConfigUrl is used whenever WINHTTP_AUTOPROXY_CONFIG_URL is specified, regardless of WINHTTP_AUTOPROXY_AUTO_DETECT presence. Before cbfe940a1eaf5e158de3127b1265462bfbfb70af NULL lpszAutoConfigUrl went directly to GetAddrInfoW(). Now with the timeout it is relayed to aync name resolution thread and might be crashing in wcsdup(). It doesn't happen all the time as we might not be reaching download_script() at all due to prior WinHttpDetectAutoProxyConfigUrl() legitimate failure.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1845
They fail on the Gitlab CI. An alternative would be to mark them
todo_wine but it's not clear that there's anything we want to do here.
--
v2: d3d9/tests: Mark some of the depth bias tests as todo.
d3d9/tests: Mark a zero-size pixel test as todo.
d3d8/tests: Mark a zero-size pixel test as todo.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1824
I have an AMD Ryzen 7 5700U, which when my system was running Mesa 22.0.4 identified itself in `glxinfo` as:
```
Vendor: AMD (0x1002)
Device: AMD RENOIR (LLVM 13.0.1, DRM 3.47, 5.19.17) (0x164c)
```
After a recent system upgrade that took Mesa to 22.2.3, `glxinfo` now gives:
```
Vendor: AMD (0x1002)
Device: RENOIR (renoir, LLVM 14.0.6, DRM 3.48, 6.0.12) (0x164c)
```
Wine programs also started reliably crashing on me, with the following message that did not appear before:
```
0130:fixme:d3d:wined3d_guess_card_vendor Received unrecognized GL_VENDOR "AMD". Returning HW_VENDOR_NVIDIA.
```
I don't really know what I'm doing but that message suggested this patch to me, which does resolve the crashes and doesn't seem obviously wrong. Maybe there's some other table to which the new identifying information of this APU needs to be added, but keeping this check for future-proofing might still be a good idea in that case?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1837
Wine-Bug: https://bugs.winehq.org//show_bug.cgi?id=53525
--
v3: dinput/tests: Remove unnecessary goto and label.
dinput/tests: Wait for each device interface to start / stop.
dinput/tests: Add a device count parameter to hid_device_(start|stop).
dinput/tests: Use semaphores to count and notify rawinput messages.
dinput/tests: Avoid using INFINITE timeouts.
dinput/tests: Remove old physical joystick tests.
dinput/tests: Unregister rawinput devices after tests.
hidclass.sys: Make sure a desktop is created for the driver process.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1842
Wine-Bug: https://bugs.winehq.org//show_bug.cgi?id=53525
--
v2: dinput/tests: Wait for each device interface to start / stop.
dinput/tests: Add a device count parameter to hid_device_(start|stop).
dinput/tests: Use semaphores to count and notify rawinput messages.
dinput/tests: Avoid using INFINITE timeouts.
dinput/tests: Remove old physical joystick tests.
dinput/tests: Unregister rawinput devices after tests.
hidclass.sys: Make sure a desktop is created for the driver process.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1842
This was previously automatically done when user32 was loaded, but since
the move of __wine_send_input to win32u, we do not need to load it any
more. Somehow it is still loaded when prefix is initialized or updated,
and the dinput tests work in some cases, but not in some other.
This makes sure we have a desktop or WM_INPUT messages won't be sent by
wineserver.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1841
On Mon Dec 19 11:04:02 2022 +0000, Ziqing Hui wrote:
> Testbot complains about too much printing. Should I remove some tests?
> For example, test only one input type for SetOutputType tests.
I'd suggest to shorten the test messages, like for instance `SetOutputType returned unexpected hr 0x80004001 for flag 0.` shorten to `0x0: SetOutputType returned 0x80004001.` with wine_push_context for the flags, or as an even more extreme measure, if necessary, `0x0: got hr 0x80004001.`.
If that's not enough then yes, you can probably think about removing some tests.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1839#note_19835
If a hlsl_ir_load loads a variable whose components are stored from different
instructions, copy propagation doesn't replace it.
But if all these instructions are constants (which currently is the case
for value constructors), the load can be replaced with a constant value, which
is what the first patch of this series does.
For instance, this shader:
```
sampler s;
Texture2D t;
float4 main() : sv_target
{
return t.Gather(s, float2(0.6, 0.6), int2(0, 0));
}
```
results in the following IR before applying the patch:
```
float | 6.00000024e-01
float | 6.00000024e-01
uint | 0
| = (<constructor-2>[@4].x @2)
uint | 1
| = (<constructor-2>[@6].x @3)
float2 | <constructor-2>
int | 0
int | 0
uint | 0
| = (<constructor-5>[@11].x @9)
uint | 1
| = (<constructor-5>[@13].x @10)
int2 | <constructor-5>
float4 | gather_red(resource = t, sampler = s, coords = @8, offset = @15)
| return
| = (<output-sv_target0> @16)
```
and this IR afterwards:
```
float2 | {6.00000024e-01 6.00000024e-01 }
int2 | {0 0 }
float4 | gather_red(resource = t, sampler = s, coords = @2, offset = @3)
| return
| = (<output-sv_target0> @4)
```
This is required to write texel_offsets as aoffimmi modifiers in the sm4 backend, since it expects the texel_offset arguments to be hlsl_ir_constant.
This series also:
* Allows Gather() methods to use aoffimmi modifiers instead of an additional source register (which is the only way allowed for shader model 4.1), when possible.
* Adds support to texel_offsets in the Load() method via aoffimmi modifiers (the only allowed method).
--
v5: vkd3d-shader/hlsl: Propagate swizzle chains.
vkd3d-shader/hlsl: Replace swizzles with constants in copy prop.
tests: Test constant propagation through swizzles.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/51
Zebediah Figura (@zfigura) commented about dlls/kernelbase/path.c:
> */
> HRESULT WINAPI UrlFixupW(PCWSTR url, PWSTR translatedUrl, DWORD maxChars)
> {
> - DWORD srcLen;
> + DWORD srcLen, dstLen, len;
> + DWORD colon_pos = 0, pos = 0;
> + wchar_t *helper_str = NULL;
> + PWSTR save_str = translatedUrl;
We use WCHAR, not wchar_t.
It'd also be nice to use a consistent style for all of variable names in this function (wrt snake case vs camel case). In new code I think we prefer snake case.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1825#note_19808
Zebediah Figura (@zfigura) commented about dlls/kernelbase/path.c:
> + * First check for known, valid and typo free scheme
> + */
> + for (pos=1; pos<ARRAY_SIZE(url_scheme); pos++)
> + {
> + len = wcslen(url_scheme[pos]);
> + if ( (len <= wcslen(url)) && (!_wcsnicmp(url, url_scheme[pos], len)) )
> + {
> + /*
> + * check if string fits into maxChars
> + */
> + if (len+1 >= maxChars)
> + return S_FALSE;
> +
> + lstrcpynW(save_str, url_scheme[pos], len+1);
> + url += len;
> + goto scheme_done;
Can we use a helper function to fix up the scheme instead of using a goto? This will probably also help make the function easier to follow, by virtue of being less monolithic.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1825#note_19809
Zebediah Figura (@zfigura) commented about dlls/kernelbase/path.c:
>
> -HRESULT WINAPI UrlFixupW(const WCHAR *url, WCHAR *translatedUrl, DWORD maxChars)
> +/*
> + * from Documentation:
> + * https://docs.microsoft.com/en-us/windows/desktop/api/shlwapi/nf-shlwapi-url…
> + *
> + * UrlFixupW attempts to correct a URL whose protocol identifier is incorrect.
> + * For example, htttp will be changed to http.
> + *
> + * LWSTDAPI UrlFixupW(
> + * [in] PCWSTR pcszUrl,
> + * [out] PWSTR pszTranslatedUrl,
> + * DWORD cchMax
> + * );
> +*/
> +HRESULT WINAPI UrlFixupW(PCWSTR url, PWSTR translatedUrl, DWORD maxChars)
Without trying to get bogged down in style, this change is somewhat counterproductive; we tend to avoid P* typedefs in new code, and we also have been abandoning the use of "documentation" style headers, which rarely convey any useful information.
(This also doesn't really belong in a commit which should only affect tests.)
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1825#note_19805
On Sun Dec 18 23:01:30 2022 +0000, Zebediah Figura wrote:
> Hi Thomas, thanks for the patch!
> We want the tests to "pass" after every commit, i.e. have no failures.
> That may mean, in this case, introducing the tests marked as todo, and
> then later removing those todos.
Ok. Got it. Will do it soon
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1825#note_19804
Hi Thomas, thanks for the patch!
We want the tests to "pass" after every commit, i.e. have no failures. That may mean, in this case, introducing the tests marked as todo, and then later removing those todos.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1825#note_19803
Setting the return type of various wined3d refcounting functions to void
These patches modify:
- wined3d_incref
- wined3d_decref
- wined3d_resource_incref
- wined3d_resource_decref
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1755
On Sat Dec 17 10:41:32 2022 +0000, Etaash Mathamsetty wrote:
> I also think you should squash c4e27bd0483c0a1fb872111b6c03b9ad240d85da
> (mark tests as todo) and d02be967f9cca0805b5eeaef6a74b3ec51a67619 (add
> tests) into one commit
I can do so, but before semi stub implementation even more tests are failing. See description. Should i squash mark all tests as todo and remove the markers with semi stub commit? Thanks for your help.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1825#note_19792
Revision 24b26f8bd6a49c855eec417a6585d44c9458e3ec changed FreeBSD
(and DragonFly) not to use /proc any longer. Hence we also do not
need the exe_link variable on those two platforms, either. Avoid
declaring it there.
(This avoids a compiler warning about an unused variable with GCC 12.)
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1833
find_device_from_devnode was unnecessarily guarded by HAVE_SYS_INOTIFY_H,
alas its use in process_monitor_event was not, so linking failed. Simply
make find_device_from_devnode generally available.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1831
On Thu Dec 15 20:00:54 2022 +0000, Etaash Mathamsetty wrote:
> you should mark them as todo in the code for the tests then
I can do so, but before semi stub implementation even more tests are failing. See description. Should i squash mark all tests as todo and remove the markers with semi stub commit? Thanks for your help.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1825#note_19782
find_device_from_devnode was guarded by HAVE_SYS_INOTIFY_H, alas its
use in process_monitor_event was not, so linking failed.
On the way reduce the scope of a variable (which makes sense per se
and avoids introducing a compiler warning with this change).
--
v3: winebus.sys: Fix the build without HAVE_SYS_INOTIFY_H
https://gitlab.winehq.org/wine/wine/-/merge_requests/1810
The check was dropped in e392e0ac2846edc25610723c19d6a796372017e1, leaving the dwFlags variable unused.
I have no idea if it was indeed unnecessary or if it was dropped by mistake but either we need to keep the check, or we should remove the variable.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1828
It looks like the behavior changes when only this test is run vs when it
is run as part of the winetest suite.
This is probably because ChangeDisplaySettingsExW only sends the message
the first time it is called (since boot?).
Having other tests run before it, one of them probably changed display
settings already and we're not getting the message anymore.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53894
--
v2: user32/tests: Use %d to print last_bpp instead of %u.
user32/tests: Don't expect WM_DISPLAYCHANGE with the default display mode.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1829
It looks like the behavior changes when only this test is run vs when it
is run as part of the winetest suite.
This is probably because ChangeDisplaySettingsExW only sends the message
the first time it is called (since boot?).
Having other tests run before it, one of them probably changed display
settings already and we're not getting the message anymore.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53894
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1829
Some applications have a `<name>.exe.config` file with the element
`<probing>` to specify additional directories to search for assemblies. As
it is not handled in wine, these applications fail to load.
To keep this commit simple, it only supports probing. The other parts of
the application configuration file are unimplemented.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1827
## Summary
Tests for UrlFixupW and semi stub function implementaion.
## Test results
- Tests are 100% ok on my local WIN 10 pc. Wine test bot seems to be okay too.
- Wine tests on debian machine
| function type | result |
| ------ | ------ |
| stub | 0020:url: 69802 tests executed (0 marked as todo, 0 as flaky, **200** failures), 0 skipped. |
| semi stub| 0020:url: 69802 tests executed (0 marked as todo, 0 as flaky, **100** failures), 0 skipped. |
## Todos
For follow up merge request(s).
- [ ] Add more tests for priority investigation, who url scheme fix up is working on windows.
- [ ] Implement missing parts of fix up.
## Conclusion
Semi stub implementation is an improvement to the existing solution. A grep showed that wine internals do not call this function, therefore it should not introduce any new bugs. Windows applications using/relying on the function should now work better, if not they may reveal already existing bugs.
--
v2: shlwapi/tests: Mark tests as todo for UrlFixupW.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1825
## Summary
Tests for UrlFixupW and semi stub function implementaion.
## Test results
- Tests are 100% ok on my local WIN 10 pc. Wine test bot seems to be okay too.
- Wine tests on debian machine
| function type | result |
| ------ | ------ |
| stub | 0020:url: 69802 tests executed (0 marked as todo, 0 as flaky, **200** failures), 0 skipped. |
| semi stub| 0020:url: 69802 tests executed (0 marked as todo, 0 as flaky, **100** failures), 0 skipped. |
## Todos
For follow up merge request(s).
- [ ] Add more tests for priority investigation, who url scheme fix up is working on windows.
- [ ] Implement missing parts of fix up.
## Conclusion
Semi stub implementation is an improvement to the existing solution. A grep showed that wine internals do not call this function, therefore it should not introduce any new bugs. Windows applications using/relying on the function should now work better, if not they may reveal already existing bugs.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1825
Testing: kernel32:debugger, there's sometimes the following error:
debugger.c:1760: Test failed: unexpected instruction pointer 778B2A0C
Current test code has a workaround when this happens on last thread, but
this is clearly not sufficient.
Fix the test so that it grabs the thread context only in a place we're
sure it's in stopped state at breakpoint instruction.
(Current code likely catches cases where the thread is in bp signal
handling).
Rewrote the test to be in more logical order.
Wine-bug: https://bugs.winehq.org/show_bug.cgi?id=53143
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1823
The compiler may optimize out the assignment before free and then
second free on the bcrypt handle finds magic values in the freed memory.
--
v2: bcrypt: Use SecureZeroMemory() to zero magic values before free.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1821
--
v3: bcrypt/tests: Test BCRYPT_PAD_NONE encryption result in test_rsa_encrypt().
bcrypt: Use privkey if pubkey is absent in key_asymmetric_encrypt().
bcrypt: Return correct error from key_asymmetric_encrypt() if key is missing.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1820