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
ec167634
Commit
ec167634
authored
Jul 14, 2005
by
Robert Shearman
Committed by
Alexandre Julliard
Jul 14, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle CopyImage and other functions failing by not adding the icon
and notifying the caller.
parent
31acf7f5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
10 deletions
+35
-10
imagelist.c
dlls/comctl32/imagelist.c
+35
-10
No files found.
dlls/comctl32/imagelist.c
View file @
ec167634
...
...
@@ -2226,25 +2226,51 @@ ImageList_ReplaceIcon (HIMAGELIST himl, INT i, HICON hIcon)
HBITMAP
hbmOldSrc
;
ICONINFO
ii
;
BITMAP
bmp
;
BOOL
ret
;
TRACE
(
"(%p %d %p)
\n
"
,
himl
,
i
,
hIcon
);
if
(
!
is_valid
(
himl
))
return
-
1
;
if
((
i
>=
himl
->
cMaxImage
)
||
(
i
<
-
1
))
return
-
1
;
if
(
!
is_valid
(
himl
))
{
ERR
(
"invalid image list
\n
"
);
return
-
1
;
}
if
((
i
>=
himl
->
cMaxImage
)
||
(
i
<
-
1
))
{
ERR
(
"invalid image index %d / %d
\n
"
,
i
,
himl
->
cMaxImage
);
return
-
1
;
}
hBestFitIcon
=
CopyImage
(
hIcon
,
IMAGE_ICON
,
himl
->
cx
,
himl
->
cy
,
LR_COPYFROMRESOURCE
);
/* the above will fail if the icon wasn't loaded from a resource, so try
* again without LR_COPYFROMRESOURCE flag */
if
(
!
hBestFitIcon
)
hBestFitIcon
=
CopyImage
(
hIcon
,
IMAGE_ICON
,
himl
->
cx
,
himl
->
cy
,
0
);
if
(
!
hBestFitIcon
)
return
-
1
;
ret
=
GetIconInfo
(
hBestFitIcon
,
&
ii
);
if
(
!
ret
)
{
DestroyIcon
(
hBestFitIcon
);
return
-
1
;
}
GetIconInfo
(
hBestFitIcon
,
&
ii
);
if
(
ii
.
hbmMask
==
0
)
ERR
(
"no mask!
\n
"
);
if
(
ii
.
hbmColor
==
0
)
ERR
(
"no color!
\n
"
);
GetObjectA
(
ii
.
hbmMask
,
sizeof
(
BITMAP
),
(
LPVOID
)
&
bmp
);
ret
=
GetObjectW
(
ii
.
hbmMask
,
sizeof
(
BITMAP
),
(
LPVOID
)
&
bmp
);
if
(
!
ret
)
{
ERR
(
"couldn't get mask bitmap info
\n
"
);
if
(
ii
.
hbmColor
)
DeleteObject
(
ii
.
hbmColor
);
if
(
ii
.
hbmMask
)
DeleteObject
(
ii
.
hbmMask
);
DestroyIcon
(
hBestFitIcon
);
return
-
1
;
}
if
(
i
==
-
1
)
{
if
(
himl
->
cCurImage
+
1
>
himl
->
cMaxImage
)
...
...
@@ -2276,8 +2302,7 @@ ImageList_ReplaceIcon (HIMAGELIST himl, INT i, HICON hIcon)
SelectObject
(
hdcImage
,
hbmOldSrc
);
if
(
hBestFitIcon
)
DestroyIcon
(
hBestFitIcon
);
DestroyIcon
(
hBestFitIcon
);
if
(
hdcImage
)
DeleteDC
(
hdcImage
);
if
(
ii
.
hbmColor
)
...
...
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