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
1e73a546
Commit
1e73a546
authored
Apr 16, 2009
by
Huw Davies
Committed by
Alexandre Julliard
Apr 21, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Check that the target devices match.
parent
bdca138d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
1 deletion
+37
-1
clipboard.c
dlls/ole32/clipboard.c
+36
-0
clipboard.c
dlls/ole32/tests/clipboard.c
+1
-1
No files found.
dlls/ole32/clipboard.c
View file @
1e73a546
...
...
@@ -1063,6 +1063,36 @@ static HRESULT get_stgmed_for_storage(HGLOBAL h, STGMEDIUM *med)
return
hr
;
}
static
inline
BOOL
string_off_equal
(
const
DVTARGETDEVICE
*
t1
,
WORD
off1
,
const
DVTARGETDEVICE
*
t2
,
WORD
off2
)
{
const
WCHAR
*
str1
,
*
str2
;
if
(
off1
==
0
&&
off2
==
0
)
return
TRUE
;
if
(
off1
==
0
||
off2
==
0
)
return
FALSE
;
str1
=
(
const
WCHAR
*
)((
const
char
*
)
t1
+
off1
);
str2
=
(
const
WCHAR
*
)((
const
char
*
)
t2
+
off2
);
return
!
lstrcmpW
(
str1
,
str2
);
}
static
inline
BOOL
td_equal
(
const
DVTARGETDEVICE
*
t1
,
const
DVTARGETDEVICE
*
t2
)
{
if
(
t1
==
NULL
&&
t2
==
NULL
)
return
TRUE
;
if
(
t1
==
NULL
||
t2
==
NULL
)
return
FALSE
;
if
(
!
string_off_equal
(
t1
,
t1
->
tdDriverNameOffset
,
t2
,
t2
->
tdDriverNameOffset
))
return
FALSE
;
if
(
!
string_off_equal
(
t1
,
t1
->
tdDeviceNameOffset
,
t2
,
t2
->
tdDeviceNameOffset
))
return
FALSE
;
if
(
!
string_off_equal
(
t1
,
t1
->
tdPortNameOffset
,
t2
,
t2
->
tdPortNameOffset
))
return
FALSE
;
/* FIXME check devmode? */
return
TRUE
;
}
/************************************************************************
* snapshot_GetData
*/
...
...
@@ -1105,6 +1135,11 @@ static HRESULT WINAPI snapshot_GetData(IDataObject *iface, FORMATETC *fmt,
entry
=
find_format_in_list
(
enum_data
->
entries
,
enum_data
->
count
,
fmt
->
cfFormat
);
if
(
entry
)
{
if
(
!
td_equal
(
fmt
->
ptd
,
entry
->
fmtetc
.
ptd
))
{
hr
=
DV_E_FORMATETC
;
goto
end
;
}
mask
=
fmt
->
tymed
&
entry
->
fmtetc
.
tymed
;
if
(
!
mask
)
mask
=
fmt
->
tymed
&
(
TYMED_ISTREAM
|
TYMED_HGLOBAL
);
}
...
...
@@ -1125,6 +1160,7 @@ static HRESULT WINAPI snapshot_GetData(IDataObject *iface, FORMATETC *fmt,
}
end:
HeapFree
(
GetProcessHeap
(),
0
,
enum_data
);
if
(
!
CloseClipboard
()
)
hr
=
CLIPBRD_E_CANT_CLOSE
;
return
hr
;
}
...
...
dlls/ole32/tests/clipboard.c
View file @
1e73a546
...
...
@@ -1118,7 +1118,7 @@ static void test_flushed_getdata(void)
InitFormatEtc
(
fmt
,
cf_another
,
0xffff
);
hr
=
IDataObject_GetData
(
get
,
&
fmt
,
&
med
);
todo_wine
ok
(
hr
==
DV_E_FORMATETC
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
DV_E_FORMATETC
,
"got %08x
\n
"
,
hr
);
InitFormatEtc
(
fmt
,
cf_another
,
0xffff
);
memset
(
&
dm
,
0
,
sizeof
(
dm
));
...
...
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