kernel32/tests: Remove test for ACTCTX_FLAG_HMODULE_VALID with hModule = NULL case.

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 ACTCTXW but
hModule is set to NULL, CreateActCtxW() may encounter different failure
modes depending on the test executable file.  Error codes observed so
far include ERROR_SXS_CANT_GEN_ACTCTX and ERROR_SXS_MANIFEST_TOO_BIG.

When the aforementioned test reports ERROR_SXS_CANT_GEN_ACTCTX on
Windows, an event is recorded in the Windows Event Log as follows:

- Log Name:    Application
- Source:      SideBySide
- Event ID:    59
- Level:       Error
- Description:

  Activation context generation failed for "<path..>\kernel32_test.exe".Error in manifest or policy file "<path..>\kernel32_test.exe" on line 0.
  Invalid Xml syntax.

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 due to one or more of the following reasons:

- ERROR_SXS_CANT_GEN_ACTCTX: A valid PE executable that starts with the
  "MZ" signature is not a valid XML file.

- ERROR_SXS_MANIFEST_TOO_BIG (or ERROR_NOT_ENOUGH_MEMORY): The
  executable's size may exceed the limit imposed by the manifest parser.
  This is much more likely for binaries with debugging symbols.

  Meanwhile, winetest.exe bundles a stripped version of the test
  executable (kernel32_test-stripped.exe), which is often smaller than
  the original executable (not stripped).  This probably explains why
  the problem was not visible in batch test runs.

Fix this by removing the failing test entirely.
This commit is contained in:
Jinoh Kang 2023-05-29 21:18:42 +09:00 committed by Alexandre Julliard
parent b601e3fa97
commit f0fcce14a7

View file

@ -2828,17 +2828,6 @@ todo_wine {
delete_manifest_file("testdep1.manifest");
delete_manifest_file("testdep2.manifest");
/* ACTCTX_FLAG_HMODULE_VALID but hModule is not set */
memset(&actctx, 0, sizeof(ACTCTXA));
actctx.cbSize = sizeof(ACTCTXA);
actctx.dwFlags = ACTCTX_FLAG_HMODULE_VALID;
SetLastError(0xdeadbeef);
handle = CreateActCtxA(&actctx);
ok(handle == INVALID_HANDLE_VALUE, "got handle %p\n", handle);
todo_wine
ok(GetLastError() == ERROR_SXS_CANT_GEN_ACTCTX || broken(GetLastError() == ERROR_NOT_ENOUGH_MEMORY) /* XP, win2k3 */,
"got error %ld\n", GetLastError());
/* create from HMODULE - resource doesn't exist, lpSource is set */
memset(&actctx, 0, sizeof(ACTCTXA));
actctx.cbSize = sizeof(ACTCTXA);