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
4232d31c
Commit
4232d31c
authored
Dec 01, 2006
by
Rob Shearman
Committed by
Alexandre Julliard
Dec 04, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Implement Cache and Uncache for the data cache.
parent
07e3d538
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
9 deletions
+50
-9
datacache.c
dlls/ole32/datacache.c
+50
-9
No files found.
dlls/ole32/datacache.c
View file @
4232d31c
...
@@ -98,6 +98,8 @@ typedef struct DataCacheEntry
...
@@ -98,6 +98,8 @@ typedef struct DataCacheEntry
* representation of the object is stored.
* representation of the object is stored.
*/
*/
IStorage
*
storage
;
IStorage
*
storage
;
DWORD
id
;
}
DataCacheEntry
;
}
DataCacheEntry
;
/****************************************************************************
/****************************************************************************
...
@@ -136,6 +138,9 @@ struct DataCache
...
@@ -136,6 +138,9 @@ struct DataCache
IStorage
*
presentationStorage
;
IStorage
*
presentationStorage
;
struct
list
cache_list
;
struct
list
cache_list
;
/* last id assigned to an object */
DWORD
last_cache_id
;
};
};
typedef
struct
DataCache
DataCache
;
typedef
struct
DataCache
DataCache
;
...
@@ -186,6 +191,15 @@ static DataCache* DataCache_Construct(REFCLSID clsid,
...
@@ -186,6 +191,15 @@ static DataCache* DataCache_Construct(REFCLSID clsid,
static
HRESULT
DataCacheEntry_OpenPresStream
(
DataCacheEntry
*
This
,
static
HRESULT
DataCacheEntry_OpenPresStream
(
DataCacheEntry
*
This
,
IStream
**
pStm
);
IStream
**
pStm
);
static
void
DataCacheEntry_Destroy
(
DataCacheEntry
*
This
)
{
list_remove
(
&
This
->
entry
);
if
(
This
->
storage
)
IStorage_Release
(
This
->
storage
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
fmtetc
.
ptd
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
static
void
DataCache_Destroy
(
static
void
DataCache_Destroy
(
DataCache
*
ptrToDestroy
)
DataCache
*
ptrToDestroy
)
{
{
...
@@ -200,11 +214,7 @@ static void DataCache_Destroy(
...
@@ -200,11 +214,7 @@ static void DataCache_Destroy(
}
}
LIST_FOR_EACH_ENTRY_SAFE
(
cache_entry
,
next_cache_entry
,
&
ptrToDestroy
->
cache_list
,
DataCacheEntry
,
entry
)
LIST_FOR_EACH_ENTRY_SAFE
(
cache_entry
,
next_cache_entry
,
&
ptrToDestroy
->
cache_list
,
DataCacheEntry
,
entry
)
{
DataCacheEntry_Destroy
(
cache_entry
);
IStorage_Release
(
cache_entry
->
storage
);
HeapFree
(
GetProcessHeap
(),
0
,
cache_entry
->
fmtetc
.
ptd
);
HeapFree
(
GetProcessHeap
(),
0
,
cache_entry
);
}
/*
/*
* Free the datacache pointer.
* Free the datacache pointer.
...
@@ -237,6 +247,7 @@ static HRESULT DataCache_CreateEntry(DataCache *This, const FORMATETC *formatetc
...
@@ -237,6 +247,7 @@ static HRESULT DataCache_CreateEntry(DataCache *This, const FORMATETC *formatetc
memcpy
((
*
cache_entry
)
->
fmtetc
.
ptd
,
formatetc
->
ptd
,
formatetc
->
ptd
->
tdSize
);
memcpy
((
*
cache_entry
)
->
fmtetc
.
ptd
,
formatetc
->
ptd
,
formatetc
->
ptd
->
tdSize
);
}
}
(
*
cache_entry
)
->
storage
=
NULL
;
(
*
cache_entry
)
->
storage
=
NULL
;
(
*
cache_entry
)
->
id
=
This
->
last_cache_id
++
;
list_add_tail
(
&
This
->
cache_list
,
&
(
*
cache_entry
)
->
entry
);
list_add_tail
(
&
This
->
cache_list
,
&
(
*
cache_entry
)
->
entry
);
return
S_OK
;
return
S_OK
;
}
}
...
@@ -1646,16 +1657,46 @@ static HRESULT WINAPI DataCache_Cache(
...
@@ -1646,16 +1657,46 @@ static HRESULT WINAPI DataCache_Cache(
DWORD
advf
,
DWORD
advf
,
DWORD
*
pdwConnection
)
DWORD
*
pdwConnection
)
{
{
FIXME
(
"stub
\n
"
);
DataCache
*
This
=
impl_from_IOleCache2
(
iface
);
return
E_NOTIMPL
;
DataCacheEntry
*
cache_entry
;
HRESULT
hr
;
TRACE
(
"(%p, 0x%x, %p)
\n
"
,
pformatetc
,
advf
,
pdwConnection
);
*
pdwConnection
=
0
;
cache_entry
=
DataCache_GetEntryForFormatEtc
(
This
,
pformatetc
);
if
(
cache_entry
)
{
*
pdwConnection
=
cache_entry
->
id
;
return
CACHE_S_SAMECACHE
;
}
hr
=
DataCache_CreateEntry
(
This
,
pformatetc
,
&
cache_entry
);
if
(
SUCCEEDED
(
hr
))
*
pdwConnection
=
cache_entry
->
id
;
return
hr
;
}
}
static
HRESULT
WINAPI
DataCache_Uncache
(
static
HRESULT
WINAPI
DataCache_Uncache
(
IOleCache2
*
iface
,
IOleCache2
*
iface
,
DWORD
dwConnection
)
DWORD
dwConnection
)
{
{
FIXME
(
"stub
\n
"
);
DataCache
*
This
=
impl_from_IOleCache2
(
iface
);
return
E_NOTIMPL
;
DataCacheEntry
*
cache_entry
;
TRACE
(
"(%d)
\n
"
,
dwConnection
);
LIST_FOR_EACH_ENTRY
(
cache_entry
,
&
This
->
cache_list
,
DataCacheEntry
,
entry
)
if
(
cache_entry
->
id
==
dwConnection
)
{
DataCacheEntry_Destroy
(
cache_entry
);
return
S_OK
;
}
return
OLE_E_NOCONNECTION
;
}
}
static
HRESULT
WINAPI
DataCache_EnumCache
(
static
HRESULT
WINAPI
DataCache_EnumCache
(
...
...
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