Commit 809abaab authored by Francis Beaudet's avatar Francis Beaudet Committed by Alexandre Julliard

Second part of the OLE datacache implementation.

parent 07d2a789
...@@ -24,10 +24,10 @@ ...@@ -24,10 +24,10 @@
* done in this area. * done in this area.
* *
* - Some functions still return E_NOTIMPL they have to be * - Some functions still return E_NOTIMPL they have to be
* implemented most of those are related to the running of the * implemented. Most of those are related to the running of the
* actual server. * actual server.
* *
* - All the methods releated to notification and advise sinks are * - All the methods related to notification and advise sinks are
* in place but no notifications are sent to the sinks yet. * in place but no notifications are sent to the sinks yet.
*/ */
#include <assert.h> #include <assert.h>
......
...@@ -773,6 +773,45 @@ HRESULT WINAPI OleLoad( ...@@ -773,6 +773,45 @@ HRESULT WINAPI OleLoad(
} }
/*********************************************************************** /***********************************************************************
* OleSave [OLE32.124]
*/
HRESULT WINAPI OleSave(
LPPERSISTSTORAGE pPS,
LPSTORAGE pStg,
BOOL fSameAsLoad)
{
HRESULT hres;
CLSID objectClass;
TRACE(ole,"(%p,%p,%x)\n", pPS, pStg, fSameAsLoad);
/*
* First, we transfer the class ID (if available)
*/
hres = IPersistStorage_GetClassID(pPS, &objectClass);
if (SUCCEEDED(hres))
{
WriteClassStg(pStg, &objectClass);
}
/*
* Then, we ask the object to save itself to the
* storage. If it is successful, we commit the storage.
*/
hres = IPersistStorage_Save(pPS, pStg, fSameAsLoad);
if (SUCCEEDED(hres))
{
IStorage_Commit(pStg,
STGC_DEFAULT);
}
return hres;
}
/***********************************************************************
* OleGetClipboard32 [OLE32.105] * OleGetClipboard32 [OLE32.105]
*/ */
HRESULT WINAPI OleGetClipboard( HRESULT WINAPI OleGetClipboard(
......
...@@ -232,15 +232,3 @@ HRESULT WINAPI OleRegEnumFormatEtc ( ...@@ -232,15 +232,3 @@ HRESULT WINAPI OleRegEnumFormatEtc (
return S_OK; return S_OK;
} }
/***********************************************************************
* OleSave [OLE32.124]
*/
HRESULT WINAPI OleSave(
LPPERSISTSTORAGE pPS,
LPSTORAGE pStg,
BOOL fSameAsLoad)
{
FIXME(ole,"(%p,%p,%x), stub!\n", pPS, pStg, fSameAsLoad);
return S_OK;
}
...@@ -241,8 +241,10 @@ static HRESULT WINAPI OleAdviseHolderImpl_Advise( ...@@ -241,8 +241,10 @@ static HRESULT WINAPI OleAdviseHolderImpl_Advise(
/* /*
* Return the index as the cookie. * Return the index as the cookie.
* Since 0 is not a valid cookie, we will increment by
* 1 the index in the table.
*/ */
*pdwConnection = index; *pdwConnection = index+1;
return S_OK; return S_OK;
} }
...@@ -259,9 +261,17 @@ static HRESULT WINAPI OleAdviseHolderImpl_Unadvise( ...@@ -259,9 +261,17 @@ static HRESULT WINAPI OleAdviseHolderImpl_Unadvise(
TRACE(ole, "(%p, %lu)\n", This, dwConnection); TRACE(ole, "(%p, %lu)\n", This, dwConnection);
/* /*
* So we don't return 0 as a cookie, the index was
* incremented by 1 in OleAdviseHolderImpl_Advise
* we have to compensate.
*/
dwConnection--;
/*
* Check for invalid cookies. * Check for invalid cookies.
*/ */
if (dwConnection >= This->maxSinks) if ( (dwConnection < 0) ||
(dwConnection >= This->maxSinks) )
return OLE_E_NOCONNECTION; return OLE_E_NOCONNECTION;
if (This->arrayOfSinks[dwConnection] == NULL) if (This->arrayOfSinks[dwConnection] == NULL)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment