Match Windows behavior when locating and retrieving the assembly manifest from a DLL.
Following is the explanation as to how this MR is sufficient for supporting isolation-aware DLLs and fixing #18889.
---
From Microsoft documentation, [Using Side-by-Side Assemblies as a Resource][sxs-rsrc] outlines the significance of each reserved manifest resource ID.
Further investigation reveals the following:
1. `CREATEPROCESS_MANIFEST_RESOURCE_ID` (value: `1`): This is used for process-wide initial (`NULL`) activation context.
- **Usage documentation**: [Enabling an Assembly in an Application Without Extensions](https://learn.microsoft.com/en-us/windows/win32/sbscs/enabling-…
- **Intended container module type**: EXE only.
- **Lifetime of the associated activation context**: Alive until the process is terminated. Owned by system (NTDLL).
- **Isolation-aware**: No.
2. `ISOLATIONAWARE_MANIFEST_RESOURCE_ID` (value: `2`): This is used to specify the assembly manifest that the loader (Ldr) uses to resolve static imports. Also, this is used by isolation-aware wrappers defined in `*.inl` files included in the Windows SDK (`include\um`) when the `ISOLATION_AWARE_ENABLED` macro is defined as a nonzero value.
- **Usage documentation**: [Enabling an Assembly in an Application Hosting a DLL, Extension, or Control Panel](https://learn.microsoft.com/en-us/windows/win32/sbscs/enabling-an-as…
- **Intended container module type**: EXE and DLL.
- **Lifetime of the associated activation context**: Alive until the module is unloaded (e.g., via `FreeLibrary`). Owned by system (NTDLL).
- **Isolation-aware**: Yes.
3. `ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID` (value: `3`): Ignored by the loader when resolving static imports. This is used by isolation-aware API wrappers defined in `*.inl` files included in the Windows SDK (`include\um`) when the `ISOLATION_AWARE_ENABLED` macro is defined as a nonzero value.
- **Usage documentation**: [IsolationAwareCleanup function][IsolationAwareCleanup]
- **Intended container module type**: EXE and DLL.
- **Lifetime of the associated activation context**: Alive until the application calls [`IsolationAwareCleanup`][IsolationAwareCleanup][^ia-cleanup-note]. Owned by the isolation-aware API wrapper library (part of the Windows SDK, rather than being a system DLL).
- **Isolation-aware**: Yes.
The `ISOLATION_AWARE_ENABLED` macro is documented in [Isolating Components][sxs-ic] as well as [Specifying a Default Activation Context][sxs-def-actctx]. When `ISOLATION_AWARE_ENABLED` macro is defined as a nonzero value, then the isolation-aware API wrapper library is enabled. The isolation-aware API wrapper library is responsible for:
- Creating (lazily) and destroying activation context (in `IsolationAwareCleanup`), if the manifest resource ID is `ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID`.[^actctx-lifetime-remark]
- Note: the isolation-aware API wrapper library does not manage the activation context's lifetime and delegates the responsibility to the system loader if the manifest resource ID is `ISOLATIONAWARE_MANIFEST_RESOURCE_ID`.
- Intercepting Win32 API calls for automatic activation context activation. Each API wrapper activates the "isolation-aware" activation context (obtaining one if it did not exist) before calling the original procedure, and deactivates it before returning.
The isolation-aware wrappers may be either be defined inline, or compiled into static libraries that are linked into the final application executable.
From the information above as well as the tests included in this merge request, we can infer the following:
1. Although side-by-side awareness is a cross-cutting concern, the *activation* of activation contexts itself is *not* usually performed automatically by the system for the application (with the sole exception of process-wide activation context associated with `CREATEPROCESS_MANIFEST_RESOURCE_ID`, and static import resolution).
2. `ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID` is treated like any other resource ID (from `0x0004` to `0xffff`) as far as the loader is concerned.
3. The resource ID of the manifest only concerns how the module containing the manifest intends to use the manifest. In fact, for DLLs that do not *statically* import symbols from side-by-side assemblies, the three resource IDs above are basically equivalent. A DLL can elect not to use manifest resources at all, and manage activation context and library loading by itself.
This is why I believe that this merge request is sufficient in completing the isolation-aware component support in Wine; the heavy lifting is done in the application side, not the system.
**EDIT**: Fix a few typos and unclear wording.
---
[^ia-cleanup-note]: According to the documentation, the application is presumably responsible for calling `IsolationAwareCleanup` from `DllMain` on `fdwReason = DLL_PROCESS_DETACH`.
[^actctx-lifetime-remark]: [IsolationAwareCleanup § Remarks](https://learn.microsoft.com/en-us/previous-versions/windows/deskto…, from Microsoft documentation.
[sxs-rsrc]: https://learn.microsoft.com/en-us/windows/win32/sbscs/using-side-by-side-as…
[IsolationAwareCleanup]: https://learn.microsoft.com/en-us/previous-versions/windows/desktop/legacy/…
[sxs-ic]: https://learn.microsoft.com/en-us/windows/win32/sbscs/isolating-components
[sxs-def-actctx]: https://learn.microsoft.com/en-us/windows/win32/sbscs/specifying-a-default-…
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=18889
--
v12: ntdll: Don't hard-code DLL manifest resource ID when looking up dependency assembly.
kernel32/tests: Test loading assembly manifest resource inside dependencies.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2555
Match Windows behavior when locating and retrieving the assembly manifest from a DLL.
Following is the explanation as to how this MR is sufficient for supporting isolation-aware DLLs and fixing #18889.
---
From Microsoft documentation, [Using Side-by-Side Assemblies as a Resource][sxs-rsrc] outlines the significance of each reserved manifest resource ID.
Further investigation reveals the following:
1. `CREATEPROCESS_MANIFEST_RESOURCE_ID` (value: `1`): This is used for process-wide initial (`NULL`) activation context.
- **Usage documentation**: [Enabling an Assembly in an Application Without Extensions](https://learn.microsoft.com/en-us/windows/win32/sbscs/enabling-…
- **Intended container module type**: EXE only.
- **Lifetime of the associated activation context**: Alive until the process is terminated. Owned by system (NTDLL).
- **Isolation-aware**: No.
2. `ISOLATIONAWARE_MANIFEST_RESOURCE_ID` (value: `2`): This is used to specify the assembly manifest that the loader (Ldr) uses to resolve static imports. Also, this is used by isolation-aware wrappers defined in `*.inl` files included in the Windows SDK (`include\um`) when the `ISOLATION_AWARE_ENABLED` macro is defined as a nonzero value.
- **Usage documentation**: [Enabling an Assembly in an Application Hosting a DLL, Extension, or Control Panel](https://learn.microsoft.com/en-us/windows/win32/sbscs/enabling-an-as…
- **Intended container module type**: EXE and DLL.
- **Lifetime of the associated activation context**: Alive until the module is unloaded (e.g., via `FreeLibrary`). Owned by system (NTDLL).
- **Isolation-aware**: Yes.
3. `ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID` (value: `3`): Ignored by the loader when resolving static imports. This is used by isolation-aware API wrappers defined in `*.inl` files included in the Windows SDK (`include\um`) when the `ISOLATION_AWARE_ENABLED` macro is defined as a nonzero value.
- **Usage documentation**: [IsolationAwareCleanup function][IsolationAwareCleanup]
- **Intended container module type**: EXE and DLL.
- **Lifetime of the associated activation context**: Alive until the application calls [`IsolationAwareCleanup`][IsolationAwareCleanup][^ia-cleanup-note]. Owned by the isolation-aware API wrapper library (part of the Windows SDK, rather than being a system DLL).
- **Isolation-aware**: Yes.
The `ISOLATION_AWARE_ENABLED` macro is documented in [Isolating Components][sxs-ic] as well as [Specifying a Default Activation Context][sxs-def-actctx]. When `ISOLATION_AWARE_ENABLED` macro is defined as a nonzero value, then the isolation-aware API wrapper library is enabled. The isolation-aware API wrapper library is responsible for:
- Creating (lazily) and destroying activation context (in `IsolationAwareCleanup`), if the manifest resource ID is `ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID`.[^actctx-lifetime-remark]
- Note: the isolation-aware API wrapper library does not manage the activation context's lifetime and delegates the responsibility to the system loader if the manifest resource ID is `ISOLATIONAWARE_MANIFEST_RESOURCE_ID`.
- Intercepting Win32 API calls for automatic activation context activation. Each API wrapper activates the "isolation-aware" activation context (obtaining one if it did not exist) before calling the original procedure, and deactivates it before returning.
The isolation-aware wrappers may be either be defined inline, or compiled into static libraries that are linked into the final application executable.
From the information above as well as the tests included in this merge request, we can infer the following:
1. Although side-by-side awareness is a cross-cutting concern, the *activation* of activation contexts itself is *not* usually performed automatically by the system for the application (with the sole exception of process-wide activation context associated with `CREATEPROCESS_MANIFEST_RESOURCE_ID`, and static import resolution).
2. `ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID` is treated like any other resource ID (from `0x0004` to `0xffff`) as far as the loader is concerned.
3. The resource ID of the manifest only concerns how the module containing the manifest intends to use the manifest. In fact, for DLLs that do not *statically* import symbols from side-by-side assemblies, the three resource IDs above are basically equivalent. A DLL can elect not to use manifest resources at all, and manage activation context and library loading by itself.
This is why I believe that this merge request is sufficient in completing the isolation-aware component support in Wine; the heavy lifting is done in the application side, not the system.
**EDIT**: Fix a few typos and unclear wording.
---
[^ia-cleanup-note]: According to the documentation, the application is presumably responsible for calling `IsolationAwareCleanup` from `DllMain` on `fdwReason = DLL_PROCESS_DETACH`.
[^actctx-lifetime-remark]: [IsolationAwareCleanup § Remarks](https://learn.microsoft.com/en-us/previous-versions/windows/deskto…, from Microsoft documentation.
[sxs-rsrc]: https://learn.microsoft.com/en-us/windows/win32/sbscs/using-side-by-side-as…
[IsolationAwareCleanup]: https://learn.microsoft.com/en-us/previous-versions/windows/desktop/legacy/…
[sxs-ic]: https://learn.microsoft.com/en-us/windows/win32/sbscs/isolating-components
[sxs-def-actctx]: https://learn.microsoft.com/en-us/windows/win32/sbscs/specifying-a-default-…
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=18889
--
v11: ntdll: Don't hard-code DLL manifest resource ID when looking up dependency assembly.
kernel32/tests: Test loading assembly manifest resource inside dependencies.
ntdll: Move ACTCTX lpResourceName validation to RtlCreateActivationContext.
kernel32/tests: Test setting lpResourceName to NULL for CreateActCtxW.
kernel32/tests: Remove test for ACTCTX_FLAG_HMODULE_VALID with hModule = NULL case.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2555
How much of an heresy is this thing?
It has a negative diff count, you can't approve this! Also, it causes the HLSL compiler to emit slightly shorter and more readable TPF code. And using fewer registers.
I guess something similar should be doable for D3DBC too, though it requires some previous refactoring to have a single place where to intercept constant registers susceptible to be inlined.
--
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/215
Windows 10 [received support](https://devblogs.microsoft.com/commandline/af_unix-comes-to-window… for AF_UNIX sockets in Insider Build 17063. This merge request adds basic support for AF_UNIX sockets to ws2_32 and wineserver.
Of particular note is the difficulty in handling `sun_path`. Most of the functions that allow for translating Windows paths to Unix paths are not accessible from ws2_32. I considered the following options:
* Pass the Windows path to wineserver and do the conversion there.
* This is, as far as I can tell, not possible without major rearchitecting. wineserver does not have functions to translate Windows paths to Unix paths, for obvious reasons.
* Obtain the current working directory of the requesting process and temporarily change directories to there.
* This only handles relative paths and fails for absolute paths, UNC paths, etc.
* Conditionally change directories based on whether the path is relative or not.
* This is error-prone and wineserver does not have the requisite functions to do this cleanly.
I ultimately decided to pass the translated Unix path to wineserver, which changes directories to `dirname(path)`. It then provides `bind` and `connect` with `basename(path)`. This is not threadsafe, but wineserver is not (currently) multithreaded.
Abstract sockets are supported by this patch.
--
v9: ws2_32/tests: Add test for AF_UNIX sockets.
server: Introduce error when attempting to connect() to abstract AF_UNIX sockets.
server: Allow for deletion of socket files.
ws2_32: Add support for AF_UNIX sockets.
ntdll/unix: Add support for AF_UNIX sockets to multiple functions.
ws2_32: Add afunix.h header.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2786
Fix Cafe Stella (SteamID: 1829980) Flowchart crashes once there are 2 things on it.
--
v7: gdiplus: Support playing back pen custom end line cap.
gdiplus: Support playing back pen custom start line cap.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2870
gdip_format_string doesn't write newline characters. It writes line by line making sure to skip the newline characters. This means we can resolve this issue(at least as far gdiplus is concerned) without concerning ourselves with the issue in GetTextExtentExPointW(which should be dealt with as a different bug).
This patch implements a fix but there might be possible improvements in the code so yeah, input is most welcome.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54962
Signed-off-by: David Kahurani <k.kahurani(a)gmail.com>
--
v4: gdiplus: Handle Windows style newline.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2865
> I'd also like to see the result of getsockname() on all tested paths.
On Windows, `getsockname` returns -1 with `WSAEINVAL` when called on an AF_UNIX socket. However, the paths you delineate are all valid to `bind` to.
> What protocol do these sockets actually have? I.e. what does SO_PROTOCOL_INFO return for them? 0 is usually a wildcard.
Windows returns the following:
```
dwServiceFlags1: 0x00020026 // (XP1_GUARANTEED_DELIVERY | XP1_GUARANTEED_ORDER | XP1_IFS_HANDLES)
dwServiceFlags2: <reserved>
dwServiceFlags3: <reserved>
dwServiceFlags4: <reserved>
dwProviderFlags: 8
ProviderId: <GUID>
dwCatalogEntryId: 1007
ProtocolChain: { ChainLen: 1, ChainEntries: { 0 } }
iVersion: 2
iAddressFamily: 1
iMaxSockAddr: 110
iMinSockAddr: 2
iSocketType: 1
iProtocol: 0
iProtocolMaxOffset: 0
iNetworkByteOrder: 0
iSecurityScheme: 0
dwMessageSize: 0
dwProviderReserved: <reserved>
szProtocol: AF_UNIX
```
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2786#note_34026
On Fri May 26 18:59:04 2023 +0000, Esme Povirk wrote:
> You'll want to check the length passed in, something like `lret + 1 <
> fit` maybe. We can't assume the string is null-terminated.
Woops, sorry. I didn't think of that
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2865#note_34025
To be merged after !2906.
--
v2: wineoss: Use mmdevapi's AudioClient2.
winecoreaudio: Use mmdevapi's AudioClient2.
winealsa: Use mmdevapi's AudioClient2.
winepulse: Move AudioClient2 into mmdevapi.
wineoss: Use mmdevapi's AudioClient3.
winecoreaudio: Use mmdevapi's AudioClient3.
winealsa: Use mmdevapi's AudioClient3.
winepulse: Move AudioClient3 into mmdevapi.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2907
--
v2: wineoss: Use mmdevapi's AudioClient3.
winecoreaudio: Use mmdevapi's AudioClient3.
winealsa: Use mmdevapi's AudioClient3.
winepulse: Move AudioClient3 into mmdevapi.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2906
Some GStreamer plugins such as openh264 return spurious errors when
running the tests. They pass the tests successfull if we simply ignore
them.
It does not make much difference with returning the error, as they are
not supposed to happen anyway, and most of the time the MFT clients
don't expect or handle errors.
Split from https://gitlab.winehq.org/wine/wine/-/merge_requests/2893 as this is also orthogonal and only fixes the tests when running them with openh264, which is not the case on either the testbot or Gitlab.
--
v2: winegstreamer: Set the default H264 caps profile to "baseline".
winegstreamer: Only warn on wg_transform input buffer push errors.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2899
```c
dlls/wined3d/context_vk.c:2377:42: warning: ‘null_binding’ may be used uninitialized in this function [-Wmaybe-uninitialized]
2377 | *null_buffer_binding = b->binding = null_binding;
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
```
--
v4: wined3d: Fix uninitialized variable warning.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2892
Fix Cafe Stella (SteamID: 1829980) Flowchart crashes once there are 2 things on it.
--
v6: gdiplus: Support playing back pen custom end line cap.
gdiplus: Support playing back pen custom start line cap.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2870
See https://bugs.winehq.org/show_bug.cgi?id=54832
I'm starting to see this particular FIXME in quite a few games (Escape Goat 2, Murder Miners, and Little Racers STREET to name a few), and since I'm not sure how to fix this I figured I could at least provide a test for someone that knows more SM4 than me :P
--
v14: tests: Add a test for arrays with an expression as the index.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/189
--
v4: uiautomationcore: Call IRawElementProviderAdviseEvents methods when events are added or removed.
uiautomationcore: Implement UiaRemoveEvent.
uiautomationcore: Implement UiaAddEvent.
uiautomationcore/tests: Add tests for non-nested node events.
uiautomationcore: Fix maximum ID comparison for uia_{prop,pattern,control}_info_from_id().
https://gitlab.winehq.org/wine/wine/-/merge_requests/2884
I encountered a case where a game provides an empty fragment shader, one that disassembles to just:
```
ps_5_0
dcl_globalFlags refactoringAllowed
```
which gets translated to:
```
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main"
OpExecutionMode %main OriginUpperLeft
OpName %main "main"
%void = OpTypeVoid
%3 = OpTypeFunction %void
%main = OpFunction %void None %3
%4 = OpLabel
OpFunctionEnd
```
This patch is to detect that the OpLabel has not been terminated by a corresponding top-level return, and add it.
--
v3: vkd3d-shader/spirv: Ensure that the OpLabel emitted vkd3d_spirv_builder_begin_main_function() gets terminated.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/212
On Fri May 26 13:31:49 2023 +0000, Max Vincent Goldgamer wrote:
> That sounds perfect! What’s still missing for full wayland support in Wine?
There is still a lot of patches not merged until it will be ready. Its best to use the full downstream implementation for now.
Afaik Alexandros usually rebases his remaining downstream patches in this branch:
https://gitlab.winehq.org/afrantzis/wine/-/tree/wayland?ref_type=heads
There are also other downstream projects that might provide a collection of the wayland driver patches like wine-tkg community patches.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2712#note_33945
I encountered a case where a game provides an empty fragment shader, one that disassembles to just:
```
ps_5_0
dcl_globalFlags refactoringAllowed
```
which gets translated to:
```
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main"
OpExecutionMode %main OriginUpperLeft
OpName %main "main"
%void = OpTypeVoid
%3 = OpTypeFunction %void
%main = OpFunction %void None %3
%4 = OpLabel
OpFunctionEnd
```
This patch is to detect that the OpLabel has not been terminated by a corresponding top-level return, and add it.
--
v2: vkd3d-shader: Ensure that the OpLabel emitted vkd3d_spirv_builder_begin_main_function() gets terminated.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/212
I encountered a case where a game provides an empty fragment shader, one that disassembles to just:
```
ps_5_0
dcl_globalFlags refactoringAllowed
```
which gets translated to:
```
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main"
OpExecutionMode %main OriginUpperLeft
OpName %main "main"
%void = OpTypeVoid
%3 = OpTypeFunction %void
%main = OpFunction %void None %3
%4 = OpLabel
OpFunctionEnd
```
This patch is to detect that the OpLabel has not been terminated by a corresponding top-level return, and add it.
--
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/212
This fixes some upside-down videos in Secret of Mana. The game plays a NV12 video using MF session and EVR, then calls GetCurrentImage to get the frame RGB data and display it itself.
--
v2: evr: Respect RGB format stride in GetCurrentImage.
evr/tests: Test IMFVideoDisplayControl_GetCurrentImage orientation.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2883
> There is noting abort wine. But on wine-ce, Every thread should manages life by self. Because there are two types of threads: Native thread and Emulate thread. a thread can't manage other threads which are different type.
That sounds like the wrong approach. I'm not quite sure why you are doing it that way, but it's not something we'd want to do it in upstream Wine.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2814#note_33905
--
v5: wineoss: Use mmdevapi's AudioClient (4/4).
winecoreaudio: Use mmdevapi's AudioClient (4/4).
winealsa: Use mmdevapi's AudioClient (4/4).
winepulse: Move AudioClient into mmdevapi (4/4).
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/2855
On Fri May 26 06:04:41 2023 +0000, Alexandre Julliard wrote:
> We are not doing that on purpose, freeing the TEB before the thread is
> finished causes hard to debug crashes.
> There should only ever be one extra allocated TEB so that should be
> acceptable. What problem are you seeing exactly?
There is noting abort wine. But on wine-ce, Every thread should manages life by self. Because there are two types of threads: Native thread and Emulate thread. a thread can't manage other threads which are different type.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2814#note_33887
```\r``` style of newline seems to be getting ignored. If I have the string 'Hello \rWorld' what gets drawn is 'Hello World' so it is clearly getting ignored.
I don't know how other callbacks work the above having been observed just for ```DrawString``` but my assumption is that it would be easy to modify the callbacks to deal with ```\r``` if need be. The solution seems hacky to me so I haven't included it here.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2865#note_33841
Match Windows behavior when locating and retrieving the assembly manifest from a DLL.
Following is the explanation as to how this MR is sufficient for supporting isolation-aware DLLs and fixing #18889.
---
From Microsoft documentation, [Using Side-by-Side Assemblies as a Resource][sxs-rsrc] outlines the significance of each reserved manifest resource ID.
Further investigation reveals the following:
1. `CREATEPROCESS_MANIFEST_RESOURCE_ID` (value: `1`): This is used for process-wide initial (`NULL`) activation context.
- **Usage documentation**: [Enabling an Assembly in an Application Without Extensions](https://learn.microsoft.com/en-us/windows/win32/sbscs/enabling-…
- **Intended container module type**: EXE only.
- **Lifetime of the associated activation context**: Alive until the process is terminated. Owned by system (NTDLL).
- **Isolation-aware**: No.
2. `ISOLATIONAWARE_MANIFEST_RESOURCE_ID` (value: `2`): This is used to specify the assembly manifest that the loader (Ldr) uses to resolve static imports. Also, this is used by isolation-aware wrappers defined in `*.inl` files included in the Windows SDK (`include\um`) when the `ISOLATION_AWARE_ENABLED` macro is defined as a nonzero value.
- **Usage documentation**: [Enabling an Assembly in an Application Hosting a DLL, Extension, or Control Panel](https://learn.microsoft.com/en-us/windows/win32/sbscs/enabling-an-as…
- **Intended container module type**: EXE and DLL.
- **Lifetime of the associated activation context**: Alive until the module is unloaded (e.g., via `FreeLibrary`). Owned by system (NTDLL).
- **Isolation-aware**: Yes.
3. `ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID` (value: `3`): Ignored by the loader when resolving static imports. This is used by isolation-aware API wrappers defined in `*.inl` files included in the Windows SDK (`include\um`) when the `ISOLATION_AWARE_ENABLED` macro is defined as a nonzero value.
- **Usage documentation**: [IsolationAwareCleanup function][IsolationAwareCleanup]
- **Intended container module type**: EXE and DLL.
- **Lifetime of the associated activation context**: Alive until the application calls [`IsolationAwareCleanup`][IsolationAwareCleanup][^ia-cleanup-note]. Owned by the isolation-aware API wrapper library (part of the Windows SDK, rather than being a system DLL).
- **Isolation-aware**: Yes.
The `ISOLATION_AWARE_ENABLED` macro is documented in [Isolating Components][sxs-ic] as well as [Specifying a Default Activation Context][sxs-def-actctx]. When `ISOLATION_AWARE_ENABLED` macro is defined as a nonzero value, then the isolation-aware API wrapper library is enabled. The isolation-aware API wrapper library is responsible for:
- Creating (lazily) and destroying activation context (in `IsolationAwareCleanup`), if the manifest resource ID is `ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID`.[^actctx-lifetime-remark]
- Note: the isolation-aware API wrapper library does not manage the activation context's lifetime and delegates the responsibility to the system loader if the manifest resource ID is `ISOLATIONAWARE_MANIFEST_RESOURCE_ID`.
- Intercepting Win32 API calls for automatic activation context activation. Each API wrapper activates the "isolation-aware" activation context (obtaining one if it did not exist) before calling the original procedure, and deactivates it before returning.
The isolation-aware wrappers may be either be defined inline, or compiled into static libraries that are linked into the final application executable.
From the information above as well as the tests included in this merge request, we can infer the following:
1. Although side-by-side awareness is a cross-cutting concern, the *activation* of activation contexts itself is *not* usually performed automatically by the system for the application (with the sole exception of process-wide activation context associated with `CREATEPROCESS_MANIFEST_RESOURCE_ID`, and static import resolution).
2. `ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID` is treated like any other resource ID (from `0x0004` to `0xffff`) as far as the loader is concerned.
3. The resource ID of the manifest only concerns how the module containing the manifest intends to use the manifest. In fact, for DLLs that do not *statically* import symbols from side-by-side assemblies, the three resource IDs above are basically equivalent. A DLL can elect not to use manifest resources at all, and manage activation context and library loading by itself.
This is why I believe that this merge request is sufficient in completing the isolation-aware component support in Wine; the heavy lifting is done in the application side, not the system.
**EDIT**: Fix a few typos and unclear wording.
---
[^ia-cleanup-note]: According to the documentation, the application is presumably responsible for calling `IsolationAwareCleanup` from `DllMain` on `fdwReason = DLL_PROCESS_DETACH`.
[^actctx-lifetime-remark]: [IsolationAwareCleanup § Remarks](https://learn.microsoft.com/en-us/previous-versions/windows/deskto…, from Microsoft documentation.
[sxs-rsrc]: https://learn.microsoft.com/en-us/windows/win32/sbscs/using-side-by-side-as…
[IsolationAwareCleanup]: https://learn.microsoft.com/en-us/previous-versions/windows/desktop/legacy/…
[sxs-ic]: https://learn.microsoft.com/en-us/windows/win32/sbscs/isolating-components
[sxs-def-actctx]: https://learn.microsoft.com/en-us/windows/win32/sbscs/specifying-a-default-…
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=18889
--
v10: ntdll: Don't hard-code DLL manifest resource ID when looking up dependency assembly.
kernel32/tests: Test loading assembly manifest resource inside dependencies.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2555
--
v5: vkd3d-shader/tpf: Write out comparison mode sampler declarations and corresponding sampling instruction.
vkd3d-shader/hlsl: Parse SampleCmp() method.
vkd3d-shader/hlsl: Parse SamplerComparisonState objects.
vkd3d-shader/hlsl: Use a function table for object methods handlers.
vkd3d-shader/hlsl: Move object type checks to methods handlers.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/206
Some GStreamer plugins such as openh264 return spurious errors when
running the tests. They pass the tests successfull if we simply ignore
them.
It does not make much difference with returning the error, as they are
not supposed to happen anyway, and most of the time the MFT clients
don't expect or handle errors.
Split from https://gitlab.winehq.org/wine/wine/-/merge_requests/2893 as this is also orthogonal and only fixes the tests when running them with openh264, which is not the case on either the testbot or Gitlab.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2899