ReactOS
0.4.16-dev-2104-gb84fa49
LdrFindResource_U.c
Go to the documentation of this file.
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
10
static
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
27
START_TEST
(
LdrFindResource_U
)
28
{
29
Test_CORE_20401
();
30
}
Test_CORE_20401
static void Test_CORE_20401(void)
Definition:
LdrFindResource_U.c:10
ok_ntstatus
#define ok_ntstatus(status, expected)
Definition:
atltest.h:135
START_TEST
#define START_TEST(x)
Definition:
atltest.h:75
NTSTATUS
LONG NTSTATUS
Definition:
precomp.h:26
NULL
#define NULL
Definition:
types.h:112
GetModuleHandleW
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition:
loader.c:838
L
#define L(x)
Definition:
resources.c:13
ULONG_PTR
#define ULONG_PTR
Definition:
config.h:101
Status
Status
Definition:
gdiplustypes.h:25
void
Definition:
nsiface.idl:2307
entry
uint32_t entry
Definition:
isohybrid.c:63
LdrFindResource_U
NTSTATUS NTAPI LdrFindResource_U(_In_ PVOID BaseAddress, _In_ PLDR_RESOURCE_INFO ResourceInfo, _In_ ULONG Level, _Out_ PIMAGE_RESOURCE_DATA_ENTRY *ResourceDataEntry)
hmod
static PEXPLICIT_ACCESSW *static HMODULE hmod
Definition:
security.c:143
LANG_NEUTRAL
#define LANG_NEUTRAL
Definition:
nls.h:22
MAKELANGID
#define MAKELANGID(p, s)
Definition:
nls.h:15
SUBLANG_NEUTRAL
#define SUBLANG_NEUTRAL
Definition:
nls.h:167
STATUS_SUCCESS
#define STATUS_SUCCESS
Definition:
shellext.h:65
_IMAGE_RESOURCE_DATA_ENTRY
Definition:
pedump.c:458
_LDR_RESOURCE_INFO
Definition:
ldrtypes.h:184
info
Definition:
notification.c:61
precomp.h
modules
rostests
apitests
ntdll
LdrFindResource_U.c
Generated on Tue Jan 6 2026 06:12:07 for ReactOS by
1.9.6