Commit graph

3204 commits

Author SHA1 Message Date
Timo Kreuzer
f07ea94798 [UCRT] Fix build of memcpy_s.cpp
extern inline creates a global symbol on MSVC, but not on GCC. Use extern instead.
2025-01-22 18:56:08 +02:00
Timo Kreuzer
fea0f9243d [UCRT] Remove __inline from conversion functions
Otherwise no actual symbols will be created.
2025-01-22 18:56:08 +02:00
Timo Kreuzer
13356a9001 [VCRUNTIME] Fix _rotl64/_rotr64 inline asm
%k is only valid for 32 bit operands.
2025-01-22 18:56:08 +02:00
Timo Kreuzer
9db517f324 [UCRT] Fix definition of _alloca for GCC/Clang 2025-01-22 18:56:08 +02:00
Timo Kreuzer
61175644d0 [UCRT] Add architecturally optimized code to build 2025-01-22 18:56:08 +02:00
Timo Kreuzer
a015b91e6b [VCRUNTIME] Fix emmintrin.h for GCC 2025-01-22 18:56:08 +02:00
Timo Kreuzer
94eb475177 [UCRT][ASM] Make asm code GCC compatible 2025-01-22 18:56:08 +02:00
Timo Kreuzer
4fec953e6e [UCRT][ASM] Rename all .asm files to .s 2025-01-22 18:56:08 +02:00
Timo Kreuzer
901cd2704c [ASM] macamd64.inc: Fix up entry point macros a bit
This is the minimal version to be compatible with GAS. Code segment and NoPad could probably be added later, but they are not strictly required.
2025-01-22 18:56:08 +02:00
Timo Kreuzer
72aed01dbd [ASM] Fix up some x86 assembly code 2025-01-22 18:56:08 +02:00
Timo Kreuzer
e2ffc35894 [UCRT] Fix/improve __crt_state_management 2025-01-22 18:56:08 +02:00
Timo Kreuzer
c2b1271dbe [UCRT] Improve __crt_seh_guarded_call
This is a workaround for an MSVC compiler bug, which would result in degraded performance. See https://developercommunity.visualstudio.com/t/_local_unwind-generated-when-returning-f/10673261?
2025-01-22 18:56:08 +02:00
Timo Kreuzer
a58b713a5e [UCRT] Properly implement __crt_fast_encode/decode_pointer 2025-01-22 18:56:08 +02:00
Timo Kreuzer
c1145f0c89 [UCRT] Properly implement parameter checking macros
Partly copied from corecrt_internal_strtox.h, partly imported from dotnet runtime (https://github.com/dotnet/runtime/blob/release/8.0/src/coreclr/pal/src/safecrt/internal.h)
2025-01-22 18:56:08 +02:00
Katayama Hirofumi MZ
bb7cf5a5b7
[FREETYPE][FTFD][NTGDI] Split FT_Bitmap_Convert hack (#7628)
Our FT_Bitmap_Convert function had a hack to make the
bitmap image compatible to ReactOS. I think the hack on
FT_Bitmap_Convert should be separated from our font
engine.
JIRA issue: CORE-16047
- Add FT_Bitmap_Convert_ReactOS_Hack function, that is
  based on FT_Bitmap_Convert, and split the hack of
  FT_Bitmap_Convert.
- Use FT_Bitmap_Convert_ReactOS_Hack in
  IntGetBitmapGlyphWithCache function instead of
  FT_Bitmap_Convert.
- Modify ftfd.spec to add 
  FT_Bitmap_Convert_ReactOS_Hack.
2025-01-22 10:57:40 +09:00
Whindmar Saksit
357505e752
[PSDK] Avoid CO_E_NOTINITIALIZED macro redefinition warning (#7649)
Addendum to commit 0e88f0485c
2025-01-21 19:15:09 +01:00
Katayama Hirofumi MZ
2186ce3d58 [SHELL32][SDK] Follow-up of #7622; LPWSTR to PWSTR etc.
And LPCWSTR to PCWSTR. CORE-19278
2025-01-20 10:12:35 +09:00
Katayama Hirofumi MZ
84607161b4
[SHELL32][SHELL32_APITEST][SDK] Implement SHGetUnreadMailCountW (#7622)
Implementing missing features...
JIRA issue: CORE-19278
- Modify shell32.spec.
- Move function definition from stubs.cpp into utils.cpp.
- Add SHELL_ReadSingleUnreadMailCount helper function.
- Add prototype to <shellapi.h>.
2025-01-20 09:51:27 +09:00
Katayama Hirofumi MZ
157e18b215
[SHELL32][SHELL32_APITEST][SDK] Implement StrRStrA/W (#7621)
Implementing missing features...
JIRA issue: CORE-19278
- Move function definitions from stubs.cpp to utils.cpp.
- Add prototypes to <undocshell.h>.
2025-01-20 08:50:26 +09:00
Katayama Hirofumi MZ
aa52c3f5eb
[SHELL32][SHELL32_APITEST][SDK] Implement SHEnumerateUnreadMailAccountsW (#7619)
Implementing missing features...
JIRA issue: CORE-19278
- Move function definition from stubs.cpp into utils.cpp.
- Add prototype to <shellapi.h>.
2025-01-20 08:32:07 +09:00
Katayama Hirofumi MZ
2da2fba042
[SHELL32][SHELL32_APITEST][SDK] Implement SHSetUnreadMailCountW (#7620)
Implementing missing features...
JIRA issue: CORE-19278
- Move function definition from
  stubs.cpp into utils.cpp.
- Add prototype to <shellapi.h>.
2025-01-19 21:26:19 +09:00
Timo Kreuzer
dc25409cbf [SPEC2DEF] Implement support for debug-only exports 2025-01-19 09:02:58 +02:00
Timo Kreuzer
a6a07059c1 [CRT] crtdbg.h: Add missing inttrin.h include for __debugbreak() 2025-01-19 09:02:58 +02:00
Timo Kreuzer
8a63d7e898 [CMAKE] Build host-tools as release by default
This setting can be overwritten by defining the CMake variable HOST_BUILD_TYPE.
The target build type is passed to the host build as TARGET_BUILD_TYPE CMake variable.
This improves time to build cab+iso:
MSVC x86: 37s -> 28s
GCC x86: 32s -> 16s
2025-01-19 09:02:58 +02:00
Timo Kreuzer
7a15da2a8c [CMAKE] Fix definition of NDEBUG on MSVC release builds
Prevents redefinition warnings.
2025-01-19 09:02:58 +02:00
Timo Kreuzer
fe7a58d92e [RTL] Update CountOfOwnedCriticalSections in the TEB
Useful for debugging.
Motivation: With SMP on x64 I found a number of instances where critical sections would be left abandoned, causing lockups. From what I can tell it was exceptions inside rpcrt4, which leave the process in a blocked state. Might or might not be related to x64 / SMP.

For real value, you still need to put checks at certain places manually, but this is not super straight forward, because there can be false positives, e.g. when a process is terminated due to an exception, where the abandoned lock is acceptable, and we have this during testing. It's difficult to 100% distinguish this from silent and very bad lock leaks.

Problematic code:

    __try
    {
        SomeFunction(); // throws an exception with a CS held, e.g. heap code
    }
    __except(1)
    {
        DPRINT1("Oops. let's just pretend it's all ok!\n");
    }
2025-01-18 21:15:17 +02:00
Katayama Hirofumi MZ
dad3a0938a
[SHELL32][SHELL32_APITEST][SDK] Implement ShellExec_RunDLL (#7615)
Implementing missing features...
JIRA issue: CORE-19278
- Modify shell32.spec.
- Move function definitions
  from stubs.cpp into shlexec.cpp.
- Add prototypes to <undocshell.h>.
2025-01-17 22:51:18 +09:00
Katayama Hirofumi MZ
b68104a8a0
[SHELL32][SHELL32_APITEST][SDK] Implement SHShouldShowWizards (#7614)
Implementing missing features...
JIRA issue: CORE-19278
- Move function definition from
  stubs.cpp into utils.cpp.
- Add prototype to <undocshell.h>.
2025-01-17 13:36:20 +09:00
Katayama Hirofumi MZ
fcbcaa10a7
[SHELL32][SHELL32_APITEST][SDK] Implement SHGetUserDisplayName (#7612)
Implemementing missing features...
JIRA issue: CORE-19278
- Add netapi32 and secur32 delay importing.
- Move function definition from stubs.cpp into utils.cpp.
- Include some security headers in utils.cpp.
- Adapt <secext.h> to C++.
- Add prototype to <undocshell.h>.
2025-01-17 09:33:52 +09:00
Serge Gautherie
ee5ff8ce0c
[SDK:REACTOS] acpi.h: Update FACS and FADT types to ACPI v6.4 (#6042)
- FACS: Reduce size by 1 char.
- FADT: Add 3 new fields.
- Update reserved fields. Use offsets.
- Improve documentation.

Addendum to 0331781 (r46610).
2025-01-16 10:55:39 -08:00
Vitaly Orekhov
abe20f6120
[PSDK] Add definitions of desired Native Wi-Fi data access permissions (#7626)
The `WLAN_READ_ACCESS`, `WLAN_WRITE_ACCESS` and `WLAN_EXECUTE_ACCESS` flags are for controlling
whether we can (or not) return data via Wlan[Get|Query]* or modify via WlanSet* function families.

https://learn.microsoft.com/en-us/windows/win32/nativewifi/native-wifi-api-permissions
2025-01-16 18:25:57 +01:00
Hermès Bélusca-Maïto
381e224f6b
[SDK] Fix the automatic definition of __ROS_LONG64__ (#7576)
It is not wishable anymore to automatically define __ROS_LONG64__
whenever __WINESRC__ is defined. Indeed, Wine now has started to
introduce the possibility to "Enable compilation with long types".

Thus, for these modules we import from them, we want to be able to
define __WINESRC__ without __ROS_LONG64__ automatically defined.

Addendum to commits 89c3520c86 (r73383) and 75eeb2a7e4 (r38872).
2025-01-16 18:13:19 +01:00
Timo Kreuzer
7bb12665d6 [UCRT] Add CMake files 2025-01-16 14:18:53 +02:00
Timo Kreuzer
ef440b9aef [UCRT] Add a hack for a clang bug
See CORE-19902
2025-01-16 14:18:53 +02:00
Timo Kreuzer
42e9c80279 [UCRT] Fix definition of offsetof for clang-cl 2025-01-16 14:18:53 +02:00
Timo Kreuzer
2eb3149565 [UCRT] Make includes unix compatible 2025-01-16 14:18:53 +02:00
Timo Kreuzer
90dad446b7 [UCRT] Fix GCC build of __crt_char_traits
This is a workaround for GCC. It will disable debugging for tdupenv_s_crt.
How it works on MSVC? Magic.
2025-01-16 14:18:53 +02:00
Timo Kreuzer
693f9f51a0 [UCRT] Hack some template code, so that retarded compilers can handle it 2025-01-16 14:18:53 +02:00
Timo Kreuzer
f9dc185ede [UCRT] Use a C cast instead of const_cast for GCC
This is because GCC will generate errors for both const_cast and static_cast depending on the template parameter:
- With const_cast: error: invalid 'const_cast' from type 'std::nullptr_t' to type 'const wchar_t**'
- With static_cast: error: invalid 'static_cast' from type 'wchar_t** const' to type 'const wchar_t**'
2025-01-16 14:18:53 +02:00
Timo Kreuzer
47e3f49e52 [UCRT] No __declspec(spectre(nomitigation)) for GCC/Clang 2025-01-16 14:18:53 +02:00
Timo Kreuzer
97e20ef342 [UCRT] Fix GCC/Clang build of SSE2/AVX code
On GCC the code using extended ISA cannot be inlined and must either be marked with a function attribute or compiled with the proper target options ('-mavx2' on the command line or '#pragma GCC target("avx2")' inside the code)
2025-01-16 14:18:53 +02:00
Timo Kreuzer
51e6ce3aa7 [UCRT] Add GCC compatible __FUNCTIONW__ 2025-01-16 14:18:53 +02:00
Timo Kreuzer
589bbcaa08 [UCRT] Include intrin.h for __debugbreak() 2025-01-16 14:18:53 +02:00
Timo Kreuzer
e98e9000c7 [UCRT] Make SEH blocks ReactOS PSEH compatible 2025-01-16 14:18:53 +02:00
Timo Kreuzer
7bb9f6bf28 [UCRT] Fix GCC/Clang build of enum_system_locales_ex_nolock
Add static function for Clang.
Add missing __stdcall in a lambda for GCC.
MSVC does this automagically. See https://devblogs.microsoft.com/oldnewthing/20150220-00/?p=44623.
2025-01-16 14:18:53 +02:00
Timo Kreuzer
2cc6699f0d [UCRT] Silence warning about returning noreturn function 2025-01-16 14:18:53 +02:00
Timo Kreuzer
a21a206c89 [UCRT] Add workaround for va_arg warning about type promotion 2025-01-16 14:18:53 +02:00
Timo Kreuzer
faedd8ff75 [UCRT] Use GCC inline assembler
Clang requires the asm to be split, otherwise it complains that it doesn't have enough registers.
2025-01-16 14:18:53 +02:00
Timo Kreuzer
0cdde63c57 [UCRT] Add casts to make GCC happy 2025-01-16 14:18:53 +02:00
Timo Kreuzer
dbd58d7666 [UCRT] Fix GCC/Clang compilation of template specializations 2025-01-16 14:18:53 +02:00