winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
December 2006
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
4 participants
720 discussions
Start a n
N
ew thread
Rob Shearman : ole32: Fill in the xExt and yExt fields in OleMetafilePictFromIconAndLabel.
by Alexandre Julliard
04 Dec '06
04 Dec '06
Module: wine Branch: master Commit: cdb86c6c90ca37884f64e39473d7d8a77bd53ce1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cdb86c6c90ca37884f64e3947…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Fri Dec 1 15:05:30 2006 +0000 ole32: Fill in the xExt and yExt fields in OleMetafilePictFromIconAndLabel. --- dlls/ole32/ole32_main.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/dlls/ole32/ole32_main.c b/dlls/ole32/ole32_main.c index 377aa4d..493d246 100644 --- a/dlls/ole32/ole32_main.c +++ b/dlls/ole32/ole32_main.c @@ -32,6 +32,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(ole); +#define HIMETRIC_INCHES 2540 + /*********************************************************************** * OleMetafilePictFromIconAndLabel (OLE32.@) */ @@ -120,7 +122,10 @@ HGLOBAL WINAPI OleMetafilePictFromIconAn } mfp.mm = MM_ANISOTROPIC; - mfp.xExt = mfp.yExt = 0; /* FIXME ? */ + hdcScreen = GetDC(NULL); + mfp.xExt = MulDiv(width, HIMETRIC_INCHES, GetDeviceCaps(hdcScreen, LOGPIXELSX)); + mfp.yExt = MulDiv(label_offset + text_size.cy, HIMETRIC_INCHES, GetDeviceCaps(hdcScreen, LOGPIXELSY)); + ReleaseDC(NULL, hdcScreen); mfp.hMF = CloseMetaFile(hdc); DeleteObject(font); if( !mfp.hMF )
1
0
0
0
Rob Shearman : ole32: Use the default icon title font when writing the caption text out in OleMetafilePictFromIconAndLabel .
by Alexandre Julliard
04 Dec '06
04 Dec '06
Module: wine Branch: master Commit: 2fa7cadf07c92128c2954677a619a0a14b7682c5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2fa7cadf07c92128c2954677a…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Fri Dec 1 15:05:17 2006 +0000 ole32: Use the default icon title font when writing the caption text out in OleMetafilePictFromIconAndLabel. --- dlls/ole32/ole32_main.c | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/dlls/ole32/ole32_main.c b/dlls/ole32/ole32_main.c index b9c2b67..377aa4d 100644 --- a/dlls/ole32/ole32_main.c +++ b/dlls/ole32/ole32_main.c @@ -49,15 +49,29 @@ HGLOBAL WINAPI OleMetafilePictFromIconAn INT icon_height; INT label_offset; HDC hdcScreen; + LOGFONTW lf; + HFONT font; TRACE("%p %p %s %d\n", hIcon, lpszLabel, debugstr_w(lpszSourceFile), iIconIndex); if( !hIcon ) return NULL; + if (!SystemParametersInfoW(SPI_GETICONTITLELOGFONT, sizeof(lf), &lf, 0)) + return NULL; + + font = CreateFontIndirectW(&lf); + if (!font) + return NULL; + hdc = CreateMetaFileW(NULL); if( !hdc ) + { + DeleteObject(font); return NULL; + } + + SelectObject(hdc, font); ExtEscape(hdc, MFCOMMENT, sizeof(szIconOnly), szIconOnly, 0, NULL); @@ -67,10 +81,13 @@ HGLOBAL WINAPI OleMetafilePictFromIconAn label_offset = icon_height; if (lpszLabel) { + HFONT screen_old_font; /* metafile DCs don't support GetTextExtentPoint32, so size the font * using the desktop window DC */ hdcScreen = GetDC(NULL); + screen_old_font = SelectObject(hdcScreen, font); GetTextExtentPoint32W(hdcScreen, lpszLabel, lstrlenW(lpszLabel), &text_size); + SelectObject(hdcScreen, screen_old_font); ReleaseDC(NULL, hdcScreen); } width = max(text_size.cx, icon_width); @@ -105,6 +122,7 @@ HGLOBAL WINAPI OleMetafilePictFromIconAn mfp.mm = MM_ANISOTROPIC; mfp.xExt = mfp.yExt = 0; /* FIXME ? */ mfp.hMF = CloseMetaFile(hdc); + DeleteObject(font); if( !mfp.hMF ) return NULL;
1
0
0
0
Rob Shearman : ole32: The METAFILEPICT created by OleMetafilePictFromIconAndLabel should have its mapping mode be anisotropic , not isotropic.
by Alexandre Julliard
04 Dec '06
04 Dec '06
Module: wine Branch: master Commit: f0e2ea54e09331d31e728d5ee548e734bcb9f982 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f0e2ea54e09331d31e728d5ee…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Fri Dec 1 15:04:49 2006 +0000 ole32: The METAFILEPICT created by OleMetafilePictFromIconAndLabel should have its mapping mode be anisotropic, not isotropic. --- dlls/ole32/ole32_main.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/ole32/ole32_main.c b/dlls/ole32/ole32_main.c index 87ff539..b9c2b67 100644 --- a/dlls/ole32/ole32_main.c +++ b/dlls/ole32/ole32_main.c @@ -102,7 +102,7 @@ HGLOBAL WINAPI OleMetafilePictFromIconAn ExtEscape(hdc, MFCOMMENT, strlen(szIconIndex)+1, szIconIndex, 0, NULL); } - mfp.mm = MM_ISOTROPIC; + mfp.mm = MM_ANISOTROPIC; mfp.xExt = mfp.yExt = 0; /* FIXME ? */ mfp.hMF = CloseMetaFile(hdc); if( !mfp.hMF )
1
0
0
0
Rob Shearman : ole32: Call SetWindowOrgEx and SetWindowExtEx in OleMetafilePictFromIconAndLabel so that the created metafile scales correctly .
by Alexandre Julliard
04 Dec '06
04 Dec '06
Module: wine Branch: master Commit: 09376ea1f5316dc17ecc8eb624dd3541f48ccf15 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=09376ea1f5316dc17ecc8eb62…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Fri Dec 1 15:04:41 2006 +0000 ole32: Call SetWindowOrgEx and SetWindowExtEx in OleMetafilePictFromIconAndLabel so that the created metafile scales correctly. Centre the icon and the label. --- dlls/ole32/ole32_main.c | 32 +++++++++++++++++++++++++++----- 1 files changed, 27 insertions(+), 5 deletions(-) diff --git a/dlls/ole32/ole32_main.c b/dlls/ole32/ole32_main.c index 1971d0f..87ff539 100644 --- a/dlls/ole32/ole32_main.c +++ b/dlls/ole32/ole32_main.c @@ -40,10 +40,15 @@ HGLOBAL WINAPI OleMetafilePictFromIconAn { METAFILEPICT mfp; HDC hdc; - UINT dy; HGLOBAL hmem = NULL; LPVOID mfdata; static const char szIconOnly[] = "IconOnly"; + SIZE text_size = { 0, 0 }; + INT width; + INT icon_width; + INT icon_height; + INT label_offset; + HDC hdcScreen; TRACE("%p %p %s %d\n", hIcon, lpszLabel, debugstr_w(lpszSourceFile), iIconIndex); @@ -56,11 +61,28 @@ HGLOBAL WINAPI OleMetafilePictFromIconAn ExtEscape(hdc, MFCOMMENT, sizeof(szIconOnly), szIconOnly, 0, NULL); - /* FIXME: things are drawn in the wrong place */ - DrawIcon(hdc, 0, 0, hIcon); - dy = GetSystemMetrics(SM_CXICON); + icon_width = GetSystemMetrics(SM_CXICON); + icon_height = GetSystemMetrics(SM_CYICON); + /* FIXME: should we give the label a bit of padding here? */ + label_offset = icon_height; + if (lpszLabel) + { + /* metafile DCs don't support GetTextExtentPoint32, so size the font + * using the desktop window DC */ + hdcScreen = GetDC(NULL); + GetTextExtentPoint32W(hdcScreen, lpszLabel, lstrlenW(lpszLabel), &text_size); + ReleaseDC(NULL, hdcScreen); + } + width = max(text_size.cx, icon_width); + + SetWindowOrgEx(hdc, 0, 0, NULL); + SetWindowExtEx(hdc, width, label_offset + text_size.cy, NULL); + + /* draw the icon centred */ + DrawIcon(hdc, (width-icon_width) / 2, 0, hIcon); if(lpszLabel) - TextOutW(hdc, 0, dy, lpszLabel, lstrlenW(lpszLabel)); + /* draw the label centred too, if provided */ + TextOutW(hdc, (width-text_size.cx) / 2, label_offset, lpszLabel, lstrlenW(lpszLabel)); if (lpszSourceFile) {
1
0
0
0
Rob Shearman : ole32: Implement saving of the data cache.
by Alexandre Julliard
04 Dec '06
04 Dec '06
Module: wine Branch: master Commit: 587ba29174f67528de0578e079dedf42005c0b47 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=587ba29174f67528de0578e07…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Fri Dec 1 15:04:04 2006 +0000 ole32: Implement saving of the data cache. Document a few of the unknown fields in the presentation data header. --- dlls/ole32/datacache.c | 162 ++++++++++++++++++++++++++++++++++++++++++++--- dlls/ole32/tests/ole2.c | 10 +-- 2 files changed, 155 insertions(+), 17 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=587ba29174f67528de057…
1
0
0
0
Rob Shearman : ole32: Add handling of the dirty state to the data cache and fix InitNew to not call Load .
by Alexandre Julliard
04 Dec '06
04 Dec '06
Module: wine Branch: master Commit: e5c82d3aa4f8f945eedefddecbdc3bbc3cd585e9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e5c82d3aa4f8f945eedefddec…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Fri Dec 1 15:03:19 2006 +0000 ole32: Add handling of the dirty state to the data cache and fix InitNew to not call Load. --- dlls/ole32/datacache.c | 89 ++++++++++++++++++++++++++++++++++------------- dlls/ole32/tests/ole2.c | 2 - 2 files changed, 65 insertions(+), 26 deletions(-) diff --git a/dlls/ole32/datacache.c b/dlls/ole32/datacache.c index 1d7a765..dba012c 100644 --- a/dlls/ole32/datacache.c +++ b/dlls/ole32/datacache.c @@ -88,21 +88,20 @@ typedef struct PresentationDataHeader typedef struct DataCacheEntry { struct list entry; - /* format of this entry */ FORMATETC fmtetc; - /* cached data */ STGMEDIUM stgmedium; - /* * This storage pointer is set through a call to * IPersistStorage_Load. This is where the visual * representation of the object is stored. */ IStorage *storage; - + /* connection ID */ DWORD id; + /* dirty flag */ + BOOL dirty; } DataCacheEntry; /**************************************************************************** @@ -140,10 +139,12 @@ struct DataCache IAdviseSink* sinkInterface; IStorage *presentationStorage; + /* list of cache entries */ struct list cache_list; - /* last id assigned to an entry */ DWORD last_cache_id; + /* dirty flag */ + BOOL dirty; }; typedef struct DataCache DataCache; @@ -257,6 +258,7 @@ static HRESULT DataCache_CreateEntry(Dat (*cache_entry)->stgmedium.pUnkForRelease = NULL; (*cache_entry)->storage = NULL; (*cache_entry)->id = This->last_cache_id++; + (*cache_entry)->dirty = TRUE; list_add_tail(&This->cache_list, &(*cache_entry)->entry); return S_OK; } @@ -557,6 +559,7 @@ static HRESULT copy_stg_medium(CLIPFORMA static HRESULT DataCacheEntry_SetData(DataCacheEntry *This, STGMEDIUM *stgmedium, BOOL fRelease) { + This->dirty = TRUE; ReleaseStgMedium(&This->stgmedium); if (fRelease) { @@ -1052,17 +1055,24 @@ static HRESULT WINAPI DataCache_GetClass /************************************************************************ * DataCache_IsDirty (IPersistStorage) * - * Until we actually connect to a running object and retrieve new - * information to it, we never get dirty. - * * See Windows documentation for more details on IPersistStorage methods. */ static HRESULT WINAPI DataCache_IsDirty( IPersistStorage* iface) { - TRACE("(%p)\n", iface); + DataCache *This = impl_from_IPersistStorage(iface); + DataCacheEntry *cache_entry; + + TRACE("(%p)\n", iface); - return S_FALSE; + if (This->dirty) + return S_OK; + + LIST_FOR_EACH_ENTRY(cache_entry, &This->cache_list, DataCacheEntry, entry) + if (cache_entry->dirty) + return S_OK; + + return S_FALSE; } /************************************************************************ @@ -1077,9 +1087,19 @@ static HRESULT WINAPI DataCache_InitNew( IPersistStorage* iface, IStorage* pStg) { - TRACE("(%p, %p)\n", iface, pStg); + DataCache *This = impl_from_IPersistStorage(iface); + + TRACE("(%p, %p)\n", iface, pStg); + + if (This->presentationStorage != NULL) + IStorage_Release(This->presentationStorage); + + This->presentationStorage = pStg; - return IPersistStorage_Load(iface, pStg); + IStorage_AddRef(This->presentationStorage); + This->dirty = TRUE; + + return S_OK; } /************************************************************************ @@ -1148,6 +1168,7 @@ static HRESULT WINAPI DataCache_Load( if (cache_entry->storage) IStorage_Release(cache_entry->storage); cache_entry->storage = pStg; IStorage_AddRef(pStg); + cache_entry->dirty = FALSE; } } @@ -1158,6 +1179,8 @@ static HRESULT WINAPI DataCache_Load( CoTaskMemFree(elem.pwcsName); } + This->dirty = FALSE; + IEnumSTATSTG_Release(pEnum); IStorage_AddRef(This->presentationStorage); @@ -1179,21 +1202,37 @@ static HRESULT WINAPI DataCache_Save( IStorage* pStg, BOOL fSameAsLoad) { - DataCache *this = impl_from_IPersistStorage(iface); + DataCache *This = impl_from_IPersistStorage(iface); + DataCacheEntry *cache_entry; + BOOL dirty = FALSE; - TRACE("(%p, %p, %d)\n", iface, pStg, fSameAsLoad); + TRACE("(%p, %p, %d)\n", iface, pStg, fSameAsLoad); - if ( (!fSameAsLoad) && - (this->presentationStorage!=NULL) ) - { - return IStorage_CopyTo(this->presentationStorage, - 0, - NULL, - NULL, - pStg); - } + dirty = This->dirty; + if (!dirty) + { + LIST_FOR_EACH_ENTRY(cache_entry, &This->cache_list, DataCacheEntry, entry) + { + dirty = cache_entry->dirty; + if (dirty) + break; + } + } - return S_OK; + /* this is a shortcut if nothing changed */ + if (!dirty && !fSameAsLoad && This->presentationStorage) + { + return IStorage_CopyTo(This->presentationStorage, 0, NULL, NULL, pStg); + } + + LIST_FOR_EACH_ENTRY(cache_entry, &This->cache_list, DataCacheEntry, entry) + { + /* FIXME: actually do the save here */ + cache_entry->dirty = FALSE; + } + + This->dirty = FALSE; + return S_OK; } /************************************************************************ @@ -2060,6 +2099,8 @@ static DataCache* DataCache_Construct( newObject->sinkInterface = 0; newObject->presentationStorage = NULL; list_init(&newObject->cache_list); + newObject->last_cache_id = 1; + newObject->dirty = FALSE; return newObject; } diff --git a/dlls/ole32/tests/ole2.c b/dlls/ole32/tests/ole2.c index 8c9a8b0..18a5a46 100644 --- a/dlls/ole32/tests/ole2.c +++ b/dlls/ole32/tests/ole2.c @@ -1105,9 +1105,7 @@ static void test_data_cache(void) ok_ole_success(hr, "IPersistStorage_InitNew"); hr = IPersistStorage_IsDirty(pPS); - todo_wine { ok_ole_success(hr, "IPersistStorage_IsDirty"); - } hr = IPersistStorage_GetClassID(pPS, &clsid); ok_ole_success(hr, "IPersistStorage_GetClassID");
1
0
0
0
Rob Shearman : ole32: Add documentation for CreateDataCache.
by Alexandre Julliard
04 Dec '06
04 Dec '06
Module: wine Branch: master Commit: e9cc0744cc257de036eb67ecfea16c40194aa546 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e9cc0744cc257de036eb67ecf…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Fri Dec 1 15:02:58 2006 +0000 ole32: Add documentation for CreateDataCache. --- dlls/ole32/datacache.c | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/dlls/ole32/datacache.c b/dlls/ole32/datacache.c index 6ab4187..1d7a765 100644 --- a/dlls/ole32/datacache.c +++ b/dlls/ole32/datacache.c @@ -1937,6 +1937,24 @@ static const IOleCacheControlVtbl DataCa /****************************************************************************** * CreateDataCache [OLE32.@] + * + * Creates a data cache to allow an object to render one or more of its views, + * whether running or not. + * + * PARAMS + * pUnkOuter [I] Outer unknown for the object. + * rclsid [I] + * riid [I] IID of interface to return. + * ppvObj [O] Address where the data cache object will be stored on return. + * + * RETURNS + * Success: S_OK. + * Failure: HRESULT code. + * + * NOTES + * The following interfaces are supported by the returned data cache object: + * IOleCache, IOleCache2, IOleCacheControl, IPersistStorae, IDataObject, + * IViewObject and IViewObject2. */ HRESULT WINAPI CreateDataCache( LPUNKNOWN pUnkOuter,
1
0
0
0
Rob Shearman : ole32: Add some tests for the IViewObject, IOleCache2 and IPersistStorage interfaces of the OLE data cache.
by Alexandre Julliard
04 Dec '06
04 Dec '06
Module: wine Branch: master Commit: 188fe95091225a685ecd4545bdfc565bba8cd741 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=188fe95091225a685ecd4545b…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Fri Dec 1 15:02:50 2006 +0000 ole32: Add some tests for the IViewObject, IOleCache2 and IPersistStorage interfaces of the OLE data cache. --- dlls/ole32/tests/ole2.c | 435 +++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 435 insertions(+), 0 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=188fe95091225a685ecd4…
1
0
0
0
Rob Shearman : ole32: The advise sink for the data cache should be primed with the passed in aspects value , not an arbitrarily selected value.
by Alexandre Julliard
04 Dec '06
04 Dec '06
Module: wine Branch: master Commit: 4b7e8e73a4d0e4128122eacc89fcb909de0bfc03 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4b7e8e73a4d0e4128122eacc8…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Fri Dec 1 15:02:40 2006 +0000 ole32: The advise sink for the data cache should be primed with the passed in aspects value, not an arbitrarily selected value. --- dlls/ole32/datacache.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/dlls/ole32/datacache.c b/dlls/ole32/datacache.c index 99fd0e8..6ab4187 100644 --- a/dlls/ole32/datacache.c +++ b/dlls/ole32/datacache.c @@ -1503,9 +1503,7 @@ static HRESULT WINAPI DataCache_SetAdvis */ if (advf & ADVF_PRIMEFIRST) { - DataCache_FireOnViewChange(this, - DVASPECT_CONTENT, - -1); + DataCache_FireOnViewChange(this, aspects, -1); } return S_OK;
1
0
0
0
Rob Shearman : ole32: Implement the SetData function for the data cache.
by Alexandre Julliard
04 Dec '06
04 Dec '06
Module: wine Branch: master Commit: 46f70207b2ef13cc8e03e1342c941ceeaed65643 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=46f70207b2ef13cc8e03e1342…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Fri Dec 1 15:02:26 2006 +0000 ole32: Implement the SetData function for the data cache. --- dlls/ole32/datacache.c | 74 ++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 72 insertions(+), 2 deletions(-) diff --git a/dlls/ole32/datacache.c b/dlls/ole32/datacache.c index c15dbaa..99fd0e8 100644 --- a/dlls/ole32/datacache.c +++ b/dlls/ole32/datacache.c @@ -515,6 +515,59 @@ static HRESULT DataCacheEntry_LoadData(D return hres; } +/* helper for copying STGMEDIUM of type bitmap, MF, EMF or HGLOBAL. +* does no checking of whether src_stgm has a supported tymed, so this should be +* done in the caller */ +static HRESULT copy_stg_medium(CLIPFORMAT cf, STGMEDIUM *dest_stgm, + const STGMEDIUM *src_stgm) +{ + if (src_stgm->tymed == TYMED_MFPICT) + { + const METAFILEPICT *src_mfpict = GlobalLock(src_stgm->u.hMetaFilePict); + METAFILEPICT *dest_mfpict; + + if (!src_mfpict) + return DV_E_STGMEDIUM; + dest_stgm->u.hMetaFilePict = GlobalAlloc(GMEM_MOVEABLE, sizeof(METAFILEPICT)); + dest_mfpict = GlobalLock(dest_stgm->u.hMetaFilePict); + if (!dest_mfpict) + { + GlobalUnlock(src_stgm->u.hMetaFilePict); + return E_OUTOFMEMORY; + } + *dest_mfpict = *src_mfpict; + dest_mfpict->hMF = CopyMetaFileW(src_mfpict->hMF, NULL); + GlobalUnlock(src_stgm->u.hMetaFilePict); + GlobalUnlock(dest_stgm->u.hMetaFilePict); + } + else if (src_stgm->tymed != TYMED_NULL) + { + dest_stgm->u.hGlobal = OleDuplicateData(src_stgm->u.hGlobal, cf, + GMEM_MOVEABLE); + if (!dest_stgm->u.hGlobal) + return E_OUTOFMEMORY; + } + dest_stgm->tymed = src_stgm->tymed; + dest_stgm->pUnkForRelease = src_stgm->pUnkForRelease; + if (dest_stgm->pUnkForRelease) + IUnknown_AddRef(dest_stgm->pUnkForRelease); + return S_OK; +} + +static HRESULT DataCacheEntry_SetData(DataCacheEntry *This, + STGMEDIUM *stgmedium, BOOL fRelease) +{ + ReleaseStgMedium(&This->stgmedium); + if (fRelease) + { + This->stgmedium = *stgmedium; + return S_OK; + } + else + return copy_stg_medium(This->fmtetc.cfFormat, + &This->stgmedium, stgmedium); +} + /********************************************************* * Method implementation for the non delegating IUnknown * part of the DataCache class. @@ -1706,8 +1759,25 @@ static HRESULT WINAPI DataCache_IOleCach STGMEDIUM* pmedium, BOOL fRelease) { - FIXME("stub\n"); - return E_NOTIMPL; + DataCache *This = impl_from_IOleCache2(iface); + DataCacheEntry *cache_entry; + HRESULT hr; + + TRACE("(%p, %p, %s)\n", pformatetc, pmedium, fRelease ? "TRUE" : "FALSE"); + + cache_entry = DataCache_GetEntryForFormatEtc(This, pformatetc); + if (cache_entry) + { + hr = DataCacheEntry_SetData(cache_entry, pmedium, fRelease); + + if (SUCCEEDED(hr)) + DataCache_FireOnViewChange(This, cache_entry->fmtetc.dwAspect, + cache_entry->fmtetc.lindex); + + return hr; + } + + return OLE_E_BLANK; } static HRESULT WINAPI DataCache_UpdateCache(
1
0
0
0
← Newer
1
...
65
66
67
68
69
70
71
72
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
Results per page:
10
25
50
100
200