mirror of
https://github.com/reactos/reactos.git
synced 2026-05-30 23:33:24 +08:00
[NTDLL_APITEST] Add a test for LdrFindResource_U / CORE-20401
See CORE-20401, CORE-20408
This commit is contained in:
@@ -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
|
||||
|
||||
30
modules/rostests/apitests/ntdll/LdrFindResource_U.c
Normal file
30
modules/rostests/apitests/ntdll/LdrFindResource_U.c
Normal 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();
|
||||
}
|
||||
BIN
modules/rostests/apitests/ntdll/bmp1.bmp
Normal file
BIN
modules/rostests/apitests/ntdll/bmp1.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 66 B |
@@ -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"
|
||||
|
||||
@@ -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 },
|
||||
|
||||
Reference in New Issue
Block a user