reactos/sdk/tools
Hermès Bélusca-Maïto 50b1242e99
[WLNTFYTESTS] Add extended tests for the Winlogon notifications
Introduce and use a minimal testing framework (minitest.h) based on
an updated version of `wine/test.h`.

Each notification handler becomes its own test. Useful macro and
function helpers have been introduced to simplify the code that is
duplicated for each handler.

See commit 38d07d3a24 (PR #8234) for the details of how to install
and use the notification dll.

These tests can exercise the notifications in the four cases, where
asynchronous events and user impersonation can be independently
enabled or disabled. To do this, the `Asynchronous` and `Impersonate`
registry `REG_DWORD` values, inside the `WLNotifyTests` subkey of:
  `HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Notify`
must be set to their intended values[^1].

----

[^1]: https://learn.microsoft.com/en-us/windows/win32/secauthn/registry-entries

----

Current test results:

- When each notification is emitted, the DLL is loaded then unloaded:
  ```
  err:(modules\rostests\win32\winlogon\wlntfytests\wlntfytests.c:1307)
  WLNOTIFY(ac.b0):  Entering `DllMain`(hInst: 0x10000000, dwReason: 0x1, pReserved: 0x00000000)
  ...
  err:(modules\rostests\win32\winlogon\wlntfytests\wlntfytests.c:1307)
  WLNOTIFY(ac.b0):  Entering `DllMain`(hInst: 0x10000000, dwReason: 0x0, pReserved: 0x00000000)
  ```
  This doesn't happen on Windows. And indeed, it should _not_ happen,
  because otherwise the DLL would loose any of its internal global state
  between consecutive notification calls. This currently happens in
  ReactOS, where we can observe the following:
  ```
  modules\rostests\win32\winlogon\wlntfytests\wlntfytests.c:788: Test failed: **** WLEventLogon: ERROR: Wrong state NON-INITIALIZED, expected Startup or Logoff
  ...
  err:(modules\rostests\win32\winlogon\wlntfytests\wlntfytests.c:1036) **** WLEventLogon: Changing state NON-INITIALIZED to Logon
  ```
  and similar for every other notification.

- Test results for each notification:
  ```
  WLEventStartup: 30 tests executed (0 marked as todo, 1 failure), 0 skipped.
  WLEventLogon: 30 tests executed (0 marked as todo, 4 failures), 2 skipped.
  WLEventStartShell: 30 tests executed (0 marked as todo, 4 failures), 2 skipped.
  -- Note: missing WLEventPostShell --
  WLEventLock: 30 tests executed (0 marked as todo, 4 failures), 2 skipped.
  WLEventUnlock: 30 tests executed (0 marked as todo, 4 failures), 2 skipped.
  WLEventStartScreenSaver: 30 tests executed (0 marked as todo, 10 failures), 0 skipped.
  WLEventStopScreenSaver: 30 tests executed (0 marked as todo, 9 failures), 0 skipped.
  WLEventLogoff: 30 tests executed (0 marked as todo, 5 failures), 2 skipped.
  WLEventShutdown: 31 tests executed (0 marked as todo, 5 failures), 0 skipped.
  ```
2025-07-28 22:04:05 +02:00
..
asmpp [ASMPP] Improve handling of rip relative addressing 2023-11-10 19:20:24 +02:00
cabman [CABMAN] Fix GCC13 buffer format overflow warning (#7408) 2024-10-08 17:47:46 +02:00
create_nls [FORMATTING] Remove trailing whitespace. Addendum to 34593d93. 2021-09-13 03:52:22 +02:00
fatten [FORMATTING][NTOS][HAL][DRIVERS][SDK] Fix trailing spaces 2021-06-11 15:33:08 +03:00
gcc_plugin_seh [PSEH/x64] Fix our GCC-SEH-plugin hack 2024-05-06 14:23:48 +02:00
gendib
geninc [SDK][XDK] Add more definitions for ARM64 and start fixing PE binaries (#4142) 2021-12-09 17:54:16 +03:00
hhpcomp [HHPCOMP:CHMC] chmc_crunch_lzx(): Disable a dead check (#4880) 2022-11-16 22:19:52 +01:00
hpp [CMAKE] Replace custom functions to built-in ones 2020-04-16 15:59:38 +03:00
isohybrid Add a shared "port" directory for POSIX functions needed by multiple host tools (getopt/mkstemps) and import the one and only getopt from glibc. 2019-04-28 23:23:06 +02:00
kbdtool [FORMATTING] Remove trailing whitespace. Addendum to 34593d93. 2021-09-13 03:52:22 +02:00
log2lines [LOG2LINES] Compile the tool for MSVC builds 2022-12-29 16:51:40 +01:00
mkhive [SDK:CMLIB][MKHIVE][BOOT:ENVIRON][NTOS:CONFIG] Add missing HvGetCell casts. Replace some ASSERT(FALSE). 2022-03-27 18:37:16 +02:00
mkisofs [REACTOS] Fix 'seperate' typos 2024-12-11 08:56:06 +02:00
mkshelllink [SHELL32][MKSHELLLINK] Support EXP_SPECIAL_FOLDER datablock in shortcuts (#7158) 2024-09-14 13:10:49 +02:00
ms2ps
nandflash
obj2bin [OBJ2BIN] Add support for IMAGE_REL_I386_REL16 2021-02-22 14:21:43 +01:00
pipetools
port [FORMATTING][NTOS][HAL][DRIVERS][SDK] Fix trailing spaces 2021-06-11 15:33:08 +03:00
regtests2xml
rgenstat [SMDLL][SMLIB] Deprecate the legacy ROS-specific SMDLL and improve SM client functions. (#4821) 2022-11-08 17:40:53 +01:00
rsym [RSYM64] Nuke rsym64 2025-03-24 18:05:28 +00:00
spec2def [SPEC2DEF] Implement support for debug-only exports 2025-01-19 09:02:58 +02:00
txt2nls [TXT2NLS] Explicitly include <cstdint> 2023-07-23 23:58:42 +02:00
unicode [CMAKE] Replace custom functions to built-in ones 2020-04-16 15:59:38 +03:00
utf16le [REACTOS] Fix typos in comments (#5591) 2023-08-22 16:20:29 +03:00
widl [WIDL] Reduce diff to Wine-4.0 2025-01-15 08:29:53 +02:00
winesync [RICHED20] Sync to Wine-10.0 (#8078) 2025-06-08 15:05:27 -07:00
wpp [REACTOS] Improve handling of non-standard names 2024-10-20 14:12:25 +03:00
xml2sdb [FORMATTING][NTOS][HAL][DRIVERS][SDK] Fix trailing spaces 2021-06-11 15:33:08 +03:00
bin2c.c [TOOLS] Fix/suppress all MSVC/x64 warnings (#1525) 2019-04-28 23:21:48 +02:00
check_code_format.sh [REACTOS] Introduce .clang-format file 2019-12-28 01:23:49 +02:00
check_packing.py [SDK] Fix missing comma in check_packing.py 2022-11-04 23:02:25 +01:00
CMakeLists.txt [RSYM64] Nuke rsym64 2025-03-24 18:05:28 +00:00
do_code_format.sh [SDK][TOOLS] Add do_code_format.sh to sdk/tools (#2191) 2019-12-31 11:28:56 +09:00
dumpstab.c
gen_baseaddress.py [WLNTFYTESTS] Add extended tests for the Winlogon notifications 2025-07-28 22:04:05 +02:00
mkconfig.c
pefixup.c [PEFIXUP] Fixup of resource sections in GCC builds. (#3594) 2021-05-10 00:36:38 +02:00
stubgen.c