CORE-20657, CORE-13525
Fix an issue in `SetupGetBinaryField()` that made the GUI installer unable to read INF files properly.
For this reason, all the binary values in the registry on a fresh ReactOS installation were all set to `0x00`.
The reason was that the custom HEX parser in Wine's `SetupGetBinaryField()` is broken.
As a solution, we can replace it with a call to C's standard `wcstoul()` function.
(Note that Wine fixed this problem in wine-11, still with a hand-made hex-value parser...)
This replaces implementations that no longer exist in Wine-10.0's shlwapi
Also forward some exports to kernelbase_ros. This is to prevent them from being reimported from shell32, which forwards them here.
It is not exactly what Windows does (which exports the import stubs), but it should be good enough for now.
Check the OS version in the PEB to decide how to handle certain nthings.
This allows to keep NT5 backwards compatibility, even if the the code is compiled for Vista, which is needed for Wine code.
The function didn't check if `COPY_FILE_FAIL_IF_EXISTS` bit flag is set
or not, always failing if _any_ flags were set and the destination file
already existed.
This behavior was probably implemented under assumption that
`COPY_FILE_FAIL_IF_EXISTS` is the only valid flag, but it's not the case.
There are other flags, so this was breaking applications when they intend
to overwrite a file with e.g. `COPY_FILE_ALLOW_DECRYPTED_DESTINATION`.
These functions were affected by the problem:
- CopyFileEx - exposed by Total Commander not being able to overwrite file
- PrivCopyFileEx
- MoveFileWithProgress
Also cover `ERROR_ALREADY_EXISTS` returned by CreateFileW to match Windows
behavior, making the API tests pass.
CORE-10271
Use preferred memory handling on memory
shortage.
JIRA issue: N/A
- Link cppstl instead of cpprt.
- Use <new> new(std::throw) for memory
allocation.
- Return E_OUTOFMEMORY on allocation
failure.
- Don't use <stdlib.h> min macro but use
<cstdlib> __min.
VS2022 version 17.2 and later (`_MSC_VER >= 1932`) added new intrinsic
functions (`strncmp`, `strncpy`, `wcsncmp`, and `wcsncpy`).
As we implement these ourselves, we have to avoid compiler error C2169.
This problem surfaced with a recent GitHub Actions update:
https://github.com/actions/runner-images/issues/14017
Use `#pragma function(...)` to disable new intrinsic functions.
This is a termporary solution to provide part of the needed APIs from wine modules, until we have a fully working kernelbase.
This one imports from msvcrt, kernel32 and advapi32.
- Write InstallationType to registry.
- If installing as Server Core, set shell to cmd.exe.
- Rename "Product Option" to "Install Type" and adjust relevant variable names.
- Reserve Nano Server installation type for future use.
JIRA issue: CORE-20645