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
e8fe7004
Commit
e8fe7004
authored
Mar 27, 2006
by
Robert Shearman
Committed by
Alexandre Julliard
Mar 27, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Adding a systray item with an invalid icon handle is allowed.
parent
d6ce9db8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
systray.c
dlls/shell32/systray.c
+9
-3
systray.c
programs/explorer/systray.c
+1
-7
No files found.
dlls/shell32/systray.c
View file @
e8fe7004
...
...
@@ -99,21 +99,26 @@ BOOL WINAPI Shell_NotifyIconW(DWORD dwMessage, PNOTIFYICONDATAW nid)
LONG
cbColourBits
;
if
(
!
GetIconInfo
(
nid
->
hIcon
,
&
iconinfo
))
return
FALSE
;
goto
noicon
;
if
(
!
GetObjectW
(
iconinfo
.
hbmMask
,
sizeof
(
bmMask
),
&
bmMask
)
||
!
GetObjectW
(
iconinfo
.
hbmColor
,
sizeof
(
bmColour
),
&
bmColour
))
{
DeleteObject
(
iconinfo
.
hbmMask
);
DeleteObject
(
iconinfo
.
hbmColor
);
return
FALSE
;
goto
noicon
;
}
cbMaskBits
=
(
bmMask
.
bmPlanes
*
bmMask
.
bmWidth
*
bmMask
.
bmHeight
*
bmMask
.
bmBitsPixel
)
/
8
;
cbColourBits
=
(
bmColour
.
bmPlanes
*
bmColour
.
bmWidth
*
bmColour
.
bmHeight
*
bmColour
.
bmBitsPixel
)
/
8
;
cds
.
cbData
=
sizeof
(
*
nid
)
+
2
*
sizeof
(
BITMAP
)
+
cbMaskBits
+
cbColourBits
;
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
cds
.
cbData
);
if
(
!
buffer
)
return
FALSE
;
if
(
!
buffer
)
{
DeleteObject
(
iconinfo
.
hbmMask
);
DeleteObject
(
iconinfo
.
hbmColor
);
return
FALSE
;
}
cds
.
lpData
=
buffer
;
memcpy
(
buffer
,
nid
,
sizeof
(
*
nid
));
...
...
@@ -132,6 +137,7 @@ BOOL WINAPI Shell_NotifyIconW(DWORD dwMessage, PNOTIFYICONDATAW nid)
}
else
{
noicon:
cds
.
cbData
=
sizeof
(
*
nid
);
cds
.
lpData
=
nid
;
}
...
...
programs/explorer/systray.c
View file @
e8fe7004
...
...
@@ -259,7 +259,7 @@ static void handle_incoming(HWND hwndSource, COPYDATASTRUCT *cds)
/* FIXME: if statement only needed because we don't support interprocess
* icon handles */
if
(
nid
.
uFlags
&
NIF_ICON
)
if
(
(
nid
.
uFlags
&
NIF_ICON
)
&&
(
cds
->
cbData
>=
sizeof
(
nid
)
+
2
*
sizeof
(
BITMAP
))
)
{
LONG
cbMaskBits
;
LONG
cbColourBits
;
...
...
@@ -269,12 +269,6 @@ static void handle_incoming(HWND hwndSource, COPYDATASTRUCT *cds)
buffer
+=
sizeof
(
nid
);
if
(
cds
->
cbData
<
sizeof
(
nid
)
+
2
*
sizeof
(
BITMAP
))
{
WINE_ERR
(
"buffer underflow
\n
"
);
return
;
}
memcpy
(
&
bmMask
,
buffer
,
sizeof
(
bmMask
));
buffer
+=
sizeof
(
bmMask
);
memcpy
(
&
bmColour
,
buffer
,
sizeof
(
bmColour
));
...
...
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