Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
ce66c8d1
Commit
ce66c8d1
authored
Jan 23, 2018
by
Huw Davies
Committed by
Alexandre Julliard
Jan 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Only load the contents stream for the static clsids.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e3fe1071
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
17 deletions
+30
-17
datacache.c
dlls/ole32/datacache.c
+30
-17
No files found.
dlls/ole32/datacache.c
View file @
ce66c8d1
...
...
@@ -162,6 +162,9 @@ struct DataCache
IAdviseSink
*
sinkInterface
;
CLSID
clsid
;
/* Is the clsid one of the CLSID_Picture classes */
BOOL
clsid_static
;
IStorage
*
presentationStorage
;
/* list of cache entries */
...
...
@@ -1307,9 +1310,13 @@ static HRESULT create_automatic_entry(DataCache *cache, const CLSID *clsid)
while
(
ptr
->
clsid
)
{
if
(
IsEqualCLSID
(
clsid
,
ptr
->
clsid
))
{
cache
->
clsid_static
=
TRUE
;
return
DataCache_CreateEntry
(
cache
,
&
ptr
->
fmt
,
0
,
TRUE
,
NULL
);
}
ptr
++
;
}
cache
->
clsid_static
=
FALSE
;
return
S_OK
;
}
...
...
@@ -1776,24 +1783,33 @@ static HRESULT parse_pres_streams( DataCache *This, IStorage *stg )
static
const
FORMATETC
static_dib_fmt
=
{
CF_DIB
,
NULL
,
DVASPECT_CONTENT
,
-
1
,
TYMED_HGLOBAL
};
static
HRESULT
parse_contents_stream
(
DataCache
*
This
,
IStorage
*
stg
,
IStream
*
stm
)
static
HRESULT
parse_contents_stream
(
DataCache
*
This
,
IStorage
*
stg
)
{
HRESULT
hr
;
STATSTG
stat
;
const
FORMATETC
*
fmt
;
IStream
*
stm
;
hr
=
IStorage_
Stat
(
stg
,
&
stat
,
STATFLAG_NONAME
);
hr
=
IStorage_
OpenStream
(
stg
,
CONTENTS
,
NULL
,
STGM_READ
|
STGM_SHARE_EXCLUSIVE
,
0
,
&
stm
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
IStorage_Stat
(
stg
,
&
stat
,
STATFLAG_NONAME
);
if
(
FAILED
(
hr
))
goto
done
;
if
(
IsEqualCLSID
(
&
stat
.
clsid
,
&
CLSID_Picture_Dib
))
fmt
=
&
static_dib_fmt
;
else
{
FIXME
(
"unsupported format %s
\n
"
,
debugstr_guid
(
&
stat
.
clsid
));
return
E_FAIL
;
hr
=
E_FAIL
;
goto
done
;
}
return
add_cache_entry
(
This
,
fmt
,
0
,
stm
,
contents_stream
);
hr
=
add_cache_entry
(
This
,
fmt
,
0
,
stm
,
contents_stream
);
done:
IStream_Release
(
stm
);
return
hr
;
}
/************************************************************************
...
...
@@ -1804,42 +1820,38 @@ static HRESULT parse_contents_stream( DataCache *This, IStorage *stg, IStream *s
* and it will load the presentation information when the
* IDataObject_GetData or IViewObject2_Draw methods are called.
*/
static
HRESULT
WINAPI
DataCache_Load
(
IPersistStorage
*
iface
,
IStorage
*
pS
tg
)
static
HRESULT
WINAPI
DataCache_Load
(
IPersistStorage
*
iface
,
IStorage
*
s
tg
)
{
DataCache
*
This
=
impl_from_IPersistStorage
(
iface
);
HRESULT
hr
;
IStream
*
stm
;
CLSID
clsid
;
DataCacheEntry
*
entry
,
*
cursor2
;
TRACE
(
"(%p, %p)
\n
"
,
iface
,
pS
tg
);
TRACE
(
"(%p, %p)
\n
"
,
iface
,
s
tg
);
IPersistStorage_HandsOffStorage
(
iface
);
LIST_FOR_EACH_ENTRY_SAFE
(
entry
,
cursor2
,
&
This
->
cache_list
,
DataCacheEntry
,
entry
)
DataCacheEntry_Destroy
(
This
,
entry
);
ReadClassStg
(
pS
tg
,
&
clsid
);
ReadClassStg
(
s
tg
,
&
clsid
);
hr
=
create_automatic_entry
(
This
,
&
clsid
);
if
(
FAILED
(
hr
))
return
hr
;
This
->
clsid
=
clsid
;
hr
=
IStorage_OpenStream
(
pStg
,
CONTENTS
,
NULL
,
STGM_READ
|
STGM_SHARE_EXCLUSIVE
,
0
,
&
stm
);
if
(
SUCCEEDED
(
hr
))
if
(
This
->
clsid_static
)
{
hr
=
parse_contents_stream
(
This
,
pStg
,
stm
);
IStream_Release
(
stm
);
hr
=
parse_contents_stream
(
This
,
stg
);
if
(
FAILED
(
hr
))
hr
=
parse_pres_streams
(
This
,
stg
);
}
if
(
FAILED
(
hr
))
hr
=
parse_pres_streams
(
This
,
pStg
);
else
hr
=
parse_pres_streams
(
This
,
stg
);
if
(
SUCCEEDED
(
hr
))
{
This
->
dirty
=
FALSE
;
This
->
presentationStorage
=
pS
tg
;
This
->
presentationStorage
=
s
tg
;
IStorage_AddRef
(
This
->
presentationStorage
);
}
...
...
@@ -2978,6 +2990,7 @@ static DataCache* DataCache_Construct(
newObject
->
sinkAdviseFlag
=
0
;
newObject
->
sinkInterface
=
0
;
newObject
->
clsid
=
CLSID_NULL
;
newObject
->
clsid_static
=
FALSE
;
newObject
->
presentationStorage
=
NULL
;
list_init
(
&
newObject
->
cache_list
);
newObject
->
last_cache_id
=
2
;
...
...
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