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
96a939ee
Commit
96a939ee
authored
May 07, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Fix marshalling of 1-bpp systray icons.
parent
159145ce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
12 deletions
+23
-12
systray.c
dlls/shell32/systray.c
+23
-12
No files found.
dlls/shell32/systray.c
View file @
96a939ee
...
...
@@ -163,43 +163,54 @@ BOOL WINAPI Shell_NotifyIconW(DWORD dwMessage, PNOTIFYICONDATAW nid)
BITMAP
bmMask
;
BITMAP
bmColour
;
LONG
cbMaskBits
;
LONG
cbColourBits
;
LONG
cbColourBits
=
0
;
char
*
buffer
;
if
(
!
GetIconInfo
(
nid
->
hIcon
,
&
iconinfo
))
goto
noicon
;
if
(
!
GetObjectW
(
iconinfo
.
hbmMask
,
sizeof
(
bmMask
),
&
bmMask
)
||
!
GetObjectW
(
iconinfo
.
hbmColor
,
sizeof
(
bmColour
),
&
bmColour
))
(
iconinfo
.
hbmColor
&&
!
GetObjectW
(
iconinfo
.
hbmColor
,
sizeof
(
bmColour
),
&
bmColour
)
))
{
DeleteObject
(
iconinfo
.
hbmMask
);
DeleteObject
(
iconinfo
.
hbmColor
);
if
(
iconinfo
.
hbmColor
)
DeleteObject
(
iconinfo
.
hbmColor
);
goto
noicon
;
}
cbMaskBits
=
(
bmMask
.
bmPlanes
*
bmMask
.
bmWidth
*
bmMask
.
bmHeight
*
bmMask
.
bmBitsPixel
+
15
)
/
16
*
2
;
cbColourBits
=
(
bmColour
.
bmPlanes
*
bmColour
.
bmWidth
*
bmColour
.
bmHeight
*
bmColour
.
bmBitsPixel
+
15
)
/
16
*
2
;
if
(
iconinfo
.
hbmColor
)
cbColourBits
=
(
bmColour
.
bmPlanes
*
bmColour
.
bmWidth
*
bmColour
.
bmHeight
*
bmColour
.
bmBitsPixel
+
15
)
/
16
*
2
;
cds
.
cbData
=
sizeof
(
*
data
)
+
cbMaskBits
+
cbColourBits
;
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
cds
.
cbData
);
if
(
!
buffer
)
{
DeleteObject
(
iconinfo
.
hbmMask
);
DeleteObject
(
iconinfo
.
hbmColor
);
if
(
iconinfo
.
hbmColor
)
DeleteObject
(
iconinfo
.
hbmColor
);
return
FALSE
;
}
data
=
(
struct
notify_data
*
)
buffer
;
memset
(
data
,
0
,
sizeof
(
*
data
)
);
data
->
width
=
bmColour
.
bmWidth
;
data
->
height
=
bmColour
.
bmHeight
;
data
->
planes
=
bmColour
.
bmPlanes
;
data
->
bpp
=
bmColour
.
bmBitsPixel
;
buffer
+=
sizeof
(
*
data
);
GetBitmapBits
(
iconinfo
.
hbmMask
,
cbMaskBits
,
buffer
);
buffer
+=
cbMaskBits
;
GetBitmapBits
(
iconinfo
.
hbmColor
,
cbColourBits
,
buffer
);
if
(
!
iconinfo
.
hbmColor
)
{
data
->
width
=
bmMask
.
bmWidth
;
data
->
height
=
bmMask
.
bmHeight
/
2
;
data
->
planes
=
1
;
data
->
bpp
=
1
;
}
else
{
data
->
width
=
bmColour
.
bmWidth
;
data
->
height
=
bmColour
.
bmHeight
;
data
->
planes
=
bmColour
.
bmPlanes
;
data
->
bpp
=
bmColour
.
bmBitsPixel
;
buffer
+=
cbMaskBits
;
GetBitmapBits
(
iconinfo
.
hbmColor
,
cbColourBits
,
buffer
);
DeleteObject
(
iconinfo
.
hbmColor
);
}
DeleteObject
(
iconinfo
.
hbmMask
);
DeleteObject
(
iconinfo
.
hbmColor
);
}
noicon:
...
...
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