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
6235ac9f
Commit
6235ac9f
authored
Dec 04, 2006
by
Rob Shearman
Committed by
Alexandre Julliard
Dec 04, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Implement the DiscardCache function in the data cache.
parent
9108eede
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
7 deletions
+28
-7
datacache.c
dlls/ole32/datacache.c
+27
-4
ole2.c
dlls/ole32/tests/ole2.c
+1
-3
No files found.
dlls/ole32/datacache.c
View file @
6235ac9f
...
...
@@ -732,6 +732,13 @@ static HRESULT DataCacheEntry_SetData(DataCacheEntry *This,
&
This
->
stgmedium
,
stgmedium
);
}
static
inline
HRESULT
DataCacheEntry_DiscardData
(
DataCacheEntry
*
This
)
{
ReleaseStgMedium
(
&
This
->
stgmedium
);
This
->
data_cf
=
This
->
fmtetc
.
cfFormat
;
return
S_OK
;
}
/*********************************************************
* Method implementation for the non delegating IUnknown
* part of the DataCache class.
...
...
@@ -1327,7 +1334,7 @@ static HRESULT WINAPI DataCache_Load(
hr
=
DataCache_CreateEntry
(
This
,
&
fmtetc
,
&
cache_entry
);
if
(
SUCCEEDED
(
hr
))
{
ReleaseStgMedium
(
&
cache_entry
->
stgmedium
);
DataCacheEntry_DiscardData
(
cache_entry
);
if
(
cache_entry
->
storage
)
IStorage_Release
(
cache_entry
->
storage
);
cache_entry
->
storage
=
pStg
;
IStorage_AddRef
(
pStg
);
...
...
@@ -2016,7 +2023,7 @@ static HRESULT WINAPI DataCache_UpdateCache(
DWORD
grfUpdf
,
LPVOID
pReserved
)
{
FIXME
(
"
stub
\n
"
);
FIXME
(
"
(%p, 0x%x, %p): stub
\n
"
,
pDataObject
,
grfUpdf
,
pReserved
);
return
E_NOTIMPL
;
}
...
...
@@ -2024,8 +2031,24 @@ static HRESULT WINAPI DataCache_DiscardCache(
IOleCache2
*
iface
,
DWORD
dwDiscardOptions
)
{
FIXME
(
"stub
\n
"
);
return
E_NOTIMPL
;
DataCache
*
This
=
impl_from_IOleCache2
(
iface
);
DataCacheEntry
*
cache_entry
;
HRESULT
hr
=
S_OK
;
TRACE
(
"(%d)
\n
"
,
dwDiscardOptions
);
if
(
dwDiscardOptions
==
DISCARDCACHE_SAVEIFDIRTY
)
hr
=
DataCache_Save
((
IPersistStorage
*
)
&
This
->
lpvtblIPersistStorage
,
This
->
presentationStorage
,
TRUE
);
LIST_FOR_EACH_ENTRY
(
cache_entry
,
&
This
->
cache_list
,
DataCacheEntry
,
entry
)
{
hr
=
DataCacheEntry_DiscardData
(
cache_entry
);
if
(
FAILED
(
hr
))
break
;
}
return
hr
;
}
...
...
dlls/ole32/tests/ole2.c
View file @
6235ac9f
...
...
@@ -1261,9 +1261,7 @@ static void test_data_cache(void)
/* unload the cached storage object, causing it to be reloaded */
hr
=
IOleCache2_DiscardCache
(
pOleCache
,
DISCARDCACHE_NOSAVE
);
todo_wine
{
ok_ole_success
(
hr
,
"IOleCache2_DiscardCache"
);
}
hr
=
IViewObject_Draw
(
pViewObject
,
DVASPECT_ICON
,
-
1
,
NULL
,
NULL
,
NULL
,
hdcMem
,
&
rcBounds
,
NULL
,
draw_continue
,
0xdeadbeef
);
ok_ole_success
(
hr
,
"IViewObject_Draw"
);
...
...
@@ -1272,10 +1270,10 @@ static void test_data_cache(void)
ok_ole_success
(
hr
,
"IPersistStorage_HandsOffStorage"
);
hr
=
IViewObject_Draw
(
pViewObject
,
DVASPECT_ICON
,
-
1
,
NULL
,
NULL
,
NULL
,
hdcMem
,
&
rcBounds
,
NULL
,
draw_continue
,
0xdeadbeef
);
ok_ole_success
(
hr
,
"IViewObject_Draw"
);
todo_wine
{
hr
=
IOleCache2_DiscardCache
(
pOleCache
,
DISCARDCACHE_NOSAVE
);
ok_ole_success
(
hr
,
"IOleCache2_DiscardCache"
);
hr
=
IViewObject_Draw
(
pViewObject
,
DVASPECT_ICON
,
-
1
,
NULL
,
NULL
,
NULL
,
hdcMem
,
&
rcBounds
,
NULL
,
draw_continue
,
0xdeadbeef
);
todo_wine
{
ok
(
hr
==
OLE_E_BLANK
,
"IViewObject_Draw with uncached aspect should have returned OLE_E_BLANK instead of 0x%08x
\n
"
,
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