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
df3c2a4a
Commit
df3c2a4a
authored
Oct 01, 2016
by
Sebastian Lackner
Committed by
Alexandre Julliard
Oct 01, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Also release GMEM_FIXED data in free_cached_data.
Signed-off-by:
Sebastian Lackner
<
sebastian@fds-team.de
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b6b54fa1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
11 deletions
+12
-11
clipboard.c
dlls/user32/clipboard.c
+0
-4
clipboard.c
dlls/user32/tests/clipboard.c
+12
-7
No files found.
dlls/user32/clipboard.c
View file @
df3c2a4a
...
...
@@ -326,11 +326,7 @@ static void free_cached_data( struct cached_format *cache )
GlobalFree
(
cache
->
handle
);
break
;
default:
if
((
ptr
=
GlobalLock
(
cache
->
handle
))
&&
ptr
!=
cache
->
handle
)
{
GlobalUnlock
(
cache
->
handle
);
GlobalFree
(
cache
->
handle
);
}
break
;
}
list_remove
(
&
cache
->
entry
);
...
...
dlls/user32/tests/clipboard.c
View file @
df3c2a4a
...
...
@@ -1590,9 +1590,7 @@ static BOOL is_fixed( HANDLE handle )
static
BOOL
is_freed
(
HANDLE
handle
)
{
void
*
ptr
=
GlobalLock
(
handle
);
if
(
ptr
)
GlobalUnlock
(
handle
);
return
!
ptr
;
return
!
GlobalSize
(
handle
);
}
static
UINT
format_id
;
...
...
@@ -1602,7 +1600,8 @@ static const LOGPALETTE logpalette = { 0x300, 1, {{ 0x12, 0x34, 0x56, 0x78 }}};
static
void
test_handles
(
HWND
hwnd
)
{
HGLOBAL
h
,
htext
,
htext2
,
htext3
,
htext4
,
htext5
,
hfixed
,
hmoveable
,
empty_fixed
,
empty_moveable
;
HGLOBAL
h
,
htext
,
htext2
,
htext3
,
htext4
,
htext5
;
HGLOBAL
hfixed
,
hfixed2
,
hmoveable
,
empty_fixed
,
empty_moveable
;
void
*
ptr
;
UINT
format_id2
=
RegisterClipboardFormatA
(
"another format"
);
BOOL
r
;
...
...
@@ -1622,6 +1621,7 @@ static void test_handles( HWND hwnd )
palette
=
CreatePalette
(
&
logpalette
);
hfixed
=
GlobalAlloc
(
GMEM_FIXED
,
17
);
hfixed2
=
GlobalAlloc
(
GMEM_FIXED
,
17
);
ok
(
is_fixed
(
hfixed
),
"expected fixed mem %p
\n
"
,
hfixed
);
ok
(
GlobalSize
(
hfixed
)
==
17
,
"wrong size %lu
\n
"
,
GlobalSize
(
hfixed
));
...
...
@@ -1682,8 +1682,8 @@ static void test_handles( HWND hwnd )
h
=
SetClipboardData
(
format_id2
,
empty_fixed
);
ok
(
h
==
empty_fixed
,
"got %p
\n
"
,
h
);
ok
(
is_fixed
(
h
),
"expected fixed mem %p
\n
"
,
h
);
h
=
SetClipboardData
(
0xdeadbeef
,
hfixed
);
ok
(
h
==
hfixed
,
"got %p
\n
"
,
h
);
h
=
SetClipboardData
(
0xdeadbeef
,
hfixed
2
);
ok
(
h
==
hfixed
2
,
"got %p
\n
"
,
h
);
ok
(
is_fixed
(
h
),
"expected fixed mem %p
\n
"
,
h
);
h
=
SetClipboardData
(
0xdeadbabe
,
hmoveable
);
ok
(
h
==
hmoveable
,
"got %p
\n
"
,
h
);
...
...
@@ -1719,7 +1719,7 @@ static void test_handles( HWND hwnd )
ok
(
is_fixed
(
data
),
"expected fixed mem %p
\n
"
,
data
);
data
=
GetClipboardData
(
0xdeadbeef
);
ok
(
data
==
hfixed
,
"wrong data %p
\n
"
,
data
);
ok
(
data
==
hfixed
2
,
"wrong data %p
\n
"
,
data
);
ok
(
is_fixed
(
data
),
"expected fixed mem %p
\n
"
,
data
);
data
=
GetClipboardData
(
0xdeadbabe
);
...
...
@@ -1734,6 +1734,11 @@ static void test_handles( HWND hwnd )
ok
(
is_moveable
(
h
),
"expected moveable mem %p
\n
"
,
h
);
ok
(
is_freed
(
htext5
),
"expected freed mem %p
\n
"
,
htext5
);
h
=
SetClipboardData
(
0xdeadbeef
,
hfixed
);
ok
(
h
==
hfixed
,
"got %p
\n
"
,
h
);
ok
(
is_fixed
(
h
),
"expected fixed mem %p
\n
"
,
h
);
ok
(
is_freed
(
hfixed2
)
||
broken
(
!
is_freed
(
hfixed2
))
/* < Vista */
,
"expected freed mem %p
\n
"
,
hfixed2
);
r
=
CloseClipboard
();
ok
(
r
,
"gle %d
\n
"
,
GetLastError
()
);
...
...
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