Commit Graph

965 Commits

Author SHA1 Message Date
Timo Kreuzer
e5bf20d865 [USER32_APITEST] Fix stack corruption
Found by /RTC1
2026-04-24 14:17:58 +00:00
Max Korostil
feb9febaae [WIN32KNT_APITEST][NTUSER] Fix NtUserConvertMemHandle BSOD (#7878)
Fix NtUserConvertMemHandle BSOD.

JIRA issue: CORE-18121
2026-04-12 19:10:34 -05:00
Justin Miller
e68ebe19c6 [NTDLL] Revert Implict ThreadLocalStorage for now (#8823)
We will continue with this stuff when we can understand the root issues better

* Revert "[NTDLL_APITEST] Relicense implicit tls tests as MIT"

This reverts commit ec6bae2b31.

* Revert "[NTDLL:LDR] Add Implicit Thread Local Storage Support (#7594)"

This reverts commit 23043ce0b8.
2026-04-01 13:56:00 +02:00
Carl J. Bialorucki
ec6bae2b31 [NTDLL_APITEST] Relicense implicit tls tests as MIT
Approval from original author given to Carl Bialorucki in writing.
2026-03-31 16:56:51 +02:00
Shane Fournier
23043ce0b8 [NTDLL:LDR] Add Implicit Thread Local Storage Support (#7594)
Before Windows Vista, TLS directories were ignored by Ldr* in any module loaded after process creation, which meant that the TLS index in any delay-loaded module remained 0. This means that when running an application targeting Vista and above and its delay-load modules have TLS directories, the following events can happen:

    One or more delay-load modules claim ThreadLocalStoragePointer idx 0, resulting in data corruption and possible buffer overflows as data intended for one of the immediate-load modules is overwritten.

    None of the immediate-load modules has a TLS directory, so ThreadLocalStoragePointer is not initialized. This means that the program crashes when one of the delay-load modules attempts to access its TLS data.

Adding implicit TLS support improves support for NT 6.x/10 user-mode applications, including all contemporary major web browsers.

JIRA issue: CORE-19413

---------

Co-authored-by: Justin Miller <justin.miller@reactos.org>
2026-03-31 11:21:57 +00:00
Hermès Bélusca-Maïto
e4aaf68c2d [KERNEL32][KERNEL32_APITEST] Remove trailing whitespaces
Addendum to commit 5e998de248.
2026-03-30 13:54:37 +02:00
Julen Urizar Compains
5e998de248 [KERNEL32][KERNEL32_APITEST] Fix the pipe buffer overflow situation into Iosb.Status in the ReadFile (#6724)
Change the way ReadFile and NTReadFile behaves under ReactOS, and fit more what Wine does. Fixes Calibre conversion failure. JIRA issue: CORE-17376
2026-03-30 12:01:28 +02:00
Hermès Bélusca-Maïto
a4621bb280 [NTOS:PS][NTDLL_APITESTS] Implement ThreadNameInformation for NtQuery/SetInformationThread() (#8484)
The `ThreadNameInformation` (#38) class is the Windows 10.1607+ way
of assigning a human-readable name (i.e. description) to a given
thread object, that is visible to debuggers and diagnostic tools
(e.g. WinDbg `!thread` command, Process Explorer ...), which is
useful for debugging scenarios.[^1]

Before this, the only way to assign a name to a thread for debugging
purposes was to raise a specific exception, that had to be caught and
interpreted by a supported debugger.[^2][^3]

When the thread object is being deleted (`kill.c!PspDeleteThread()`),
free the thread name if set (courtesy of Ahmed Arif, PR #8796).

References:
[^1]: https://learn.microsoft.com/en-us/visualstudio/debugger/tips-for-debugging-threads
[^2]: https://learn.microsoft.com/en-us/archive/blogs/stevejs/naming-threads-in-win32-and-net
[^3]: https://ofekshilon.com/2009/04/10/naming-threads/
2026-03-29 19:35:34 +02:00
Hermès Bélusca-Maïto
401f3a8a79 [NTDLL_APITEST] Add a test for Nt[Query|Set]InformationThread(ThreadNameInformation) (#8484)
Thanks to 'artDev', 'HP-12C', and 'julenuri' Discord contributors for their help!
2026-03-29 16:52:31 +02:00
Hermès Bélusca-Maïto
2e1a0b73c9 [NTDLL_APITEST][NTOS:PS] Adjust probelib.c test code to skip non-implemented Win7+ thread information classes
Re-enable in ps_i.h the stubbed probing info values for thread information
classes, that were disabled in commit 60aad33ed0 (PR #8487), and adjust
the test code in probelib.c so that the failures for these non-implemented
classes are correctly taken into account.
2026-03-29 16:52:07 +02:00
Hermès Bélusca-Maïto
a2a434e8d5 [NTDLL_APITEST] Minor formatting for probelib.c 2026-03-29 16:52:06 +02:00
Carl J. Bialorucki
20d322fcdc [USER32_APITEST_MENUUI] Don't let rosautotest wait on a test list from user32_apitest_menuui.exe (#8469)
- [USER32_APITEST_MENUUI] Return an empty test list when called with --list
NOTE: The better way to fix this is to move this executable to \reactos\bin\suppl. But that requires some refactoring of tests already in our source tree.
2026-03-23 18:32:52 -05:00
Hermès Bélusca-Maïto
dc8f9b8671 [SDK_APITEST] Revert "Fix initializing global variables" commit; improve the delayimp_apitest (#8462)
CORE-10935

- This reverts commit 522e9f6dd3.

- Implement Mark's suggestion given in PR #7784,
  https://github.com/reactos/reactos/pull/7784#pullrequestreview-2722604928

  Build three binary versions of the delayimp_apitest, named:
  delayimp_nohook_apitest, delayimp_globalhook_apitest, and delayimp_runtimehook_apitest,
  that respectively are:

  - "nohook": delayload is used, but neither of the hook/failurehook is defined;
  - "globalhook": delayload is used, and the hooks are assigned at global scope;
  - "runtimehook": delayload is used, and the hooks are assigned at runtime.

- Since the delayimp apitests are self-contained, don't use the separate
  testlist.c file. It is temporarily unused, until other SDK-specific tests
  are added in this directory.

## Testing observations:

GCC build (tested with KVM x86): binutils doesn't create specification-compliant
`IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT` table for delay-loaded imports, and as a
result, the tests show:
```
delayimp.cpp:472: Tests skipped: No IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT found,
  some advanced features might not work!
```
Additionally, both `SymGetOptions` and `MapAndLoad` tests are skipped "until
CORE-6504 is fixed", as claimed. _**This doesn't happen for MSVC builds.**_
2026-03-22 17:14:40 +01:00
Hermès Bélusca-Maïto
67e331a88d [DBGHELP_APITEST] Revert "Fix initializing global variables" commit (#8462)
This reverts commit 522e9f6dd3.
2026-03-22 16:57:46 +01:00
Timo Kreuzer
63c4a85d76 [NTDLL_APITEST] Suppress GCC 13 infinite-recursion warning
Suppress warning about infinite recursion, because that is the whole point of this test.

C:/ReactOS/reactos/modules/rostests/apitests/ntdll/StackOverflow.c: In function 'infinite_recursive':
C:/ReactOS/reactos/modules/rostests/apitests/ntdll/StackOverflow.c:23:1: error: infinite recursion detected [-Werror=infinite-recursion]
   23 | infinite_recursive(void)
      | ^~~~~~~~~~~~~~~~~~
C:/ReactOS/reactos/modules/rostests/apitests/ntdll/StackOverflow.c:58:5: note: recursive call
   58 |     infinite_recursive();
      |     ^~~~~~~~~~~~~~~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
e8df04f413 [CRT_APITEST] Don't compare arrays against NULL.
Fixes GCC 13 warning:

C:/ReactOS/reactos/modules/rostests/apitests/crt/crtdata.c: In function 'Test___badioinfo':
C:/ReactOS/reactos/modules/rostests/apitests/crt/crtdata.c:75:20: error: the comparison will always evaluate as 'true' for the address of '__badioinfo' will never be NULL [-Werror=address]
   75 |     ok(__badioinfo != NULL, "__badioinfo is NULL\n");
      |                    ^~
C:/ReactOS/reactos/modules/rostests/apitests/crt/crtdata.c:74:28: note: '__badioinfo' declared here
   74 |     _CRTIMP extern ioinfo* __badioinfo[];
      |                            ^~~~~~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
806c3fb3d8 [IPHLPAPI_APITEST] Don't compare arrays against NULL.
Fixes GCC 13 warning:

C:/ReactOS/reactos/modules/rostests/apitests/iphlpapi/GetNetworkParams.c: In function 'test_GetNetworkParams':
C:/ReactOS/reactos/modules/rostests/apitests/iphlpapi/GetNetworkParams.c:171:28: error: the comparison will always evaluate as 'true' for the address of 'HostName' will never be NULL [-Werror=address]
  171 |     ok(FixedInfo->HostName != NULL, "FixedInfo->HostName is NULL\n");
      |                            ^~
2026-03-18 17:29:12 +02:00
Hermès Bélusca-Maïto
509d8afdf5 [NTDLL_APITEST] Add some tests for NtQueryInformationThread(ThreadHideFromDebugger) (#8486) 2026-03-08 18:51:41 +01:00
Hermès Bélusca-Maïto
f4d0d53445 [NTDLL_APITEST] Adjust ThreadHideFromDebugger support for NtQueryInformationThread() probing tests (#8486) 2026-03-08 18:51:40 +01:00
Katayama Hirofumi MZ
06ae7ec211 [FREETYPE][NTGDI][GDI32][GDI32_APITEST] Rewrite GetCharWidth etc. (#8690)
Refactoring and improve readability.
JIRA issue: CORE-20505
- Add GreGetCharWidthW helper
  function.
- Rewrite NtGdiGetCharWidthW
  using GreGetCharWidthW.
- Refactor NtGdiGetGlyphIndicesW.
- Improve sanity check of
  GetCharWidthA/W/I,
  GetCharWidth32A/W, and
  GetCharWidthFloatA/W.
- Add GetCharWidth testcase to
  gdi32_apitest.
2026-03-01 20:12:45 +09:00
Timo Kreuzer
40297415a5 [STATIC_CRT_APITEST] Remove static_crt_apitest from build for now
The test used the obsolete CRT. The test doesn't provide much value anyway, because we test all the used code already through msvcrt_apitest, ntdll_apitest, etc. The only real benefit was testing and working outside of reactos.
I kept the build file around, which could be revived with msvcrt_static or libcntpr, but that needs some work.
2026-02-17 17:52:19 +02:00
Max Korostil
c65740eeb3 [WIN32KNT_APITEST][NTUSER] Fix NtUserCreateAcceleratorTable memory corruption (#7888)
CORE-18122

- Check if `EntriesCount` can overflow the required memory size.
- Add an apitest for `NtUserCreateAcceleratorTable`.
2026-02-16 14:19:30 +01:00
Doug Lyons
3637fd8b1d [USER32_APITEST] New LoadImage 1bpp test for PR #4015 retry (#8522)
CORE-13935

* Make LoadImage1bpp.c a sub-test of LoadImage.c for apitest.

* Add broken() for Vista x64 Testbot regression test fix based on reviewer comments.
2026-01-29 22:06:57 -06:00
Timo Kreuzer
c57a471e1b [NTDLL_WINTEST] Improve NtMapViewOfSection test
- Fix ZeroBits test and remove some useless and confusing "tests"
- Add another ZeroBits test (use as a bitmask)
- Fix some status tests for Windows 10
2026-01-28 12:59:20 +02:00
Timo Kreuzer
00f8b239f8 [NTDLL_APITEST] Fix QuerySetProcessValidator for x64 and NT6+
- Skip items not present in PsProcessInfoClass array
- Fix some x86 specific classes
- Handle some more special cases
- Use stricter status check
2026-01-28 12:59:20 +02:00
Timo Kreuzer
28cf8cbce0 [NTDLL_APITEST] Improve/fix NtReadFile/NtWriteFile test
- Handle Vista+ and 64 bit
- Add 4 more tests
2026-01-28 12:59:20 +02:00
Timo Kreuzer
f736154b27 [NTDLL_APITEST] Fix some tests
- Fix DllLoadNotification test on Vista (which seems to be broken)
- Fix NtAcceptConnectPort test on 64 bit
- Fix NtAllocateVirtualMemory test on Vista+
- Fix NtMapViewOfSection test on 64 bit
- Fix NtSetDefaultLocale test on Vista+
- Fix RtlBitmapApi test on Vista
- Fix RtlCaptureContext test
2026-01-28 12:59:20 +02:00
Timo Kreuzer
2a258c3bff [WIN32U_APITEST] Remove obsolete todo_ros 2026-01-20 12:35:55 +02:00
Timo Kreuzer
ef60fb2e59 [GDITOOLS] Improve ChangeScreenBpp utility function 2026-01-14 15:25:16 +02:00
Katayama Hirofumi MZ
690fda9f31 [SHLWAPI][SHLWAPI_APITEST] Rewrite StrToInt* functions (#8591)
JIRA issue: CORE-19278
Reduce Wine test shlwapi:string failures.
- Rewrite StrToIntA, StrToIntW, StrToIntExA, StrToInt64ExA,
  StrToIntExW, and StrToInt64ExW functions.
- Add testcase StrToInt.
2026-01-14 21:39:39 +09:00
Timo Kreuzer
e3521ebcea [WIN32U_APITEST] Add a test for NtGdiCreateDIBSection 2026-01-07 21:52:55 +02:00
Timo Kreuzer
54fea662a1 [WIN32U_APITEST] Add more tests for NtGdiBitBlt 2026-01-07 21:52:55 +02:00
Timo Kreuzer
9b861cdf85 [WIN32U_APITEST] Add tests for NtGdiLineTo 2026-01-07 21:52:55 +02:00
Timo Kreuzer
c2ae15f384 [GDI32_APITEST] Check for GdiToolsInit failure 2026-01-07 21:52:55 +02:00
Timo Kreuzer
c7b28a10c9 [GDITOOLS] Implement ChangeScreenBpp helper 2026-01-07 21:52:55 +02:00
Timo Kreuzer
4746b1b96f [GDITOOLS] Don't create duplicate DDBs 2026-01-07 21:52:55 +02:00
Timo Kreuzer
681d1df0aa [WIN32U_APITEST] Fix tests for NtGdiBitBlt 2026-01-05 20:31:37 +02:00
Max Korostil
472cf2fd13 [NTUSER][WIN32U_APITEST] Fix NtUserGetCursorInfo BSOD, add tests (#8473)
Probe structure pointer before reading its cbSize.
Also move the TRACE debug print outside the user critical region.

CORE-18125
2025-12-31 15:00:38 +03:00
Timo Kreuzer
9af9e2bf0a [WIN32U_APITEST] Improve NtUserSystemParametersInfo test 2025-12-30 12:59:52 +02:00
Timo Kreuzer
48757bc743 [WIN32U_APITEST] Improve NtUserScrollDC test 2025-12-30 12:59:52 +02:00
Timo Kreuzer
a479aff655 [WIN32U_APITEST] Skip NtUserProcessConnect test on Vista+
NtUserProcessConnect can only be called by CSRSS on Vista+.
2025-12-30 12:59:52 +02:00
Timo Kreuzer
e04c703e65 [WIN32U_APITEST] Disable 2 tests for NtUserGetThreadState
These fail on Windows 2003. Needs investigation.
2025-12-30 12:59:52 +02:00
Timo Kreuzer
3b434431f5 [WIN32U_APITEST] Fix test for NtUserGetAsyncKeyState 2025-12-30 12:59:52 +02:00
Timo Kreuzer
ab0fe2f9d4 [WIN32U_APITEST] Fix test for NtGdiRestoreDC 2025-12-30 12:59:52 +02:00
Timo Kreuzer
228b3ca472 [WIN32U_APITEST] Fix NtGdiGetDIBitsInternal test 2025-12-30 12:59:52 +02:00
Timo Kreuzer
2e206b124e [WIN32U_APITEST] Rewrite test for NtGdiExtTextOutW 2025-12-30 12:59:52 +02:00
Timo Kreuzer
4671aaafa5 [WIN32U_APITEST] Try to fix NtGdiExtSelectClipRgn test 2025-12-30 12:59:52 +02:00
Timo Kreuzer
6529244477 [WIN32U_APITEST] Fix tests for NtGdiDeleteObjectApp on Vista+ 2025-12-30 12:59:52 +02:00
Timo Kreuzer
1cb7a74671 [WIN32U_APITEST] Comment out 2 tests in NtGdiArcInternal
These fail on win 2003. Needs more investigation.
2025-12-30 12:59:52 +02:00
Timo Kreuzer
f2a0018c74 [CRT_APITEST] Mark a test for _wpgmptr as todo 2025-12-30 12:57:14 +02:00