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
eddfefa5
Commit
eddfefa5
authored
Jul 01, 2015
by
Huw Davies
Committed by
Alexandre Julliard
Jul 01, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Reset the string and lparam fields between notifications.
parent
96a6184c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
6 deletions
+45
-6
toolbar.c
dlls/comctl32/tests/toolbar.c
+42
-4
toolbar.c
dlls/comctl32/toolbar.c
+3
-2
No files found.
dlls/comctl32/tests/toolbar.c
View file @
eddfefa5
...
...
@@ -222,7 +222,17 @@ static LRESULT parent_wnd_notify(LPARAM lParam)
restore
->
tbButton
.
iBitmap
=
0
;
restore
->
tbButton
.
fsState
=
TBSTATE_ENABLED
;
restore
->
tbButton
.
fsStyle
=
0
;
restore
->
tbButton
.
iString
=
-
1
;
restore
->
tbButton
.
dwData
=
restore
->
iItem
;
if
(
restore
->
iItem
==
0
)
{
restore
->
tbButton
.
iString
=
(
INT_PTR
)
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
8
);
strcpy
(
(
char
*
)
restore
->
tbButton
.
iString
,
"foo"
);
}
else
if
(
restore
->
iItem
==
1
)
restore
->
tbButton
.
iString
=
2
;
else
restore
->
tbButton
.
iString
=
-
1
;
restore
->
pCurrent
++
;
/* Altering cButtons after the 1st call makes no difference. */
...
...
@@ -2201,7 +2211,8 @@ static void test_save(void)
LONG
res
;
HKEY
key
;
BYTE
data
[
100
];
DWORD
size
=
sizeof
(
data
),
type
;
DWORD
size
=
sizeof
(
data
),
type
,
i
,
count
;
TBBUTTON
tb
;
static
const
TBBUTTON
more_btns
[
2
]
=
{
{
0
,
11
,
TBSTATE_HIDDEN
,
BTNS_BUTTON
,
{
0
},
0
,
-
1
},
...
...
@@ -2211,6 +2222,20 @@ static void test_save(void)
9
,
0xcafe0004
,
11
,
0xcafe0005
,
13
,
0xcafe0006
,
0xffffffff
,
0xcafe0007
,
0xfffffffe
,
0xcafe0008
,
0x80000000
,
0xcafe0009
,
0x7fffffff
,
0xcafe000a
,
0x100
,
0xcafe000b
};
static
const
TBBUTTON
expect_btns
[]
=
{
{
0
,
1
,
TBSTATE_ENABLED
,
BTNS_BUTTON
,
{
0
},
0
,
0
},
{
0
,
3
,
TBSTATE_ENABLED
,
BTNS_BUTTON
,
{
0
},
1
,
2
},
{
0
,
5
,
TBSTATE_ENABLED
,
BTNS_BUTTON
,
{
0
},
2
,
0
},
{
0
,
7
,
TBSTATE_ENABLED
,
BTNS_BUTTON
,
{
0
},
3
,
0
},
{
0
,
9
,
TBSTATE_ENABLED
,
BTNS_BUTTON
,
{
0
},
4
,
0
},
{
0
,
11
,
TBSTATE_ENABLED
,
BTNS_BUTTON
,
{
0
},
5
,
0
},
{
0
,
13
,
TBSTATE_ENABLED
,
BTNS_BUTTON
,
{
0
},
6
,
0
},
{
0
,
0
,
TBSTATE_ENABLED
,
BTNS_BUTTON
,
{
0
},
7
,
0
},
{
0
,
0
,
TBSTATE_ENABLED
,
BTNS_BUTTON
,
{
0
},
8
,
0
},
{
0
,
0
,
TBSTATE_ENABLED
,
BTNS_BUTTON
,
{
0
},
9
,
0
},
{
0
,
0x7fffffff
,
TBSTATE_ENABLED
,
BTNS_BUTTON
,
{
0
},
0xa
,
0
},
};
params
.
hkr
=
HKEY_CURRENT_USER
;
params
.
pszSubKey
=
subkey
;
...
...
@@ -2239,8 +2264,21 @@ static void test_save(void)
rebuild_toolbar
(
&
wnd
);
res
=
SendMessageW
(
wnd
,
TB_SAVERESTOREW
,
FALSE
,
(
LPARAM
)
&
params
);
ok
(
res
,
"restoring failed
\n
"
);
res
=
SendMessageW
(
wnd
,
TB_BUTTONCOUNT
,
0
,
0
);
ok
(
res
==
11
,
"got %d
\n
"
,
res
);
count
=
SendMessageW
(
wnd
,
TB_BUTTONCOUNT
,
0
,
0
);
ok
(
count
==
sizeof
(
expect_btns
)
/
sizeof
(
expect_btns
[
0
]),
"got %d
\n
"
,
count
);
for
(
i
=
0
;
i
<
count
;
i
++
)
{
res
=
SendMessageW
(
wnd
,
TB_GETBUTTON
,
i
,
(
LPARAM
)
&
tb
);
ok
(
res
,
"got %d
\n
"
,
res
);
ok
(
tb
.
iBitmap
==
expect_btns
[
i
].
iBitmap
,
"%d: got %d
\n
"
,
i
,
tb
.
iBitmap
);
ok
(
tb
.
idCommand
==
expect_btns
[
i
].
idCommand
,
"%d: got %d
\n
"
,
i
,
tb
.
idCommand
);
ok
(
tb
.
fsState
==
expect_btns
[
i
].
fsState
,
"%d: got %02x
\n
"
,
i
,
tb
.
fsState
);
ok
(
tb
.
fsStyle
==
expect_btns
[
i
].
fsStyle
,
"%d: got %02x
\n
"
,
i
,
tb
.
fsStyle
);
ok
(
tb
.
dwData
==
expect_btns
[
i
].
dwData
,
"%d: got %lx
\n
"
,
i
,
tb
.
dwData
);
ok
(
tb
.
iString
==
expect_btns
[
i
].
iString
,
"%d: got %lx
\n
"
,
i
,
tb
.
iString
);
}
DestroyWindow
(
wnd
);
RegOpenKeyW
(
HKEY_CURRENT_USER
,
subkey
,
&
key
);
...
...
dlls/comctl32/toolbar.c
View file @
eddfefa5
...
...
@@ -4195,6 +4195,8 @@ TOOLBAR_Restore(TOOLBAR_INFO *infoPtr, const TBSAVEPARAMSW *lpSave)
nmtbr
.
tbButton
.
iBitmap
=
-
1
;
nmtbr
.
tbButton
.
fsState
=
0
;
nmtbr
.
tbButton
.
fsStyle
=
0
;
nmtbr
.
tbButton
.
dwData
=
0
;
nmtbr
.
tbButton
.
iString
=
0
;
if
(
*
nmtbr
.
pCurrent
&
0x80000000
)
{
...
...
@@ -4211,8 +4213,7 @@ TOOLBAR_Restore(TOOLBAR_INFO *infoPtr, const TBSAVEPARAMSW *lpSave)
TOOLBAR_SendNotify
(
&
nmtbr
.
hdr
,
infoPtr
,
TBN_RESTORE
);
/* can't contain real string as we don't know whether
* the client put an ANSI or Unicode string in there */
/* All returned ptrs and -1 are ignored */
if
(
!
IS_INTRESOURCE
(
nmtbr
.
tbButton
.
iString
))
nmtbr
.
tbButton
.
iString
=
0
;
...
...
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