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
d37b6695
Commit
d37b6695
authored
Dec 02, 2006
by
Rob Shearman
Committed by
Alexandre Julliard
Dec 04, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Check that the specified clipboard format and tymed are valid in…
ole32: Check that the specified clipboard format and tymed are valid in IOleCache::Cache in the data cache.
parent
d9d67321
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
1 deletion
+29
-1
datacache.c
dlls/ole32/datacache.c
+29
-1
No files found.
dlls/ole32/datacache.c
View file @
d37b6695
...
...
@@ -249,8 +249,36 @@ static DataCacheEntry *DataCache_GetEntryForFormatEtc(DataCache *This, const FOR
return
NULL
;
}
/* checks that the clipformat and tymed are valid and returns an error if they
* aren't and CACHE_S_NOTSUPPORTED if they are valid, but can't be rendered by
* DataCache_Draw */
static
HRESULT
check_valid_clipformat_and_tymed
(
CLIPFORMAT
cfFormat
,
DWORD
tymed
)
{
if
(
!
cfFormat
||
!
tymed
||
(
cfFormat
==
CF_METAFILEPICT
&&
tymed
==
TYMED_MFPICT
)
||
(
cfFormat
==
CF_BITMAP
&&
tymed
==
TYMED_GDI
)
||
(
cfFormat
==
CF_DIB
&&
tymed
==
TYMED_HGLOBAL
)
||
(
cfFormat
==
CF_ENHMETAFILE
&&
tymed
==
TYMED_ENHMF
))
return
S_OK
;
else
if
(
tymed
==
TYMED_HGLOBAL
)
return
CACHE_S_FORMATETC_NOTSUPPORTED
;
else
{
WARN
(
"invalid clipformat/tymed combination: %d/%d
\n
"
,
cfFormat
,
tymed
);
return
DV_E_TYMED
;
}
}
static
HRESULT
DataCache_CreateEntry
(
DataCache
*
This
,
const
FORMATETC
*
formatetc
,
DataCacheEntry
**
cache_entry
)
{
HRESULT
hr
;
hr
=
check_valid_clipformat_and_tymed
(
formatetc
->
cfFormat
,
formatetc
->
tymed
);
if
(
FAILED
(
hr
))
return
hr
;
if
(
hr
==
CACHE_S_FORMATETC_NOTSUPPORTED
)
TRACE
(
"creating unsupported format %d
\n
"
,
formatetc
->
cfFormat
);
*
cache_entry
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
**
cache_entry
));
if
(
!*
cache_entry
)
return
E_OUTOFMEMORY
;
...
...
@@ -268,7 +296,7 @@ static HRESULT DataCache_CreateEntry(DataCache *This, const FORMATETC *formatetc
(
*
cache_entry
)
->
dirty
=
TRUE
;
(
*
cache_entry
)
->
stream_number
=
-
1
;
list_add_tail
(
&
This
->
cache_list
,
&
(
*
cache_entry
)
->
entry
);
return
S_OK
;
return
hr
;
}
/************************************************************************
...
...
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