Initialize the calendars variable after checking if locale is NULL before using it to avoid NULL
pointer references. Fix a Excel 2016 crash when formatting dates with the custom format 'ddd'.
It calls EnumDateFormatsExEx() with the 'yi-Hebr' locale, which is added in Win10.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55099
- Define what the std handles are before inheriting them
- Check access to parent console from child through std handles
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
This allows any manifest resource IDs (e.g.,
ISOLATIONAWARE_MANIFEST_RESOURCE_ID) to be recognized when looking up
the assembly manifest of a dependency.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=18889
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.
On Windows 10 1909 ScrollConsoleScreenBufferA() returns an error if
the destination is not within the clip rectangle but still modifies the
console buffer as expected! So mark this behavior as very_broken().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54871
Currently, the free list consists of a "small list" for sizes below 256,
which are linearly spaced, and a "large list" which is manually split
into a few chunks.
This patch replaces it with a single log-linear policy, while expanding
the range the large list covers.
The old implementation had issues when a lot of large allocations
happened. In this case, all the allocations went in the last catch-all
bucket in the "large list", and what happens is:
1. The linked list grew in size over time, causing searching cost to
skyrocket.
2. With the first-fit allocation policy, fragmentation was also making
the problem worse.
The new bucketing covers the entire range up until we start allocating
large blocks, which will not enter the free list. It also makes the
allocation policy closer to best-fit (although not exactly), reducing
fragmentation.
The increase in number of free lists does incur some cost when it needs
to be skipped over, but the improvement in allocation performance
outweighs it.
For future work, these ideas (mostly from glibc) might or might not
benefit performance:
- Use an exact best-fit allocation policy.
- Add a bitmap for freelist, allowing empty lists to be skipped with a
single bit scan.
Signed-off-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Check the content of the output buffer in addition to checking the
return value.
Also show that multibyte characters are not truncated when the output
buffer is too small.
Showing that:
- load events for 64bit DLLs are generated for a WOW64 process.
- unload events for 64bit DLLs are not generated for a WOW64 process
(as any other unload event on process teardown).
- a 32bit startup exception is generated as well (with a specific exception
code)
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Today, RtlCreateActivationContext (CreateActCtxW) opens the source
manifest file via NtOpenFile without the FILE_SHARE_DELETE sharing mode.
This causes CreateActCtxW to fail if the source manifest file was
created with the FILE_DELETE_ON_CLOSE flag. FILE_DELETE_ON_CLOSE is
often used for temporary files that should be automatically deleted
after use, even if the creator process crashes.
Fix this by specifying FILE_SHARE_DELETE for sharing mode when opening
the source manifest or module file. This allows the source manifest or
module file to be marked as deleted while it is open.
Note that concurrent deletion is not an issue for the following reasons:
- The ability to read from an open file handle is unaffected by deletion
of the corresponding file's name.
- RtlCreateActivationContext does not open the source manifest or module
file by the given filename (lpSource) more than once.