Reactos
1/*
2 * PROJECT: ReactOS API tests
3 * LICENSE: MIT (https://spdx.org/licenses/MIT)
4 * PURPOSE: Test for LdrFindResource_U
5 * COPYRIGHT: Copyright 2025 Timo Kreuzer <timo.kreuzer@reactos.org>
6 */
7
8#include "precomp.h"
9
10static void Test_CORE_20401(void)
11{
12 HMODULE hmod = GetModuleHandleW(NULL);
13 LDR_RESOURCE_INFO info;
14 IMAGE_RESOURCE_DATA_ENTRY *entry = NULL;
15 NTSTATUS Status;
16
17 // Use LdrFindResource_U to find a bitmap resource called "NORMAL_FRAMECAPTION_BMP"
18 // CORE-20401 resulted in wrong comparison of strings containing underscores.
19 // If the test fails, the resource name comparison is probably broken (again).
20 info.Type = 2; // RT_BITMAP;
21 info.Name = (ULONG_PTR)L"NORMAL_FRAMECAPTION_BMP";
22 info.Language = MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL);
23 Status = LdrFindResource_U(hmod, &info, 3, &entry);
24 ok_ntstatus(Status, STATUS_SUCCESS);
25}
26
27START_TEST(LdrFindResource_U)
28{
29 Test_CORE_20401();
30}