This serie:
- adds a couple of msvcrt env tests (mainly env block inheritance)
- introduces env tests for ucrtbase
- reimplement most of the env related functions to mimic native
behavior (basically when env is modified, native crt uses
a per-variable entry allocation block (instead of having
pointers inside a single chunk of memory).
This fixes programs which keep a pointer on returned getenv()
string and expect that pointer content is not modified when
other variables in env are modified.
@piotr: from previous version
- I dropped the synchronization of \_environ and \_wenviron
hence requiring the duplication of most of the code in
ansi/unicode versions
- I also tested the changes with unicode crt startup code
(you can find in [1] this MR extended with this test code
but I don't think we want to push it upstream)
- there are some init code changes because of ucrtbase tests
and unicode crt startup tests
[1] https://gitlab.winehq.org/epo/wine/-/tree/mr-crt-env-full?ref_type=heads
--
v5: msvcrt: Fix ucrtbase environment initialization.
msvcrt: Allocate environment variables in separate allocation chunks.
msvcrt: Lazily initialize ___winitenv.
msvcrt: Factor out wenv_get_index helper.
msvcrt: Factor out env_get_index helper.
ucrtbase/tests: Introduce environment tests.
msvcrt/tests: Test passing environment in child process.
https://gitlab.winehq.org/wine/wine/-/merge_requests/4377
This allows initializing locale from Mac locale identifiers like
'zh-Hans-US'. The current implementation recognizes it as 'zh-US'
which isn't a valid locale identifier for Windows.
This patch will try again with the 'lang-script' identifier after
get_win_locale() fails with the 'lang-region' identifier.
--
v3: ntdll/unix: Support to initialize locale from 'lang-script' format language identifier.
ntdll/unix: Use different variable names for Mac locales.
https://gitlab.winehq.org/wine/wine/-/merge_requests/4357
Based on @rbernon's work in !1088, with additional ARM support and
some cleanups.
--
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/4445
I tested a program a user was asking about on the forum (https://forum.winehq.org/viewtopic.php?t=38192).
The program (or in fact a file called Unity.Licensing.Client.exe) looks for namespace "root\\StandardCimv2"
After adding this patch following query is done:
0024:trace:wbemprox:wbem_services_ExecQuery 00007FFB582B6660, L"WQL", L"SELECT Name,InterfaceDescription,PermanentAddress,NetworkAddresses,PNPDeviceID FROM MSFT_NetAdapter", 0x20, 0000000000000000, 00007FFFFE27DCD8
I don't know exactly what the problem is that user is experiencing, I can only tell that I'm not able to login. I provided some
dummy values for the requested properties from the MSFT_NetAdapter class but that didn't help. For now I think adding the MSFT_NetAdapter class
is not yet worth the trouble, but with this patch it is at least visible for what class the program is looking for.
The program can be found at https://unity3d.atlassian.net/wiki/spaces/AR/pages/1571848193/New+in+ArtEng…
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/4453
--
v4: vkd3d-shader/hlsl: Discern between signed and unsigned ints when parsing.
tests: Test overloads with signed and unsigned numeric values.
vkd3d-shader/hlsl: Parse integers with the 'u' postfix.
tests: Test integers with the 'u' postfix.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/478
--
v2: mshtml: Use Gecko inner window in get_clipboard_commands.
mshtml: Use Gecko inner window in get_ns_selection.
mshtml: Use Gecko inner window in HTMLXMLHttpRequestFactory_create.
https://gitlab.winehq.org/wine/wine/-/merge_requests/4444
Currently we are not properly handling register(cX) reservations for SM1, this is one of the things required for the SNK shaders (CW Bug Bug 18092).
register(cX) reservations also change the offset in the $Globals buffer in SM4, so support for this is also included.
---
Patch 1/4 is required to specify:
```
[require]
shader model < 4.0
```
so that the tests that follow do not get run with the vulkan backend on SM4. I think nobody disagreed with that patch.
--
v7: vkd3d-shader/hlsl: Turn register(cX) reservations into buffer offset for SM4.
vkd3d-shader/hlsl: Make register(cX) reservations work for SM1.
tests: Test register(cX) reservations.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/458
This serie:
- adds a couple of msvcrt env tests (mainly env block inheritance)
- introduces env tests for ucrtbase
- reimplement most of the env related functions to mimic native
behavior (basically when env is modified, native crt uses
a per-variable entry allocation block (instead of having
pointers inside a single chunk of memory).
This fixes programs which keep a pointer on returned getenv()
string and expect that pointer content is not modified when
other variables in env are modified.
@piotr: from previous version
- I dropped the synchronization of \_environ and \_wenviron
hence requiring the duplication of most of the code in
ansi/unicode versions
- I also tested the changes with unicode crt startup code
(you can find in [1] this MR extended with this test code
but I don't think we want to push it upstream)
- there are some init code changes because of ucrtbase tests
and unicode crt startup tests
[1] https://gitlab.winehq.org/epo/wine/-/tree/mr-crt-env-full?ref_type=heads
--
v4: msvcrt: Fix ucrtbase environment initialization.
msvcrt: Allocate environment variables in separate allocation chunks.
msvcrt: Lazily initialize ___winitenv.
msvcrt: Factor out env_get_index helper.
msvcrt: Factor out env_get_index helper.
ucrtbase/tests: Introduce environment tests.
msvcrt/tests: Test passing environment in child process.
https://gitlab.winehq.org/wine/wine/-/merge_requests/4377
Commit 100504d2f5 introduced using GetDpiForWindow().
Unfortunately NOTEPAD_LoadSettingFromRegistry is executed when
the main window is not yet created, resulting in
having Globals.lfFont.lfHeight=0.
This is later stored in the registry in iPointSize=0.
In a fresh wine prefix there are not yet registry values created,
therefore the first run of notepad does not show this problem,
and iPointSize is saved with a sane value to the registry.
Having Globals.lfFont.lfHeight=0 manifests for example
in cups PDF prints being a single empty page.
The check of point_size for having a non-zero value should also fix
wine prefixes which have already a stored registry value of iPointSize=0.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55852
CC: @petrathekat
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/4442
IMFMediaType_(Get|Free)Representation is called by Samurai Maiden, MFInitAMMediaTypeFromMFMediaType could be useful to simplify DMO / MFT transforms implementations.
--
v2: mfplat: Implement IMFMediaType_(Get|Free)Representation.
mfplat: Implement MFCreateAMMediaTypeFromMFMediaType.
mfplat: Implement MFInitAMMediaTypeFromMFMediaType.
mfplat: Use bits per pixel in uncompressed formats metadata.
mfplat: Only convert MEDIASUBTYPE for the formats that need it.
mfplat/tests: Add IMFMediaType_GetRepresentation tests.
mfplat/tests: Add tests for MFCreateAMMediaTypeFromMFMediaType.
mfplat/tests: Add tests for MFInitAMMediaTypeFromMFMediaType.
mfplat: Add MFInitAMMediaTypeFromMFMediaType stub.
mfplat: Add MFCreateAMMediaTypeFromMFMediaType stub.
https://gitlab.winehq.org/wine/wine/-/merge_requests/4439
Currently we are not properly handling register(cX) reservations for SM1, this is one of the things required for the SNK shaders (CW Bug Bug 18092).
register(cX) reservations also change the offset in the $Globals buffer in SM4, so support for this is also included.
---
Patch 1/4 is required to specify:
```
[require]
shader model < 4.0
```
so that the tests that follow do not get run with the vulkan backend on SM4. I think nobody disagreed with that patch.
--
v6: vkd3d-shader/hlsl: Turn register(cX) reservations into buffer offset for SM4.
vkd3d-shader/hlsl: Make register(cX) reservations work for SM1.
tests: Test register(cX) reservations.
tests: Rename register-reservations.shader_test to register-reservations-resources.shader_test.
tests/shader-runner: Run compilation tests with SM1 when SM1 models are selected.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/458
Current copy-prop of swizzle instructions can result in infinite loops,
as with the included test before this commit.
Consider the following sequence of instructions where a load is stored
in the same variable it loads:
1 : A
2 : A = @1
3 : @1.x
In this case @3 would call copy_propagation_get_value() on A.x and
would get @1, without detecting that that is indeed the same node
it is already using as swizzle->value. So it would return true,
keeping copy-prop spinning.
To avoid this, it is check that the replacement instruction is not the
same as the swizzle->load instruction.
---
This was discovered when trying to compile shaders from [Bug 19499](https://www.codeweavers.com/support/bugs/browse?cmd=bug_edit;bug_id=….
--
v2: vkd3d-shader/hlsl: Avoid replacing with swizzles to loads that come after in copy-prop.
vkd3d-shader/hlsl: Move index_instructions() up.
vkd3d-shader/hlsl: Avoid replacing with the same swizzle in copy-prop.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/482
This adds the product ids for the DualSense Edge to enable feature parity with the existing DualSense suppport.
I've tested this with the DualSense Edge hardware and these Windows games installed from Steam:
* Returnal
* Death Stranding: Director's Cut
* Overwatch 2
--
v2: hidclass.sys: Add DualSense Edge to device_strings.
mmdevapi: Override product strings for DualSense Edge.
winebus.sys: Identify DualSense Edge as a DualSense controller.
https://gitlab.winehq.org/wine/wine/-/merge_requests/4433
Here's a list of usages of `base.outer_window` that may be impacted by the change and my analysis/fixes. Note that I specifically did not look for `document->outer_window` since that one was already holding it forever, so it's out of scope for this MR (whether it's correct or not, the behavior is the same after this MR).
I also didn't consider some cases that already **did not check** for it being NULL or not, because they would have crashed earlier before anyway (they'd still crash now if outer window gets killed, but it's out of scope of the MR as I said). For those that says "Handled" it means I've added checks so that the behavior is same as before, i.e. detached inner windows behave as if outer window is NULL.
* `htmldoc.c/HTMLDocument_get_mimeType`: Changed so it doesn't rely on outer window.
* `htmldoc.c/HTMLDocument7_get_defaultView`: This is actually fixed by these patches.
* `htmlform.c/HTMLFormElement_submit`: Handled.
* `htmlstorage.c/send_storage_event`: Fixed in a separate patch with tests, since it follows the outer window.
* `htmlwindow.c/check_target_origin`: This (along with many other methods) can't have it NULL anymore or detached, since the caller must hold a ref to the outer window, and they're not called from our objects holding ref to inner window only.
* `htmlwindow.c/HTMLWindowSP_QueryService`: This uses the outer window to obtain the browser and the doc obj, so it's fine.
* `mutation.c/set_document_mode`: Handled.
* `navigate.c/BindCallbackRedirect_Redirect`: Handled.
* `navigate.c/nsAsyncVerifyRedirectCallback_OnRedirectVerifyCallback`: Handled.
* `navigate.c/nsChannelBSC_init_bindinfo`: Uses the outer window to obtain the browser and doc obj to set a flag, so it's harmless and probably correct this way.
* `navigate.c/handle_navigation_error`: Handled.
* `navigate.c/handle_extern_mime_navigation`: Handled.
* `omnavigator.c/OmHistory_get_length`: This is actually fixed by these patches.
* `script.c/ActiveScriptSite_GetItemInfo`: Handled.
* `script.c/ActiveScriptSiteWindow_GetWindow`: Handled.
--
v2: mshtml: Get rid of outer_window member in HTMLDocumentNode.
mshtml/tests: Improve the iframe navigation test.
mshtml: Remove the inner window ref from the doc only when it is actually
mshtml: Don't check for NULL outer_window from within HTMLWindow* methods.
mshtml: Don't attempt to send storage events after outer window is destroyed.
mshtml: Keep the inner window's outer_window pointer alive until it is
mshtml: Don't rely on the outer_window in document.mimeType.
https://gitlab.winehq.org/wine/wine/-/merge_requests/4380
Goes atop !471. The last six commits belong to this MR.
--
v3: vkd3d-shader/dxil: Emit constant global arrays as immediate constant buffers.
vkd3d-shader: Add a register index to struct vkd3d_shader_immediate_constant_buffer.
vkd3d-shader/spirv: Support declared component type and count in immediate constant buffers.
vkd3d-shader/spirv: Support constant initialisers in indexable temps.
vkd3d-shader/dxil: Support null constant arrays.
vkd3d-shader/spirv: Support declared component type and count in indexable temps.
vkd3d-shader/dxil: Implement the DXIL LOAD instruction.
vkd3d-shader/dxil: Implement the DXIL GEP instruction.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/477
On Windows, \Device\NamedPipe\ is the root directory of the named pipe
file system (NPFS), and can be used as RootDirectory to skip its path
when accessing the NPFS namespace.
This introduces a regression that makes it possible to use
\Device\NamedPipe (note the lack of trailing backslash) as RootDirectory
as well, since Wine does not distinguish between \Device\NamedPipe (the
device itself) and \Device\NamedPipe\ (the root directory of the
filesystem).
(Previous iteration of this patch did distinguish between the two, but the method in which it was implemented was deemed hacky.)
--
v2: server: Allow creating named pipes using \Device\NamedPipe\ as RootDirectory.
https://gitlab.winehq.org/wine/wine/-/merge_requests/498
Goes atop !471. The last six commits belong to this MR.
--
v2: vkd3d-shader/dxil: Emit constant global arrays as immediate constant buffers.
vkd3d-shader: Add a register index to struct vkd3d_shader_immediate_constant_buffer.
vkd3d-shader/spirv: Support declared component type and count in immediate constant buffers.
vkd3d-shader/spirv: Support constant initialisers in indexable temps.
vkd3d-shader/dxil: Support null constant arrays.
vkd3d-shader/spirv: Support declared component type and count in indexable temps.
vkd3d-shader/dxil: Implement the DXIL LOAD instruction.
vkd3d-shader/dxil: Implement the DXIL GEP instruction.
vkd3d-shader/dxil: Support global variable initialisers.
vkd3d-shader/dxil: Introduce a value type for immediate constant buffers.
vkd3d-shader/dxil: Implement default address space global variables.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/477
This adds the product ids for the DualSense Edge to enable feature parity with the existing DualSense suppport.
I've tested this with the DualSense Edge hardware and these Windows games installed from Steam:
* Returnal
* Death Stranding: Director's Cut
* Overwatch 2
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/4433
So far this MR is just for experimentation, do not review it.
--
v16: ci: Execute the shader runner on the correct test data on Windows.
ci: Deduplicate the CI configuration for Windows.
Test.
Empty.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/474
> Likely not? A script name isn't required and isn't set by macOS for all the languages. For example, the script name is none if the system language is 'English (US)'.
If there's no script then of course you can't use it, but if there is one you should.
> I am not sure what locale should I assign to user_locale in the case of 'zh-Hans-US', 'zh-Hans' isn't a valid locale for both Linux and macOS. Should I reset it to 'C'?
user_locale is a Windows locale, `zh-Hans` should be OK.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/4357#note_52826
On Mon Nov 20 07:42:00 2023 +0000, Alexandre Julliard wrote:
> You most likely want to always use the script, not only for unknown locale.
> For unknown countries we should probably fall back to neutral locale in
> all cases.
> Also the user_locale variable needs to be updated.
Hi Alexandre,
> You most likely want to always use the script, not only for unknown locale.
>
Likely not? A script name isn't required and isn't set by macOS for all the languages. For example, the script name is none if the system language is 'English (US)'.
> For unknown countries we should probably fall back to neutral locale in all cases.
>
> Also the user_locale variable needs to be updated.
I am not sure what locale should I assign to user_locale in the case of 'zh-Hans-US', 'zh-Hans' isn't a valid locale for both Linux and macOS. Should I reset it to 'C'?
Thanks
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/4357#note_52825
--
v2: vkd3d-shader/hlsl: Allow non-numeric types in the ternary operator.
vkd3d-shader/hlsl: Separate an add_ternary() helper.
tests: Add many more tests for ternary expressions.
vkd3d-shader/hlsl: Do not try to lower ternaries of types other than scalar or vector.
vkd3d-shader/hlsl: Remove a redundant definition of the "float" type.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/463
Makes sense. I'd mostly just advocate for documenting the answer in some form, even if that's "this function gives undefined results if dynamically indexed resource arrays are used". It's true that's not very useful to the consumer, though.
--
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/466#note_52772
When using native xinput in WRC9, vccorlib is needed to make sure xinput doesn't crash.
--
v2: wincorlib: Add stub for platform_details_uninit_data.
wincorlib: Add stub for platform_details_init_data.
vccorlib140: Add stub dll.
wincorlib: Add stub dll.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3334
Fixes a race condition and crashes in Secret of Mana.
The queue critical section is held in video_presenter_sample_present
while GetCurrentImage only locks the presenter CS. Double locking is
tricky and atomic operation is appropriate to swap the sample pointer.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/4426
On Sat Oct 21 15:00:08 2023 +0000, Jinoh Kang wrote:
> > Regarding dropping the null check, I think the common rule in Wine is
> to check the allocations. I'd personally would agree that in many cases
> just skipping the check and crashing would make more sense than putting
> code for any handling the error just anyhow, but I am just following
> what I think is the rule here.
> Well, that rule sounds absurd and contradictory.
> 1. We should check for NULL.
> 2. Except NULL doesn't happen much in practice, so we shouldn't really
> check for NULL anyway.
> Correct me if I'm wrong, I don't think such rule (pretend to check for
> NULL) has ever been in enforcement for upstream patches. In fact, I've
> got https://gitlab.winehq.org/wine/wine/-/merge_requests/3324 upstreamed
> before; not sure if this generalizes to this case too.
> Otherwise, is `assert()`-ing an option?
> > or, in case of miraculous getting memory back,
> This could be more probable than you think. For example, another thread
> might momentarily allocate a large amount of memory (towards RSS/VM
> ulimit) and then free it. If we race, we'll get a spontaneous
> allocation failure.
> > it will get an error anyway being unable to find it (both errors,
> ERROR_OUT_OF_MEMORY or what it would get, are not the correct result anyway).
> Depends on how the app handles the error; for example, it could retry on
> ERROR_OUT_OF_MEMORY but not whatever NXDOMAIN is. Also, the behavior
> (3) has additional side effect of potentially generating a packet over a
> network, in a program that would not otherwise emit any packets (it only
> resolves "127.0.0.1").
> Granted, you're not making the rules here, and existing wine code
> doesn't strictly abide by graceful allocation failure handling either.
> I was merely puzzled by how such confusing rule is in place.
For future reference: NULL check has been dropped in master.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/4152#note_52757
The current implementation based on `IOPMCopyBatteryInfo` does not work (macOS 13.2, M2 Max, returns `kIOReturnUnsupported`) and is not recommended/supported by Apple:
> WARNING! IOPMCoyBatteryInfo is unsupported on ALL Intel CPU based systems. For PPC CPU based systems, it remains not recommended. For almost all purposes, developers should use the richer IOPowerSources API (with change notifications) instead of using IOPMCopyBatteryInfo. Keys to decipher IOPMCopyBatteryInfo's return CFArray exist in IOPM.h.
--
v13: ntdll: Use IOPowerSources API to fill battery info on macOS
https://gitlab.winehq.org/wine/wine/-/merge_requests/2283