Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
1746ed9c
Commit
1746ed9c
authored
Dec 07, 2021
by
Ziqing Hui
Committed by
Alexandre Julliard
Dec 08, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Test CreateIconFromResourceEx() with resource bits.
Signed-off-by:
Ziqing Hui
<
zhui@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
14c28747
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
0 deletions
+49
-0
cursoricon.c
dlls/user32/tests/cursoricon.c
+49
-0
No files found.
dlls/user32/tests/cursoricon.c
View file @
1746ed9c
...
@@ -1539,6 +1539,13 @@ static void test_LoadImage(void)
...
@@ -1539,6 +1539,13 @@ static void test_LoadImage(void)
test_LoadImage_working_directory
();
test_LoadImage_working_directory
();
}
}
static
BOOL
CALLBACK
find_res_proc
(
HMODULE
module
,
LPCSTR
type
,
LPSTR
name
,
LONG_PTR
param
)
{
char
**
res_name
=
(
char
**
)
param
;
*
res_name
=
name
;
return
FALSE
;
}
static
void
test_CreateIconFromResource
(
void
)
static
void
test_CreateIconFromResource
(
void
)
{
{
HANDLE
handle
,
old_handle
;
HANDLE
handle
,
old_handle
;
...
@@ -1547,6 +1554,13 @@ static void test_CreateIconFromResource(void)
...
@@ -1547,6 +1554,13 @@ static void test_CreateIconFromResource(void)
BITMAPINFOHEADER
*
icon_header
;
BITMAPINFOHEADER
*
icon_header
;
INT16
*
hotspot
;
INT16
*
hotspot
;
ICONINFO
icon_info
;
ICONINFO
icon_info
;
HMODULE
user32
;
char
*
res_name
;
HRSRC
rsrc
;
HGLOBAL
res
;
BYTE
*
bits
;
UINT
size
;
#define ICON_RES_WIDTH 32
#define ICON_RES_WIDTH 32
#define ICON_RES_HEIGHT 32
#define ICON_RES_HEIGHT 32
...
@@ -1706,6 +1720,41 @@ static void test_CreateIconFromResource(void)
...
@@ -1706,6 +1720,41 @@ static void test_CreateIconFromResource(void)
ok
(
handle
!=
old_handle
,
"Expect a different handle.
\n
"
);
ok
(
handle
!=
old_handle
,
"Expect a different handle.
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
hotspot
);
HeapFree
(
GetProcessHeap
(),
0
,
hotspot
);
/* Get icon resource bits */
user32
=
GetModuleHandleA
(
"user32.dll"
);
EnumResourceNamesA
(
user32
,
(
const
char
*
)
RT_GROUP_ICON
,
find_res_proc
,
(
LONG_PTR
)
&
res_name
);
rsrc
=
FindResourceA
(
user32
,
res_name
,
(
const
char
*
)
RT_GROUP_ICON
);
ok
(
rsrc
!=
NULL
,
"Find resource failed, error %u.
\n
"
,
GetLastError
());
res
=
LoadResource
(
user32
,
rsrc
);
ok
(
res
!=
NULL
,
"Load resource failed, error %u.
\n
"
,
GetLastError
());
bits
=
LockResource
(
res
);
ok
(
bits
!=
NULL
,
"Lock resource failed, error %u.
\n
"
,
GetLastError
());
res_name
=
MAKEINTRESOURCEA
(
LookupIconIdFromDirectory
(
bits
,
TRUE
));
rsrc
=
FindResourceA
(
user32
,
res_name
,
(
const
char
*
)
RT_ICON
);
ok
(
rsrc
!=
NULL
,
"Find resource failed, error %u.
\n
"
,
GetLastError
());
size
=
SizeofResource
(
user32
,
rsrc
);
ok
(
size
!=
0
,
"Get resource size failed, error %u.
\n
"
,
GetLastError
());
res
=
LoadResource
(
user32
,
rsrc
);
ok
(
res
!=
NULL
,
"Load resource failed, error %u.
\n
"
,
GetLastError
());
bits
=
LockResource
(
res
);
ok
(
bits
!=
NULL
,
"Lock resource failed, error %u.
\n
"
,
GetLastError
());
/* Test creating and destroying a shared icon from resource bits. */
handle
=
CreateIconFromResourceEx
(
bits
,
size
,
TRUE
,
0x00030000
,
0
,
0
,
LR_DEFAULTSIZE
|
LR_SHARED
);
ok
(
handle
!=
NULL
,
"Create icon failed, error %u
\n
"
,
GetLastError
());
ret
=
DestroyIcon
(
handle
);
ok
(
ret
,
"Destroy icon failed, error %u.
\n
"
,
GetLastError
());
ret
=
GetIconInfo
(
handle
,
&
icon_info
);
todo_wine
ok
(
ret
,
"Get info failed, error %u.
\n
"
,
GetLastError
());
/* Test creating a shared icon from resource bits that has been created before. */
old_handle
=
handle
;
handle
=
CreateIconFromResourceEx
(
bits
,
size
,
TRUE
,
0x00030000
,
0
,
0
,
LR_DEFAULTSIZE
|
LR_SHARED
);
ok
(
handle
!=
NULL
,
"Create icon failed, error %u.
\n
"
,
GetLastError
());
ok
(
handle
!=
old_handle
,
"Expect a different handle.
\n
"
);
}
}
static
int
check_cursor_data
(
HDC
hdc
,
HCURSOR
hCursor
,
void
*
data
,
int
length
)
static
int
check_cursor_data
(
HDC
hdc
,
HCURSOR
hCursor
,
void
*
data
,
int
length
)
...
...
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