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
47967b7c
Commit
47967b7c
authored
Jan 22, 2018
by
Huw Davies
Committed by
Alexandre Julliard
Jan 22, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Implement saving of view cache entries.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
dfe813e3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
8 deletions
+34
-8
datacache.c
dlls/ole32/datacache.c
+21
-2
ole2.c
dlls/ole32/tests/ole2.c
+13
-6
No files found.
dlls/ole32/datacache.c
View file @
47967b7c
...
...
@@ -506,7 +506,9 @@ static HRESULT write_clipformat(IStream *stream, CLIPFORMAT clipformat)
HRESULT
hr
;
char
format_name
[
256
];
if
(
clipformat
<
0xc000
)
if
(
clipformat
==
0
)
length
=
0
;
else
if
(
clipformat
<
0xc000
)
length
=
-
1
;
else
{
...
...
@@ -515,8 +517,9 @@ static HRESULT write_clipformat(IStream *stream, CLIPFORMAT clipformat)
if
(
length
)
length
++
;
}
hr
=
IStream_Write
(
stream
,
&
length
,
sizeof
(
length
),
NULL
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
)
||
clipformat
==
0
)
return
hr
;
if
(
clipformat
<
0xc000
)
{
DWORD
cf
=
clipformat
;
...
...
@@ -993,6 +996,19 @@ static HRESULT save_emf(DataCacheEntry *entry, BOOL contents, IStream *stream)
return
hr
;
}
static
HRESULT
save_view_cache
(
DataCacheEntry
*
entry
,
IStream
*
stream
)
{
HRESULT
hr
;
PresentationDataHeader
header
;
init_stream_header
(
entry
,
&
header
);
hr
=
write_clipformat
(
stream
,
entry
->
fmtetc
.
cfFormat
);
if
(
SUCCEEDED
(
hr
))
hr
=
IStream_Write
(
stream
,
&
header
,
FIELD_OFFSET
(
PresentationDataHeader
,
unknown7
),
NULL
);
return
hr
;
}
static
const
WCHAR
CONTENTS
[]
=
{
'C'
,
'O'
,
'N'
,
'T'
,
'E'
,
'N'
,
'T'
,
'S'
,
0
};
static
HRESULT
create_stream
(
DataCacheEntry
*
cache_entry
,
IStorage
*
storage
,
BOOL
contents
,
IStream
**
stream
)
...
...
@@ -1037,6 +1053,9 @@ static HRESULT DataCacheEntry_Save(DataCacheEntry *cache_entry, IStorage *storag
case
CF_ENHMETAFILE
:
hr
=
save_emf
(
cache_entry
,
contents
,
stream
);
break
;
case
0
:
hr
=
save_view_cache
(
cache_entry
,
stream
);
break
;
default:
FIXME
(
"got unsupported clipboard format %x
\n
"
,
cache_entry
->
fmtetc
.
cfFormat
);
}
...
...
dlls/ole32/tests/ole2.c
View file @
47967b7c
...
...
@@ -3986,13 +3986,18 @@ static void check_storage_contents(IStorage *stg, const struct storage_def *stg_
hr
=
IStorage_OpenStream
(
stg
,
stat
.
pwcsName
,
NULL
,
STGM_READ
|
STGM_SHARE_EXCLUSIVE
,
0
,
&
stream
);
ok
(
hr
==
S_OK
,
"unexpected %#x
\n
"
,
hr
);
if
(
!
memcmp
(
name
,
"
\2
OlePres"
,
7
))
if
(
!
memcmp
(
name
,
"
\2
OlePres"
,
8
))
{
ULONG
header_size
=
sizeof
(
header
);
clipformat
=
read_clipformat
(
stream
);
hr
=
IStream_Read
(
stream
,
&
header
,
sizeof
(
header
),
&
bytes
);
if
(
clipformat
==
0
)
/* view cache */
header_size
=
FIELD_OFFSET
(
PresentationDataHeader
,
unknown7
);
hr
=
IStream_Read
(
stream
,
&
header
,
header_size
,
&
bytes
);
ok
(
hr
==
S_OK
,
"unexpected %#x
\n
"
,
hr
);
ok
(
bytes
>=
24
,
"read %u bytes
\n
"
,
bytes
);
ok
(
bytes
==
header_size
,
"read %u bytes, expected %u
\n
"
,
bytes
,
header_size
);
if
(
winetest_debug
>
1
)
trace
(
"header: tdSize %#x, dvAspect %#x, lindex %#x, advf %#x, unknown7 %#x, dwObjectExtentX %#x, dwObjectExtentY %#x, dwSize %#x
\n
"
,
...
...
@@ -4228,12 +4233,14 @@ static void test_data_cache_save_data(void)
{
CF_DIB
,
0
,
DVASPECT_CONTENT
,
-
1
,
TYMED_HGLOBAL
},
{
CF_METAFILEPICT
,
0
,
DVASPECT_CONTENT
,
-
1
,
TYMED_MFPICT
},
{
CF_ENHMETAFILE
,
0
,
DVASPECT_CONTENT
,
-
1
,
TYMED_ENHMF
},
{
0
,
0
,
DVASPECT_DOCPRINT
,
-
1
,
TYMED_HGLOBAL
},
},
3
,
3
,
&
CLSID_WineTest
,
4
,
3
,
&
CLSID_WineTest
,
{
&
CLSID_WineTestOld
,
3
,
{
{
"
\2
OlePres000"
,
CF_DIB
,
DVASPECT_CONTENT
,
0
,
NULL
,
0
},
&
CLSID_WineTestOld
,
4
,
{
{
"
\2
OlePres000"
,
CF_DIB
,
DVASPECT_CONTENT
,
0
,
NULL
,
0
},
{
"
\2
OlePres001"
,
CF_METAFILEPICT
,
DVASPECT_CONTENT
,
0
,
NULL
,
0
},
{
"
\2
OlePres002"
,
CF_ENHMETAFILE
,
DVASPECT_CONTENT
,
0
,
NULL
,
0
}
}
{
"
\2
OlePres002"
,
CF_ENHMETAFILE
,
DVASPECT_CONTENT
,
0
,
NULL
,
0
},
{
"
\2
OlePres003"
,
0
,
DVASPECT_DOCPRINT
,
0
,
NULL
,
0
}
}
}
},
/* without setting 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