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
2cd4117f
Commit
2cd4117f
authored
Apr 15, 2008
by
Rob Shearman
Committed by
Alexandre Julliard
Apr 16, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Fix OLEClipbrd_IDataObject_QueryGetData to conform to the tests.
parent
e0ef1f06
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
32 deletions
+12
-32
clipboard.c
dlls/ole32/clipboard.c
+6
-27
clipboard.c
dlls/ole32/tests/clipboard.c
+6
-5
No files found.
dlls/ole32/clipboard.c
View file @
2cd4117f
...
...
@@ -1312,42 +1312,21 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_QueryGetData(
IDataObject
*
iface
,
LPFORMATETC
pformatetc
)
{
/*
* Declare "This" pointer
*/
OLEClipbrd
*
This
=
(
OLEClipbrd
*
)
iface
;
TRACE
(
"(%p, %p)
\n
"
,
iface
,
pformatetc
);
/*
* If we have a data source placed on the clipboard (via OleSetClipboard)
* simply delegate to the source object's QueryGetData
*/
if
(
This
->
pIDataObjectSrc
)
{
return
IDataObject_QueryGetData
(
This
->
pIDataObjectSrc
,
pformatetc
);
}
if
(
!
pformatetc
)
return
E_INVALIDARG
;
/*
if ( pformatetc->dwAspect != DVASPECT_CONTENT )
return DV_E_DVASPECT;
*/
if
(
pformatetc
->
lindex
!=
-
1
)
return
DV_E_LINDEX
;
/* TODO: Handle TYMED_IStorage media which were put on the clipboard
* by copying the storage into global memory. We must convert this
* TYMED_HGLOBAL back to TYMED_IStorage.
*/
if
(
pformatetc
->
tymed
!=
TYMED_HGLOBAL
)
return
DV_E_TYMED
;
if
(
pformatetc
->
dwAspect
!=
DVASPECT_CONTENT
)
return
DV_E_FORMATETC
;
if
(
pformatetc
->
lindex
!=
-
1
)
return
DV_E_FORMATETC
;
/*
* Delegate to the Windows clipboard function IsClipboardFormatAvailable
*/
return
(
IsClipboardFormatAvailable
(
pformatetc
->
cfFormat
))
?
S_OK
:
DV_E_
FORMATETC
;
return
(
IsClipboardFormatAvailable
(
pformatetc
->
cfFormat
))
?
S_OK
:
DV_E_
CLIPFORMAT
;
}
/************************************************************************
...
...
dlls/ole32/tests/clipboard.c
View file @
2cd4117f
...
...
@@ -226,7 +226,7 @@ static HRESULT WINAPI DataObjectImpl_QueryGetData(IDataObject* iface, FORMATETC
BOOL
foundFormat
=
FALSE
;
if
(
!
expect_DataObjectImpl_QueryGetData
)
todo_wine
ok
(
0
,
"unexpected call to DataObjectImpl_QueryGetData
\n
"
);
ok
(
0
,
"unexpected call to DataObjectImpl_QueryGetData
\n
"
);
if
(
pformatetc
->
lindex
!=
-
1
)
return
DV_E_LINDEX
;
...
...
@@ -343,25 +343,26 @@ static void test_get_clipboard(void)
InitFormatEtc
(
fmtetc
,
CF_TEXT
,
TYMED_HGLOBAL
);
fmtetc
.
dwAspect
=
0xdeadbeef
;
hr
=
IDataObject_QueryGetData
(
data_obj
,
&
fmtetc
);
todo_wine
ok
(
hr
==
DV_E_FORMATETC
,
"IDataObject_QueryGetData should have failed with DV_E_FORMATETC instead of 0x%08x
\n
"
,
hr
);
InitFormatEtc
(
fmtetc
,
CF_TEXT
,
TYMED_HGLOBAL
);
fmtetc
.
dwAspect
=
DVASPECT_THUMBNAIL
;
hr
=
IDataObject_QueryGetData
(
data_obj
,
&
fmtetc
);
ok
(
hr
==
DV_E_FORMATETC
,
"IDataObject_QueryGetData should have failed with DV_E_FORMATETC instead of 0x%08x
\n
"
,
hr
);
InitFormatEtc
(
fmtetc
,
CF_TEXT
,
TYMED_HGLOBAL
);
fmtetc
.
lindex
=
256
;
hr
=
IDataObject_QueryGetData
(
data_obj
,
&
fmtetc
);
todo_wine
ok
(
hr
==
DV_E_FORMATETC
,
"IDataObject_QueryGetData should have failed with DV_E_FORMATETC instead of 0x%08x
\n
"
,
hr
);
InitFormatEtc
(
fmtetc
,
CF_TEXT
,
TYMED_HGLOBAL
);
fmtetc
.
cfFormat
=
CF_RIFF
;
hr
=
IDataObject_QueryGetData
(
data_obj
,
&
fmtetc
);
todo_wine
ok
(
hr
==
DV_E_CLIPFORMAT
,
"IDataObject_QueryGetData should have failed with DV_E_CLIPFORMAT instead of 0x%08x
\n
"
,
hr
);
InitFormatEtc
(
fmtetc
,
CF_TEXT
,
TYMED_HGLOBAL
);
fmtetc
.
tymed
=
TYMED_FILE
;
hr
=
IDataObject_QueryGetData
(
data_obj
,
&
fmtetc
);
todo_wine
ok
(
hr
==
S_OK
,
"IDataObject_QueryGetData failed with error 0x%08x
\n
"
,
hr
);
expect_DataObjectImpl_QueryGetData
=
TRUE
;
...
...
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