Today, the test scenario "ACTCTX_FLAG_HMODULE_VALID but hModule if not
set" is broken and unreliable. This problem is not evident in WineHQ
batch test runs; rather, the test failure seems to only be triggered
when the kernel32:actctx test is run in isolation.
When the flag ACTCTX_FLAG_HMODULE_VALID is specified in ACTCTX but
hModule is set to NULL, CreateActCtxW() may encounter different failure
modes depending on the environment and/or the test executable file.
Error codes observed so far include ERROR_SXS_CANT_GEN_ACTCTX and
ERROR_SXS_MANIFEST_TOO_BIG.
It appears that the inconsistent failure was caused by Windows trying to
interpret the main executable file of the current process as an XML
manifest file. This fails for the following reasons:
- A valid PE executable that starts with the "MZ" signature is not a
valid XML file.
- The test executable's size exceeds the limit imposed by the manifest
parser. This is much more likely for binaries with debugging symbols.
Meanwhile, winetest bundles a stripped version of the test executable
(kernel32_test-stripped.exe), which may end up masking the problem.
Fix this by changing the FullDllName of the main executable module's
LDR_DATA_TABLE_ENTRY to the pathname of a temporary manifest file (valid
or invalid) before testing. The testing is performed in a child
process, since it deliberately "corrupts" the process state.
--
v3: kernel32/tests: Fix test for ACTCTX_FLAG_HMODULE_VALID with hModule = NULL case.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2617
Today, the test scenario "ACTCTX_FLAG_HMODULE_VALID but hModule if not
set" is broken and unreliable. This problem is not evident in WineHQ
batch test runs; rather, the test failure seems to only be triggered
when the kernel32:actctx test is run in isolation.
When the flag ACTCTX_FLAG_HMODULE_VALID is specified in ACTCTX but
hModule is set to NULL, CreateActCtxW() may encounter different failure
modes depending on the environment and/or the test executable file.
Error codes observed so far include ERROR_SXS_CANT_GEN_ACTCTX and
ERROR_SXS_MANIFEST_TOO_BIG.
It appears that the inconsistent failure was caused by Windows trying to
interpret the main executable file of the current process as an XML
manifest file. Note that a valid PE executable that starts with the
"MZ" signature is not a valid XML file; furthermore, the test executable
may simply be too large for a single manifest file.
Fix this by changing the FullDllName of the main executable module's
LDR_DATA_TABLE_ENTRY to the pathname of a temporary manifest file (valid
or invalid) before testing. The testing is performed in a child
process, since it deliberately "corrupts" the process state.
--
Notes:
- Deleting the temporary file should be done by the `create_temp_manifest_file`
--
v2: kernel32/tests: Fix test for ACTCTX_FLAG_HMODULE_VALID with hModule = NULL case.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2617
Today, the test scenario "ACTCTX_FLAG_HMODULE_VALID but hModule if not
set" is broken and unreliable. This problem is not evident in WineHQ
batch test runs; rather, the test failure seems to only be triggered
when the kernel32:actctx test is run in isolation.
When the flag ACTCTX_FLAG_HMODULE_VALID is specified in ACTCTX but
hModule is set to NULL, CreateActCtxW() may encounter different failure
modes depending on the environment and/or the test executable file.
Error codes observed so far include ERROR_SXS_CANT_GEN_ACTCTX and
ERROR_SXS_MANIFEST_TOO_BIG.
It appears that the inconsistent failure was caused by Windows trying to
interpret the main executable file of the current process as an XML
manifest file. Note that a valid PE executable that starts with the
"MZ" signature is not a valid XML file; furthermore, the test executable
may simply be too large for a single manifest file.
Fix this by changing the FullDllName of the main executable module's
LDR_DATA_TABLE_ENTRY to the pathname of a temporary manifest file (valid
or invalid) before testing. The testing is performed in a child
process, since it deliberately "corrupts" the process state.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2617
The last patch is a huge optimization to what is done in patch 2. Without that the sample is first copied from GPU to CPU each time wg_transform_read_mf() locks the buffer (allocating extra linear buffer on the way) and then copies the data back to GPU. That happens even if there is no sample available from wg_transform. With the last patch there is just one memory copy to the (write-only) locked DXGI surface buffer. And CPU to GPU texture transfer (which would be there anyway in most cases on software path as most of the apps are going to get the image to GPU anyway). In principle we could also skip the explicit staging texture and use _UpdateSubresource instead directly from h264 decoder, but this is currently not supported in wined3d for chroma formats and the overall difference between _UpdateSubresource and explicit mapped staging texture is not that great probably.
--
v6: winegstreamer: Pass temporary sample to wg_transform_read_mf() in h264 decoder.
winegstreamer: Provide samples if DXGI device manager is set in h264 decoder.
winegstreamer: Process MFT_MESSAGE_SET_D3D_MANAGER in h264 decoder.
mf/tests: Test h264 decoder with dxgi device manager.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2587
The last patch is a huge optimization to what is done in patch 2. Without that the sample is first copied from GPU to CPU each time wg_transform_read_mf() locks the buffer (allocating extra linear buffer on the way) and then copies the data back to GPU. That happens even if there is no sample available from wg_transform. With the last patch there is just one memory copy to the (write-only) locked DXGI surface buffer. And CPU to GPU texture transfer (which would be there anyway in most cases on software path as most of the apps are going to get the image to GPU anyway). In principle we could also skip the explicit staging texture and use _UpdateSubresource instead directly from h264 decoder, but this is currently not supported in wined3d for chroma formats and the overall difference between _UpdateSubresource and explicit mapped staging texture is not that great probably.
--
v5: winegstreamer: Pass temporary sample to wg_transform_read_mf() in h264 decoder.
winegstreamer: Provide samples if DXGI device manager is set in h264 decoder.
winegstreamer: Process MFT_MESSAGE_SET_D3D_MANAGER in h264 decoder.
mf/tests: Test h264 decoder with dxgi device manager.
mf/tests: Increase h264data.bin video length.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2587