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
March 2009
----- 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
2 participants
834 discussions
Start a n
N
ew thread
Alexandre Julliard : loader: Fix installation for platforms that don' t use extra binaries.
by Alexandre Julliard
23 Mar '09
23 Mar '09
Module: wine Branch: master Commit: 9701da43b02f4910bdc7dccfe39f731409bb54f7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9701da43b02f4910bdc7dccfe…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Mar 23 15:51:59 2009 +0100 loader: Fix installation for platforms that don't use extra binaries. --- loader/Makefile.in | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/loader/Makefile.in b/loader/Makefile.in index 1c882c6..ae2f386 100644 --- a/loader/Makefile.in +++ b/loader/Makefile.in @@ -45,9 +45,13 @@ wine: $(MAIN_OBJS) Makefile.in wine-installed: $(MAIN_OBJS) Makefile.in $(CC) -o $@ $(LDEXECFLAGS) $(MAIN_OBJS) $(LIBWINE) $(LIBPORT) $(LIBPTHREAD) $(EXTRALIBS) $(LDFLAGS) $(LDRPATH_INSTALL) -install install-lib:: wine-installed $(EXTRA_BINARIES) $(MANPAGES) $(INSTALLDIRS) +$(EXTRA_BINARIES:%=__install__%): $(DESTDIR)$(bindir) dummy + f=`expr $@ : '__install__\(.*\)'` && $(INSTALL_PROGRAM) $$f $(DESTDIR)$(bindir)/$$f + +.PHONY: $(EXTRA_BINARIES:%=__install__%) + +install install-lib:: wine-installed $(EXTRA_BINARIES:%=__install__%) $(MANPAGES) $(INSTALLDIRS) $(INSTALL_PROGRAM) wine-installed $(DESTDIR)$(bindir)/$(MODULE) - for f in $(EXTRA_BINARIES); do $(INSTALL_PROGRAM) $$f $(DESTDIR)$(bindir)/$$f; done $(INSTALL_DATA) wine.man $(DESTDIR)$(mandir)/man$(prog_manext)/wine.$(prog_manext) $(INSTALL_DATA) wine.de.man $(DESTDIR)$(mandir)/de.UTF-8/man$(prog_manext)/wine.$(prog_manext) $(INSTALL_DATA) wine.fr.man $(DESTDIR)$(mandir)/fr.UTF-8/man$(prog_manext)/wine.$(prog_manext)
1
0
0
0
Huw Davies : ole32: Store the ole clipboard window' s HWND in the DataObject clipboard format.
by Alexandre Julliard
23 Mar '09
23 Mar '09
Module: wine Branch: master Commit: ef4b6b87496ba269cbf9ba71cbdc90b9a6c43f8e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ef4b6b87496ba269cbf9ba71c…
Author: Huw Davies <huw(a)codeweavers.com> Date: Mon Mar 23 11:47:19 2009 +0000 ole32: Store the ole clipboard window's HWND in the DataObject clipboard format. --- dlls/ole32/clipboard.c | 48 +++++++++++++++++++++--------------------- dlls/ole32/tests/clipboard.c | 35 ++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 24 deletions(-) diff --git a/dlls/ole32/clipboard.c b/dlls/ole32/clipboard.c index 8a7bdd2..4c6f35f 100644 --- a/dlls/ole32/clipboard.c +++ b/dlls/ole32/clipboard.c @@ -1271,6 +1271,26 @@ static HWND OLEClipbrd_CreateWindow(void) return hwnd; } +static HRESULT set_dataobject_format(HWND hwnd) +{ + HGLOBAL h = GlobalAlloc(GMEM_DDESHARE | GMEM_MOVEABLE, sizeof(hwnd)); + HWND *data; + + if(!h) return E_OUTOFMEMORY; + + data = GlobalLock(h); + *data = hwnd; + GlobalUnlock(h); + + if(!SetClipboardData(dataobject_clipboard_format, h)) + { + GlobalFree(h); + return CLIPBRD_E_CANT_SET; + } + + return S_OK; +} + /*---------------------------------------------------------------------* * Win32 OLE clipboard API *---------------------------------------------------------------------*/ @@ -1296,10 +1316,6 @@ HRESULT WINAPI OleSetClipboard(IDataObject* pDataObj) FORMATETC rgelt; BOOL bClipboardOpen = FALSE; struct oletls *info = COM_CurrentInfo(); -/* - HGLOBAL hDataObject = 0; - OLEClipbrd **ppDataObject; -*/ TRACE("(%p)\n", pDataObj); @@ -1391,27 +1407,9 @@ HRESULT WINAPI OleSetClipboard(IDataObject* pDataObj) /* * Windows additionally creates a new "DataObject" clipboard format - * and stores in on the clipboard. We could possibly store a pointer - * to our internal IDataObject interface on the clipboard. I'm not - * sure what the use of this is though. - * Enable the code below for this functionality. + * and stores the clipboard window's HWND in it */ -/* - theOleClipboard->cfDataObj = RegisterClipboardFormatA("DataObject"); - hDataObject = GlobalAlloc( GMEM_DDESHARE|GMEM_MOVEABLE|GMEM_ZEROINIT, - sizeof(OLEClipbrd *)); - if (hDataObject==0) - HANDLE_ERROR( E_OUTOFMEMORY ); - - ppDataObject = GlobalLock(hDataObject); - *ppDataObject = theOleClipboard; - GlobalUnlock(hDataObject); - - if ( !SetClipboardData( theOleClipboard->cfDataObj, hDataObject ) ) - HANDLE_ERROR( CLIPBRD_E_CANT_SET ); -*/ - - hr = S_OK; + hr = set_dataobject_format(theOleClipboard->hWndClipboard); CLEANUP: @@ -1541,6 +1539,8 @@ HRESULT WINAPI OleFlushClipboard(void) IEnumFORMATETC_Release(penumFormatetc); + hr = set_dataobject_format(NULL); + /* * Release the source data object we are holding on to */ diff --git a/dlls/ole32/tests/clipboard.c b/dlls/ole32/tests/clipboard.c index a4f8a62..f5ed06a 100644 --- a/dlls/ole32/tests/clipboard.c +++ b/dlls/ole32/tests/clipboard.c @@ -423,6 +423,36 @@ static void test_get_clipboard(void) IDataObject_Release(data_obj); } +static void test_cf_dataobject(BOOL dataobject_active) +{ + UINT cf = 0; + UINT cf_dataobject = RegisterClipboardFormatA("DataObject"); + BOOL found_dataobject = FALSE; + + OpenClipboard(NULL); + do + { + cf = EnumClipboardFormats(cf); + if(cf == cf_dataobject) + { + HGLOBAL h = GetClipboardData(cf); + HWND *ptr = GlobalLock(h); + DWORD size = GlobalSize(h); + HWND clip_owner = GetClipboardOwner(); + + found_dataobject = TRUE; + ok(size >= sizeof(*ptr), "size %d\n", size); + if(dataobject_active) + ok(*ptr == clip_owner, "hwnd %p clip_owner %p\n", *ptr, clip_owner); + else /* ole clipboard flushed */ + ok(*ptr == NULL, "hwnd %p\n", *ptr); + GlobalUnlock(h); + } + } while(cf); + CloseClipboard(); + ok(found_dataobject, "didn't find cf_dataobject\n"); +} + static void test_set_clipboard(void) { HRESULT hr; @@ -453,6 +483,9 @@ static void test_set_clipboard(void) hr = OleSetClipboard(data1); ok(hr == S_OK, "failed to set clipboard to data1, hr = 0x%08x\n", hr); + + test_cf_dataobject(TRUE); + hr = OleIsCurrentClipboard(data1); ok(hr == S_OK, "expected current clipboard to be data1, hr = 0x%08x\n", hr); hr = OleIsCurrentClipboard(data2); @@ -480,6 +513,8 @@ static void test_set_clipboard(void) hr = OleIsCurrentClipboard(NULL); ok(hr == S_FALSE, "expect S_FALSE, hr = 0x%08x\n", hr); + test_cf_dataobject(FALSE); + ok(OleSetClipboard(NULL) == S_OK, "failed to clear clipboard, hr = 0x%08x\n", hr); ref = IDataObject_Release(data1);
1
0
0
0
Huw Davies : ole32: Register DataObject clipboard format.
by Alexandre Julliard
23 Mar '09
23 Mar '09
Module: wine Branch: master Commit: e77ab142e4914b53adb42d1b8b7fd463a6d2605a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e77ab142e4914b53adb42d1b8…
Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Mar 17 15:34:31 2009 +0000 ole32: Register DataObject clipboard format. --- dlls/ole32/clipboard.c | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/dlls/ole32/clipboard.c b/dlls/ole32/clipboard.c index 8e997ec..8a7bdd2 100644 --- a/dlls/ole32/clipboard.c +++ b/dlls/ole32/clipboard.c @@ -150,6 +150,8 @@ static ole_clipbrd* theOleClipboard; */ static const CHAR OLEClipbrd_WNDCLASS[] = "CLIPBRDWNDCLASS"; +static UINT dataobject_clipboard_format; + /* * If we need to store state info we can store it here. * For now we don't need this functionality. @@ -1175,15 +1177,22 @@ static ole_clipbrd* OLEClipbrd_Construct(void) return This; } +static void register_clipboard_formats(void) +{ + static const WCHAR DataObjectW[] = { 'D','a','t','a','O','b','j','e','c','t',0 }; + + if(!dataobject_clipboard_format) + dataobject_clipboard_format = RegisterClipboardFormatW(DataObjectW); +} + /*********************************************************************** * OLEClipbrd_Initialize() * Initializes the OLE clipboard. */ void OLEClipbrd_Initialize(void) { - /* - * Create the clipboard if necessary - */ + register_clipboard_formats(); + if ( !theOleClipboard ) { TRACE("()\n");
1
0
0
0
Huw Davies : ole32: Use IsEqualIID rather than memcmp.
by Alexandre Julliard
23 Mar '09
23 Mar '09
Module: wine Branch: master Commit: c0fbbe7d910716b15607e3c988ee35614a2a2046 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c0fbbe7d910716b15607e3c98…
Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Mar 17 14:33:33 2009 +0000 ole32: Use IsEqualIID rather than memcmp. --- dlls/ole32/clipboard.c | 24 ++++-------------------- 1 files changed, 4 insertions(+), 20 deletions(-) diff --git a/dlls/ole32/clipboard.c b/dlls/ole32/clipboard.c index f9eefe8..8e997ec 100644 --- a/dlls/ole32/clipboard.c +++ b/dlls/ole32/clipboard.c @@ -730,40 +730,24 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_QueryInterface( void** ppvObject) { ole_clipbrd *This = impl_from_IDataObject(iface); - TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,debugstr_guid(riid),ppvObject); + TRACE("(%p)->(IID:%s, %p)\n", This, debugstr_guid(riid), ppvObject); - /* - * Perform a sanity check on the parameters. - */ if ( (This==0) || (ppvObject==0) ) return E_INVALIDARG; - /* - * Initialize the return parameter. - */ *ppvObject = 0; - /* - * Compare the riid with the interface IDs implemented by this object. - */ - if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) + if (IsEqualIID(&IID_IUnknown, riid) || + IsEqualIID(&IID_IDataObject, riid)) { *ppvObject = iface; } - else if (memcmp(&IID_IDataObject, riid, sizeof(IID_IDataObject)) == 0) - { - *ppvObject = &This->lpvtbl; - } - else /* We only support IUnknown and IDataObject */ + else { WARN( "() : asking for unsupported interface %s\n", debugstr_guid(riid)); return E_NOINTERFACE; } - /* - * Query Interface always increases the reference count by one when it is - * successful. - */ IUnknown_AddRef((IUnknown*)*ppvObject); return S_OK;
1
0
0
0
Huw Davies : ole32: Simplify QueryInterface.
by Alexandre Julliard
23 Mar '09
23 Mar '09
Module: wine Branch: master Commit: 319d0ddca6e2f67eddb0187a62db6ae11210e001 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=319d0ddca6e2f67eddb0187a6…
Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Mar 17 14:27:18 2009 +0000 ole32: Simplify QueryInterface. --- dlls/ole32/clipboard.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/dlls/ole32/clipboard.c b/dlls/ole32/clipboard.c index 145cfea..f9eefe8 100644 --- a/dlls/ole32/clipboard.c +++ b/dlls/ole32/clipboard.c @@ -183,11 +183,8 @@ static HRESULT WINAPI OLEClipbrd_IEnumFORMATETC_QueryInterface *ppvObj = NULL; - if(IsEqualIID(riid, &IID_IUnknown)) - { - *ppvObj = This; - } - else if(IsEqualIID(riid, &IID_IEnumFORMATETC)) + if(IsEqualIID(riid, &IID_IUnknown) || + IsEqualIID(riid, &IID_IEnumFORMATETC)) { *ppvObj = This; }
1
0
0
0
Huw Davies : ole32: pFmt isn't exposed to the client, so simplify its allocation.
by Alexandre Julliard
23 Mar '09
23 Mar '09
Module: wine Branch: master Commit: d72181381e0fd034d4b5bcb74655b15a5edfedd6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d72181381e0fd034d4b5bcb74…
Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Mar 17 14:25:09 2009 +0000 ole32: pFmt isn't exposed to the client, so simplify its allocation. --- dlls/ole32/clipboard.c | 22 +++++++--------------- 1 files changed, 7 insertions(+), 15 deletions(-) diff --git a/dlls/ole32/clipboard.c b/dlls/ole32/clipboard.c index efa5152..145cfea 100644 --- a/dlls/ole32/clipboard.c +++ b/dlls/ole32/clipboard.c @@ -231,7 +231,6 @@ static ULONG WINAPI OLEClipbrd_IEnumFORMATETC_AddRef(LPENUMFORMATETC iface) static ULONG WINAPI OLEClipbrd_IEnumFORMATETC_Release(LPENUMFORMATETC iface) { IEnumFORMATETCImpl *This = (IEnumFORMATETCImpl *)iface; - LPMALLOC pIMalloc; ULONG ref; TRACE("(%p)->(count=%u)\n",This, This->ref); @@ -243,12 +242,7 @@ static ULONG WINAPI OLEClipbrd_IEnumFORMATETC_Release(LPENUMFORMATETC iface) if (!ref) { TRACE("() - destroying IEnumFORMATETC(%p)\n",This); - if (SUCCEEDED(CoGetMalloc(MEMCTX_TASK, &pIMalloc))) - { - IMalloc_Free(pIMalloc, This->pFmt); - IMalloc_Release(pIMalloc); - } - + HeapFree(GetProcessHeap(), 0, This->pFmt); HeapFree(GetProcessHeap(),0,This); } return ref; @@ -379,9 +373,8 @@ static LPENUMFORMATETC OLEClipbrd_IEnumFORMATETC_Construct(UINT cfmt, const FORM { IEnumFORMATETCImpl* ef; DWORD size=cfmt * sizeof(FORMATETC); - LPMALLOC pIMalloc; - ef = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IEnumFORMATETCImpl)); + ef = HeapAlloc(GetProcessHeap(), 0, sizeof(IEnumFORMATETCImpl)); if (!ef) return NULL; @@ -391,15 +384,14 @@ static LPENUMFORMATETC OLEClipbrd_IEnumFORMATETC_Construct(UINT cfmt, const FORM ef->posFmt = 0; ef->countFmt = cfmt; - if (FAILED(CoGetMalloc(MEMCTX_TASK, &pIMalloc))) { + ef->pFmt = HeapAlloc(GetProcessHeap(), 0, size); + if (ef->pFmt) + memcpy(ef->pFmt, afmt, size); + else + { HeapFree(GetProcessHeap(), 0, ef); return NULL; } - ef->pFmt = IMalloc_Alloc(pIMalloc, size); - IMalloc_Release(pIMalloc); - - if (ef->pFmt) - memcpy(ef->pFmt, afmt, size); TRACE("(%p)->()\n",ef); return (LPENUMFORMATETC)ef;
1
0
0
0
Huw Davies : ole32: Rearrange functions to eliminate forward declarations.
by Alexandre Julliard
23 Mar '09
23 Mar '09
Module: wine Branch: master Commit: 8beb83866ff7e9a13ab0a9d453a343674160f327 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8beb83866ff7e9a13ab0a9d45…
Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Mar 17 14:17:49 2009 +0000 ole32: Rearrange functions to eliminate forward declarations. --- dlls/ole32/clipboard.c | 1486 +++++++++++++++++++++++------------------------- 1 files changed, 699 insertions(+), 787 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=8beb83866ff7e9a13ab0a…
1
0
0
0
Huw Davies : ole32: Add a helper function to retrieve the implementation ptr.
by Alexandre Julliard
23 Mar '09
23 Mar '09
Module: wine Branch: master Commit: 96bd8c5a7d2f99d540a69fd86c21cb86f17eff61 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=96bd8c5a7d2f99d540a69fd86…
Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Mar 17 12:44:20 2009 +0000 ole32: Add a helper function to retrieve the implementation ptr. --- dlls/ole32/clipboard.c | 94 +++++++++++++++--------------------------------- 1 files changed, 29 insertions(+), 65 deletions(-) diff --git a/dlls/ole32/clipboard.c b/dlls/ole32/clipboard.c index a1fed82..b386b1e 100644 --- a/dlls/ole32/clipboard.c +++ b/dlls/ole32/clipboard.c @@ -86,35 +86,24 @@ WINE_DEFAULT_DEBUG_CHANNEL(ole); /**************************************************************************** - * OLEClipbrd - * DO NOT add any members before the VTables declaration! + * ole_clipbrd */ -struct OLEClipbrd +struct ole_clipbrd { - /* - * List all interface VTables here - */ - const IDataObjectVtbl* lpvtbl1; /* IDataObject VTable */ - - /* - * The hidden OLE clipboard window. This window is used as the bridge between the - * the OLE and windows clipboard API. (Windows creates one such window per process) - */ - HWND hWndClipboard; + const IDataObjectVtbl* lpvtbl; /* Exposed IDataObject vtable */ - /* - * Pointer to the source data object (via OleSetClipboard) - */ - IDataObject* pIDataObjectSrc; + LONG ref; - /* - * Reference count of this object - */ - LONG ref; + HWND hWndClipboard; /* Hidden clipboard window */ + IDataObject* pIDataObjectSrc; /* Source object passed to OleSetClipboard */ }; -typedef struct OLEClipbrd OLEClipbrd; +typedef struct ole_clipbrd ole_clipbrd; +static inline ole_clipbrd *impl_from_IDataObject(IDataObject *iface) +{ + return (ole_clipbrd*)((char*)iface - FIELD_OFFSET(ole_clipbrd, lpvtbl)); +} /**************************************************************************** * IEnumFORMATETC implementation @@ -151,9 +140,9 @@ typedef struct PresentationDataHeader } PresentationDataHeader; /* - * The one and only OLEClipbrd object which is created by OLEClipbrd_Initialize() + * The one and only ole_clipbrd object which is created by OLEClipbrd_Initialize() */ -static OLEClipbrd* theOleClipboard; +static ole_clipbrd* theOleClipboard; /* @@ -161,8 +150,8 @@ static OLEClipbrd* theOleClipboard; */ void OLEClipbrd_Initialize(void); void OLEClipbrd_UnInitialize(void); -static OLEClipbrd* OLEClipbrd_Construct(void); -static void OLEClipbrd_Destroy(OLEClipbrd* ptrToDestroy); +static ole_clipbrd* OLEClipbrd_Construct(void); +static void OLEClipbrd_Destroy(ole_clipbrd* ptrToDestroy); static HWND OLEClipbrd_CreateWindow(void); static void OLEClipbrd_DestroyWindow(HWND hwnd); static LRESULT CALLBACK OLEClipbrd_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); @@ -467,7 +456,7 @@ HRESULT WINAPI OleGetClipboard(IDataObject** ppDataObj) return E_OUTOFMEMORY; /* Return a reference counted IDataObject */ - hr = IDataObject_QueryInterface( (IDataObject*)&(theOleClipboard->lpvtbl1), + hr = IDataObject_QueryInterface( (IDataObject*)&(theOleClipboard->lpvtbl), &IID_IDataObject, (void**)ppDataObj); return hr; } @@ -635,14 +624,14 @@ void OLEClipbrd_UnInitialize(void) /********************************************************* * Construct the OLEClipbrd class. */ -static OLEClipbrd* OLEClipbrd_Construct(void) +static ole_clipbrd* OLEClipbrd_Construct(void) { - OLEClipbrd* This; + ole_clipbrd* This; This = HeapAlloc( GetProcessHeap(), 0, sizeof(*This) ); if (!This) return NULL; - This->lpvtbl1 = &OLEClipbrd_IDataObject_VTable; + This->lpvtbl = &OLEClipbrd_IDataObject_VTable; This->ref = 1; This->hWndClipboard = NULL; @@ -652,7 +641,7 @@ static OLEClipbrd* OLEClipbrd_Construct(void) return This; } -static void OLEClipbrd_Destroy(OLEClipbrd* This) +static void OLEClipbrd_Destroy(ole_clipbrd* This) { TRACE("()\n"); @@ -666,7 +655,6 @@ static void OLEClipbrd_Destroy(OLEClipbrd* This) HeapFree(GetProcessHeap(), 0, This); } - /*********************************************************************** * OLEClipbrd_CreateWindow() * Create the clipboard window @@ -773,7 +761,7 @@ static LRESULT CALLBACK OLEClipbrd_WndProc * Render the clipboard data. * (We must have a source data object or we wouldn't be in this WndProc) */ - OLEClipbrd_RenderFormat( (IDataObject*)&(theOleClipboard->lpvtbl1), &rgelt ); + OLEClipbrd_RenderFormat( (IDataObject*)&(theOleClipboard->lpvtbl), &rgelt ); break; } @@ -799,7 +787,7 @@ static LRESULT CALLBACK OLEClipbrd_WndProc * Render all HGLOBAL formats supported by the source into * the windows clipboard. */ - if ( FAILED( IDataObject_EnumFormatEtc( (IDataObject*)&(theOleClipboard->lpvtbl1), + if ( FAILED( IDataObject_EnumFormatEtc( (IDataObject*)&(theOleClipboard->lpvtbl), DATADIR_GET, &penumFormatetc) ) ) { WARN("(): WM_RENDERALLFORMATS failed to retrieve EnumFormatEtc!\n"); @@ -813,7 +801,7 @@ static LRESULT CALLBACK OLEClipbrd_WndProc /* * Render the clipboard data. */ - if ( FAILED(OLEClipbrd_RenderFormat( (IDataObject*)&(theOleClipboard->lpvtbl1), &rgelt )) ) + if ( FAILED(OLEClipbrd_RenderFormat( (IDataObject*)&(theOleClipboard->lpvtbl), &rgelt )) ) continue; TRACE("(): WM_RENDERALLFORMATS(cfFormat=%d)\n", rgelt.cfFormat); @@ -1064,10 +1052,7 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_QueryInterface( REFIID riid, void** ppvObject) { - /* - * Declare "This" pointer - */ - OLEClipbrd *This = (OLEClipbrd *)iface; + ole_clipbrd *This = impl_from_IDataObject(iface); TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,debugstr_guid(riid),ppvObject); /* @@ -1090,7 +1075,7 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_QueryInterface( } else if (memcmp(&IID_IDataObject, riid, sizeof(IID_IDataObject)) == 0) { - *ppvObject = &This->lpvtbl1; + *ppvObject = &This->lpvtbl; } else /* We only support IUnknown and IDataObject */ { @@ -1115,15 +1100,11 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_QueryInterface( static ULONG WINAPI OLEClipbrd_IDataObject_AddRef( IDataObject* iface) { - /* - * Declare "This" pointer - */ - OLEClipbrd *This = (OLEClipbrd *)iface; + ole_clipbrd *This = impl_from_IDataObject(iface); TRACE("(%p)->(count=%u)\n",This, This->ref); return InterlockedIncrement(&This->ref); - } /************************************************************************ @@ -1134,22 +1115,13 @@ static ULONG WINAPI OLEClipbrd_IDataObject_AddRef( static ULONG WINAPI OLEClipbrd_IDataObject_Release( IDataObject* iface) { - /* - * Declare "This" pointer - */ - OLEClipbrd *This = (OLEClipbrd *)iface; + ole_clipbrd *This = impl_from_IDataObject(iface); ULONG ref; TRACE("(%p)->(count=%u)\n",This, This->ref); - /* - * Decrease the reference count on this object. - */ ref = InterlockedDecrement(&This->ref); - /* - * If the reference count goes down to 0, perform suicide. - */ if (ref == 0) { OLEClipbrd_Destroy(This); @@ -1176,11 +1148,7 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_GetData( BOOL bClipboardOpen = FALSE; HRESULT hr = S_OK; LPVOID src; - - /* - * Declare "This" pointer - */ - OLEClipbrd *This = (OLEClipbrd *)iface; + ole_clipbrd *This = impl_from_IDataObject(iface); TRACE("(%p,%p,%p)\n", iface, pformatetcIn, pmedium); @@ -1346,11 +1314,7 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_EnumFormatEtc( int cfmt, i; UINT format; BOOL bClipboardOpen; - - /* - * Declare "This" pointer - */ - OLEClipbrd *This = (OLEClipbrd *)iface; + ole_clipbrd *This = impl_from_IDataObject(iface); TRACE("(%p, %x, %p)\n", iface, dwDirection, ppenumFormatEtc);
1
0
0
0
Huw Davies : ole32: Don' t allocate the ole clipboard object in global memory - we' re not going to directly expose it to other processes.
by Alexandre Julliard
23 Mar '09
23 Mar '09
Module: wine Branch: master Commit: e7ffa2aeb5f633536cf4881ebbadc3da6461af98 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e7ffa2aeb5f633536cf4881eb…
Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Mar 17 12:20:55 2009 +0000 ole32: Don't allocate the ole clipboard object in global memory - we're not going to directly expose it to other processes. --- dlls/ole32/clipboard.c | 77 ++++++++++-------------------------------------- 1 files changed, 16 insertions(+), 61 deletions(-) diff --git a/dlls/ole32/clipboard.c b/dlls/ole32/clipboard.c index 5bdd80a..a1fed82 100644 --- a/dlls/ole32/clipboard.c +++ b/dlls/ole32/clipboard.c @@ -108,16 +108,6 @@ struct OLEClipbrd IDataObject* pIDataObjectSrc; /* - * The registered DataObject clipboard format - */ - UINT cfDataObj; - - /* - * The handle to ourself - */ - HGLOBAL hSelf; - - /* * Reference count of this object */ LONG ref; @@ -647,68 +637,33 @@ void OLEClipbrd_UnInitialize(void) */ static OLEClipbrd* OLEClipbrd_Construct(void) { - OLEClipbrd* newObject = NULL; - HGLOBAL hNewObject = 0; - - /* - * Allocate space for the object. We use GlobalAlloc since we need - * an HGLOBAL to expose our DataObject as a registered clipboard type. - */ - hNewObject = GlobalAlloc( GMEM_DDESHARE|GMEM_MOVEABLE|GMEM_ZEROINIT, - sizeof(OLEClipbrd)); - if (hNewObject==0) - return NULL; - - /* - * Lock the handle for the entire lifetime of the clipboard. - */ - newObject = GlobalLock(hNewObject); - - /* - * Initialize the virtual function table. - */ - newObject->lpvtbl1 = &OLEClipbrd_IDataObject_VTable; + OLEClipbrd* This; - /* - * Start with one reference count. The caller of this function - * must release the interface pointer when it is done. - */ - newObject->ref = 1; + This = HeapAlloc( GetProcessHeap(), 0, sizeof(*This) ); + if (!This) return NULL; - newObject->hSelf = hNewObject; + This->lpvtbl1 = &OLEClipbrd_IDataObject_VTable; + This->ref = 1; - /* - * The Ole clipboard is a singleton - save the global handle and pointer - */ - theOleClipboard = newObject; + This->hWndClipboard = NULL; + This->pIDataObjectSrc = NULL; - return theOleClipboard; + theOleClipboard = This; + return This; } -static void OLEClipbrd_Destroy(OLEClipbrd* ptrToDestroy) +static void OLEClipbrd_Destroy(OLEClipbrd* This) { - TRACE("()\n"); + TRACE("()\n"); - if ( !ptrToDestroy ) - return; + if (!This) return; - /* - * Destroy the Ole clipboard window - */ - if ( ptrToDestroy->hWndClipboard ) - OLEClipbrd_DestroyWindow(ptrToDestroy->hWndClipboard); + theOleClipboard = NULL; - /* - * Free the actual OLE Clipboard structure. - */ - TRACE("() - Destroying clipboard data object.\n"); - GlobalUnlock(ptrToDestroy->hSelf); - GlobalFree(ptrToDestroy->hSelf); + if ( This->hWndClipboard ) + OLEClipbrd_DestroyWindow(This->hWndClipboard); - /* - * The Ole clipboard is a singleton (ptrToDestroy == theOleClipboard) - */ - theOleClipboard = NULL; + HeapFree(GetProcessHeap(), 0, This); }
1
0
0
0
Huw Davies : ole32: Remove unused static variable.
by Alexandre Julliard
23 Mar '09
23 Mar '09
Module: wine Branch: master Commit: e6eeb3aa17c8a90d62090822c7996747103c88ea URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e6eeb3aa17c8a90d62090822c…
Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Mar 17 11:55:09 2009 +0000 ole32: Remove unused static variable. --- dlls/ole32/clipboard.c | 5 +---- 1 files changed, 1 insertions(+), 4 deletions(-) diff --git a/dlls/ole32/clipboard.c b/dlls/ole32/clipboard.c index b33cb52..5bdd80a 100644 --- a/dlls/ole32/clipboard.c +++ b/dlls/ole32/clipboard.c @@ -163,8 +163,7 @@ typedef struct PresentationDataHeader /* * The one and only OLEClipbrd object which is created by OLEClipbrd_Initialize() */ -static HGLOBAL hTheOleClipboard = 0; -static OLEClipbrd* theOleClipboard = NULL; +static OLEClipbrd* theOleClipboard; /* @@ -682,7 +681,6 @@ static OLEClipbrd* OLEClipbrd_Construct(void) * The Ole clipboard is a singleton - save the global handle and pointer */ theOleClipboard = newObject; - hTheOleClipboard = hNewObject; return theOleClipboard; } @@ -711,7 +709,6 @@ static void OLEClipbrd_Destroy(OLEClipbrd* ptrToDestroy) * The Ole clipboard is a singleton (ptrToDestroy == theOleClipboard) */ theOleClipboard = NULL; - hTheOleClipboard = 0; }
1
0
0
0
← Newer
1
...
26
27
28
29
30
31
32
...
84
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
73
74
75
76
77
78
79
80
81
82
83
84
Results per page:
10
25
50
100
200