[NTDLL_APITEST] Add a test for LdrFindResource_U / CORE-20401

See CORE-20401, CORE-20408
This commit is contained in:
Timo Kreuzer
2025-12-26 23:00:48 +02:00
parent 454f25c7f3
commit 89e4b6bef4
5 changed files with 37 additions and 0 deletions

View File

@@ -39,6 +39,7 @@ add_dependencies(ntdll_crt_test_lib psdk)
list(APPEND SOURCE
DllLoadNotification.c
LdrEnumResources.c
LdrFindResource_U.c
LdrLoadDll.c
load_notifications.c
locale.c

View File

@@ -0,0 +1,30 @@
/*
* PROJECT: ReactOS API tests
* LICENSE: MIT (https://spdx.org/licenses/MIT)
* PURPOSE: Test for LdrFindResource_U
* COPYRIGHT: Copyright 2025 Timo Kreuzer <timo.kreuzer@reactos.org>
*/
#include "precomp.h"
static void Test_CORE_20401(void)
{
HMODULE hmod = GetModuleHandleW(NULL);
LDR_RESOURCE_INFO info;
IMAGE_RESOURCE_DATA_ENTRY *entry = NULL;
NTSTATUS Status;
// Use LdrFindResource_U to find a bitmap resource called "NORMAL_FRAMECAPTION_BMP"
// CORE-20401 resulted in wrong comparison of strings containing underscores.
// If the test fails, the resource name comparison is probably broken (again).
info.Type = 2; // RT_BITMAP;
info.Name = (ULONG_PTR)L"NORMAL_FRAMECAPTION_BMP";
info.Language = MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL);
Status = LdrFindResource_U(hmod, &info, 3, &entry);
ok_ntstatus(Status, STATUS_SUCCESS);
}
START_TEST(LdrFindResource_U)
{
Test_CORE_20401();
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 B

View File

@@ -1,3 +1,7 @@
101 10 "load_notifications.dll"
102 10 "empty_dll.dll"
NORMAL_FRAMECAPTIONMIN BITMAP "bmp1.bmp"
NORMAL_FRAMECAPTIONMIN_BMP BITMAP "bmp1.bmp"
NORMAL_FRAMECAPTION_BMP BITMAP "bmp1.bmp"

View File

@@ -26,6 +26,7 @@ extern void func_wcstombs(void);
extern void func_DllLoadNotification(void);
extern void func_LdrEnumResources(void);
extern void func_LdrFindResource_U(void);
extern void func_LdrLoadDll(void);
extern void func_load_notifications(void);
extern void func_NtAcceptConnectPort(void);
@@ -159,6 +160,7 @@ const struct test winetest_testlist[] =
{ "DllLoadNotification", func_DllLoadNotification },
{ "LdrEnumResources", func_LdrEnumResources },
{ "LdrFindResource_U", func_LdrFindResource_U },
{ "LdrLoadDll", func_LdrLoadDll },
{ "load_notifications", func_load_notifications },
{ "NtAcceptConnectPort", func_NtAcceptConnectPort },