Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
60e0ae2f
Commit
60e0ae2f
authored
Apr 07, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Apr 07, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Load all test function pointers on init.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5972691e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
10 deletions
+23
-10
heap.c
dlls/kernel32/tests/heap.c
+23
-10
No files found.
dlls/kernel32/tests/heap.c
View file @
60e0ae2f
...
...
@@ -40,9 +40,28 @@
/* use function pointers to avoid warnings for invalid parameter tests */
static
LPVOID
(
WINAPI
*
pHeapAlloc
)(
HANDLE
,
DWORD
,
SIZE_T
);
static
LPVOID
(
WINAPI
*
pHeapReAlloc
)(
HANDLE
,
DWORD
,
LPVOID
,
SIZE_T
);
static
BOOL
(
WINAPI
*
pHeapQueryInformation
)(
HANDLE
,
HEAP_INFORMATION_CLASS
,
PVOID
,
SIZE_T
,
PSIZE_T
);
static
BOOL
(
WINAPI
*
pGetPhysicallyInstalledSystemMemory
)(
ULONGLONG
*
);
static
ULONG
(
WINAPI
*
pRtlGetNtGlobalFlags
)(
void
);
static
BOOL
(
WINAPI
*
pGetPhysicallyInstalledSystemMemory
)(
ULONGLONG
*
);
#define MAKE_FUNC(f) static typeof(f) *p ## f
MAKE_FUNC
(
HeapQueryInformation
);
MAKE_FUNC
(
GlobalFlags
);
MAKE_FUNC
(
RtlGetNtGlobalFlags
);
#undef MAKE_FUNC
static
void
load_functions
(
void
)
{
HMODULE
kernel32
=
GetModuleHandleW
(
L"kernel32.dll"
);
HMODULE
ntdll
=
GetModuleHandleW
(
L"ntdll.dll"
);
#define LOAD_FUNC(m, f) p ## f = (void *)GetProcAddress( m, #f );
LOAD_FUNC
(
kernel32
,
HeapAlloc
);
LOAD_FUNC
(
kernel32
,
HeapReAlloc
);
LOAD_FUNC
(
kernel32
,
HeapQueryInformation
);
LOAD_FUNC
(
kernel32
,
GetPhysicallyInstalledSystemMemory
);
LOAD_FUNC
(
kernel32
,
GlobalFlags
);
LOAD_FUNC
(
ntdll
,
RtlGetNtGlobalFlags
);
#undef LOAD_FUNC
}
struct
heap
{
...
...
@@ -1079,7 +1098,6 @@ static void test_HeapQueryInformation(void)
SIZE_T
size
;
BOOL
ret
;
pHeapQueryInformation
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"kernel32.dll"
),
"HeapQueryInformation"
);
if
(
!
pHeapQueryInformation
)
{
win_skip
(
"HeapQueryInformation is not available
\n
"
);
...
...
@@ -1462,12 +1480,10 @@ static void test_child_heap( const char *arg )
static
void
test_GetPhysicallyInstalledSystemMemory
(
void
)
{
HMODULE
kernel32
=
GetModuleHandleA
(
"kernel32.dll"
);
MEMORYSTATUSEX
memstatus
;
ULONGLONG
total_memory
;
BOOL
ret
;
pGetPhysicallyInstalledSystemMemory
=
(
void
*
)
GetProcAddress
(
kernel32
,
"GetPhysicallyInstalledSystemMemory"
);
if
(
!
pGetPhysicallyInstalledSystemMemory
)
{
win_skip
(
"GetPhysicallyInstalledSystemMemory is not available
\n
"
);
...
...
@@ -1575,10 +1591,7 @@ START_TEST(heap)
int
argc
;
char
**
argv
;
pHeapAlloc
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"kernel32"
),
"HeapAlloc"
);
pHeapReAlloc
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"kernel32"
),
"HeapReAlloc"
);
pRtlGetNtGlobalFlags
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"ntdll.dll"
),
"RtlGetNtGlobalFlags"
);
load_functions
();
argc
=
winetest_get_mainargs
(
&
argv
);
if
(
argc
>=
3
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment