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
bcf38fc5
Commit
bcf38fc5
authored
Jun 03, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Jun 15, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Workaround use after free warnings.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
parent
197c2409
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
clipboard.c
dlls/user32/tests/clipboard.c
+4
-2
No files found.
dlls/user32/tests/clipboard.c
View file @
bcf38fc5
...
...
@@ -29,6 +29,7 @@
static
BOOL
(
WINAPI
*
pAddClipboardFormatListener
)(
HWND
hwnd
);
static
BOOL
(
WINAPI
*
pRemoveClipboardFormatListener
)(
HWND
hwnd
);
static
BOOL
(
WINAPI
*
pGetUpdatedClipboardFormats
)(
UINT
*
formats
,
UINT
count
,
UINT
*
out_count
);
static
HGLOBAL
(
WINAPI
*
pGlobalFree
)(
HGLOBAL
);
static
int
thread_from_line
;
static
char
*
argv0
;
...
...
@@ -2073,7 +2074,7 @@ static void test_data_handles(void)
metafile
=
create_metafile
();
h
=
SetClipboardData
(
CF_METAFILEPICT
,
metafile
);
ok
(
h
==
metafile
,
"Expected metafilepict %p, got %p.
\n
"
,
metafile
,
h
);
ok
(
!
GlobalFree
(
metafile
),
"GlobalFree failed.
\n
"
);
ok
(
!
p
GlobalFree
(
metafile
),
"GlobalFree failed.
\n
"
);
h
=
GetClipboardData
(
CF_METAFILEPICT
);
ok
(
h
==
metafile
,
"Expected metafile %p, got %p.
\n
"
,
metafile
,
h
);
ok
(
is_freed
(
h
),
"Expected freed mem %p.
\n
"
,
h
);
...
...
@@ -2081,7 +2082,7 @@ static void test_data_handles(void)
metafile
=
create_metafile
();
h
=
SetClipboardData
(
CF_DSPMETAFILEPICT
,
metafile
);
ok
(
h
==
metafile
,
"Expected metafilepict %p, got %p.
\n
"
,
metafile
,
h
);
ok
(
!
GlobalFree
(
metafile
),
"GlobalFree failed.
\n
"
);
ok
(
!
p
GlobalFree
(
metafile
),
"GlobalFree failed.
\n
"
);
h
=
GetClipboardData
(
CF_DSPMETAFILEPICT
);
ok
(
h
==
metafile
,
"Expected metafile %p, got %p.
\n
"
,
metafile
,
h
);
ok
(
is_freed
(
h
),
"Expected freed mem %p.
\n
"
,
h
);
...
...
@@ -2343,6 +2344,7 @@ START_TEST(clipboard)
pAddClipboardFormatListener
=
(
void
*
)
GetProcAddress
(
mod
,
"AddClipboardFormatListener"
);
pRemoveClipboardFormatListener
=
(
void
*
)
GetProcAddress
(
mod
,
"RemoveClipboardFormatListener"
);
pGetUpdatedClipboardFormats
=
(
void
*
)
GetProcAddress
(
mod
,
"GetUpdatedClipboardFormats"
);
pGlobalFree
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"kernel32"
),
"GlobalFree"
);
if
(
argc
==
4
&&
!
strcmp
(
argv
[
2
],
"set_clipboard_data"
))
{
...
...
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