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
January 2012
----- 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
972 discussions
Start a n
N
ew thread
André Hentschel : po: Update German translation.
by Alexandre Julliard
11 Jan '12
11 Jan '12
Module: wine Branch: master Commit: 90071951ea3be1e9a12b207d747c4536f2333ccc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=90071951ea3be1e9a12b207d7…
Author: André Hentschel <nerv(a)dawncrow.de> Date: Tue Jan 10 23:44:58 2012 +0100 po: Update German translation. --- po/de.po | 125 ++++++++++++++++++++++++++++--------------------------------- 1 files changed, 57 insertions(+), 68 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=90071951ea3be1e9a12b2…
1
0
0
0
Frédéric Delanoy : po: Update French translation.
by Alexandre Julliard
11 Jan '12
11 Jan '12
Module: wine Branch: master Commit: 6febe65678c2c6ef0f7aae02dffadd349a8d508e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6febe65678c2c6ef0f7aae02d…
Author: Frédéric Delanoy <frederic.delanoy(a)gmail.com> Date: Tue Jan 10 23:30:24 2012 +0100 po: Update French translation. --- po/fr.po | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-) diff --git a/po/fr.po b/po/fr.po index 35cf918..27b4eba 100644 --- a/po/fr.po +++ b/po/fr.po @@ -5,7 +5,7 @@ msgstr "" "Project-Id-Version: Wine\n" "Report-Msgid-Bugs-To:
http://bugs.winehq.org\n
" "POT-Creation-Date: N/A\n" -"PO-Revision-Date: 2011-12-30 10:22+0100\n" +"PO-Revision-Date: 2012-01-10 23:29+0100\n" "Last-Translator: Frédéric Delanoy <frederic.delanoy(a)gmail.com>\n" "Language-Team: none\n" "Language: French\n" @@ -8424,9 +8424,8 @@ msgid "The specified device handle is invalid." msgstr "Le descripteur de périphérique spécifié est invalide." #: winmm.rc:34 -#, fuzzy msgid "There is no driver installed on your system!" -msgstr "Aucun pilote n'est installé sur votre système !\n" +msgstr "Aucun pilote n'est installé sur votre système !" #: winmm.rc:35 winmm.rc:61 msgid "" @@ -13184,9 +13183,8 @@ msgid "&Color" msgstr "&Couleur" #: wineconsole.rc:97 -#, fuzzy msgid "Configuration" -msgstr " Configuration " +msgstr "Configuration" #: wineconsole.rc:100 msgid "Buffer zone"
1
0
0
0
Luca Bennati : po: Update Italian translation.
by Alexandre Julliard
11 Jan '12
11 Jan '12
Module: wine Branch: master Commit: 5cc66bc8d4228547dc6add81b6705ffac9a32a2f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5cc66bc8d4228547dc6add81b…
Author: Luca Bennati <lucak3(a)gmail.com> Date: Tue Jan 10 17:09:44 2012 +0100 po: Update Italian translation. --- po/it.po | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/po/it.po b/po/it.po index 061cef0..25d510c 100644 --- a/po/it.po +++ b/po/it.po @@ -5,7 +5,7 @@ msgstr "" "Project-Id-Version: Wine\n" "Report-Msgid-Bugs-To:
http://bugs.winehq.org\n
" "POT-Creation-Date: N/A\n" -"PO-Revision-Date: 2012-01-03 21:32+0100\n" +"PO-Revision-Date: 2012-01-10 17:08+0100\n" "Last-Translator: Luca Bennati <lucak3(a)gmail.com>\n" "Language-Team: none\n" "Language: Italian\n" @@ -8406,7 +8406,7 @@ msgstr "L'handle del dispositivo specificato non è valido." #: winmm.rc:34 msgid "There is no driver installed on your system!" -msgstr "Non è presente nessun driver installato nel sistema!" +msgstr "Nessun driver è presente nel sistema!" #: winmm.rc:35 winmm.rc:61 msgid "" @@ -13114,9 +13114,8 @@ msgid "&Color" msgstr "C&olore" #: wineconsole.rc:97 -#, fuzzy msgid "Configuration" -msgstr " Configurazione " +msgstr "Configurazione" #: wineconsole.rc:100 msgid "Buffer zone"
1
0
0
0
Alexandre Julliard : comctl32: Fix management of imagelist growth amount.
by Alexandre Julliard
11 Jan '12
11 Jan '12
Module: wine Branch: master Commit: ff71cc2ca45d8da974777dafc11a317d8cf62c48 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ff71cc2ca45d8da974777dafc…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jan 11 12:32:14 2012 +0100 comctl32: Fix management of imagelist growth amount. --- dlls/comctl32/imagelist.c | 21 ++++++++------- dlls/comctl32/tests/imagelist.c | 53 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 10 deletions(-) diff --git a/dlls/comctl32/imagelist.c b/dlls/comctl32/imagelist.c index c1edbdf..41c1017 100644 --- a/dlls/comctl32/imagelist.c +++ b/dlls/comctl32/imagelist.c @@ -771,7 +771,14 @@ ImageList_Create (INT cx, INT cy, UINT flags, if (FAILED(ImageListImpl_CreateInstance(NULL, &IID_IImageList, (void **)&himl))) return NULL; - cGrow = (cGrow < 4) ? 4 : (cGrow + 3) & ~3; + cGrow = (WORD)((max( cGrow, 1 ) + 3) & ~3); + + if (cGrow > 256) + { + /* Windows doesn't limit the size here, but X11 doesn't let use allocate such huge bitmaps */ + WARN( "grow %d too large, limiting to 256\n", cGrow ); + cGrow = 256; + } himl->cx = cx; himl->cy = cy; @@ -2352,7 +2359,7 @@ ImageList_Remove (HIMAGELIST himl, INT i) return TRUE; } - himl->cMaxImage = himl->cInitial + himl->cGrow - 1; + himl->cMaxImage = himl->cGrow; himl->cCurImage = 0; for (nCount = 0; nCount < MAX_OVERLAYIMAGE; nCount++) himl->nOvlIdx[nCount] = -1; @@ -2563,7 +2570,7 @@ ImageList_ReplaceIcon (HIMAGELIST himl, INT nIndex, HICON hIcon) return -1; if (nIndex == -1) { - if (himl->cCurImage + 1 > himl->cMaxImage) + if (himl->cCurImage + 1 >= himl->cMaxImage) IMAGELIST_InternalExpandBitmaps(himl, 1); nIndex = himl->cCurImage; @@ -2848,14 +2855,8 @@ ImageList_SetImageCount (HIMAGELIST himl, UINT iImageCount) if (!is_valid(himl)) return FALSE; - if (himl->cMaxImage > iImageCount) - { - himl->cCurImage = iImageCount; - /* TODO: shrink the bitmap when cMaxImage-cCurImage>cGrow ? */ - return TRUE; - } - nNewCount = iImageCount + himl->cGrow; + nNewCount = iImageCount + 1; nCopyCount = min(himl->cCurImage, iImageCount); hdcBitmap = CreateCompatibleDC (0); diff --git a/dlls/comctl32/tests/imagelist.c b/dlls/comctl32/tests/imagelist.c index 588a5b3..b920b9a 100644 --- a/dlls/comctl32/tests/imagelist.c +++ b/dlls/comctl32/tests/imagelist.c @@ -1089,6 +1089,59 @@ static void test_imagelist_storage(void) ret = ImageList_Destroy(himl); ok(ret, "ImageList_Destroy failed\n"); iml_clear_stream_data(); + + himl = ImageList_Create(BMP_CX, BMP_CX, ILC_COLOR4|ILC_MASK, 2, 99); + ok(himl != 0, "ImageList_Create failed\n"); + check_iml_data(himl, BMP_CX, BMP_CX, 0, 3, 100, BMP_CX * 4, BMP_CX, ILC_COLOR4|ILC_MASK, + "init 2 grow 99"); + icon = CreateIcon(hinst, 32, 32, 1, 1, icon_bits, icon_bits); + ok( ImageList_AddIcon(himl, icon) == 0,"failed to add icon\n"); + ok( ImageList_AddIcon(himl, icon) == 1,"failed to add icon\n"); + check_iml_data(himl, BMP_CX, BMP_CX, 2, 3, 100, BMP_CX * 4, BMP_CX, ILC_COLOR4|ILC_MASK, + "init 2 grow 99 2 icons"); + ok( ImageList_AddIcon(himl, icon) == 2,"failed to add icon\n"); + DestroyIcon( icon ); + check_iml_data(himl, BMP_CX, BMP_CX, 3, 104, 100, BMP_CX * 4, BMP_CX * 104/4, ILC_COLOR4|ILC_MASK, + "init 2 grow 99 3 icons"); + ok( ImageList_Remove(himl, -1) == TRUE,"failed to remove icon\n"); + check_iml_data(himl, BMP_CX, BMP_CX, 0, 100, 100, BMP_CX * 4, BMP_CX * 100/4, ILC_COLOR4|ILC_MASK, + "init 2 grow 99 empty"); + ok( ImageList_SetImageCount(himl, 22) == TRUE,"failed to set image count\n"); + check_iml_data(himl, BMP_CX, BMP_CX, 22, 23, 100, BMP_CX * 4, BMP_CX * 24/4, ILC_COLOR4|ILC_MASK, + "init 2 grow 99 set count 22"); + ok( ImageList_SetImageCount(himl, 0) == TRUE,"failed to set image count\n"); + check_iml_data(himl, BMP_CX, BMP_CX, 0, 1, 100, BMP_CX * 4, BMP_CX, ILC_COLOR4|ILC_MASK, + "init 2 grow 99 set count 0"); + ok( ImageList_SetImageCount(himl, 42) == TRUE,"failed to set image count\n"); + check_iml_data(himl, BMP_CX, BMP_CX, 42, 43, 100, BMP_CX * 4, BMP_CX * 44/4, ILC_COLOR4|ILC_MASK, + "init 2 grow 99 set count 42"); + ret = ImageList_Destroy(himl); + ok(ret, "ImageList_Destroy failed\n"); + iml_clear_stream_data(); + + himl = ImageList_Create(BMP_CX, BMP_CX, ILC_COLOR4|ILC_MASK, 2, 65536+12); + ok(himl != 0, "ImageList_Create failed\n"); + check_iml_data(himl, BMP_CX, BMP_CX, 0, 3, 12, BMP_CX * 4, BMP_CX, ILC_COLOR4|ILC_MASK, + "init 2 grow 65536+12"); + ret = ImageList_Destroy(himl); + ok(ret, "ImageList_Destroy failed\n"); + iml_clear_stream_data(); + + himl = ImageList_Create(BMP_CX, BMP_CX, ILC_COLOR4|ILC_MASK, 2, 65535); + ok(himl != 0, "ImageList_Create failed\n"); + check_iml_data(himl, BMP_CX, BMP_CX, 0, 3, 0, BMP_CX * 4, BMP_CX, ILC_COLOR4|ILC_MASK, + "init 2 grow 65535"); + ret = ImageList_Destroy(himl); + ok(ret, "ImageList_Destroy failed\n"); + iml_clear_stream_data(); + + himl = ImageList_Create(BMP_CX, BMP_CX, ILC_COLOR4|ILC_MASK, 2, -20); + ok(himl != 0, "ImageList_Create failed\n"); + check_iml_data(himl, BMP_CX, BMP_CX, 0, 3, 4, BMP_CX * 4, BMP_CX, ILC_COLOR4|ILC_MASK, + "init 2 grow -20"); + ret = ImageList_Destroy(himl); + ok(ret, "ImageList_Destroy failed\n"); + iml_clear_stream_data(); } static void test_shell_imagelist(void)
1
0
0
0
Nikolay Sivov : shell32: Avoid casts when creating item menu.
by Alexandre Julliard
11 Jan '12
11 Jan '12
Module: wine Branch: master Commit: 72a7c34109b9e30cbef4a53a0eb81725dcf278f7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=72a7c34109b9e30cbef4a53a0…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Jan 11 05:02:03 2012 +0300 shell32: Avoid casts when creating item menu. --- dlls/shell32/cpanelfolder.c | 3 +-- dlls/shell32/shell32_main.h | 2 +- dlls/shell32/shfldr_desktop.c | 5 +---- dlls/shell32/shfldr_fs.c | 4 +--- dlls/shell32/shfldr_mycomp.c | 4 +--- dlls/shell32/shfldr_netplaces.c | 3 +-- dlls/shell32/shfldr_unixfs.c | 5 ++--- dlls/shell32/shlmenu.c | 6 ++++-- dlls/shell32/shlview_cmenu.c | 17 +++++++++++------ 9 files changed, 23 insertions(+), 26 deletions(-) diff --git a/dlls/shell32/cpanelfolder.c b/dlls/shell32/cpanelfolder.c index bbbd944..fbd1225 100644 --- a/dlls/shell32/cpanelfolder.c +++ b/dlls/shell32/cpanelfolder.c @@ -600,8 +600,7 @@ static HRESULT WINAPI ISF_ControlPanel_fnGetUIObjectOf(IShellFolder2 *iface, HWN *ppvOut = NULL; if (IsEqualIID(riid, &IID_IContextMenu) &&(cidl >= 1)) { - pObj = (LPUNKNOWN) ItemMenu_Constructor((IShellFolder *) iface, This->pidlRoot, apidl, cidl); - hr = S_OK; + return ItemMenu_Constructor((IShellFolder*)iface, This->pidlRoot, apidl, cidl, riid, ppvOut); } else if (IsEqualIID(riid, &IID_IDataObject) &&(cidl >= 1)) { pObj = (LPUNKNOWN) IDataObject_Constructor(hwndOwner, This->pidlRoot, apidl, cidl); hr = S_OK; diff --git a/dlls/shell32/shell32_main.h b/dlls/shell32/shell32_main.h index 3b0fb83..88a89a7 100644 --- a/dlls/shell32/shell32_main.h +++ b/dlls/shell32/shell32_main.h @@ -78,7 +78,7 @@ LPDATAOBJECT IDataObject_Constructor(HWND hwndOwner, LPCITEMIDLIST myPidl, LPCIT LPENUMFORMATETC IEnumFORMATETC_Constructor(UINT, const FORMATETC []) DECLSPEC_HIDDEN; LPCLASSFACTORY IClassFactory_Constructor(REFCLSID) DECLSPEC_HIDDEN; -IContextMenu2 * ItemMenu_Constructor(IShellFolder*, LPCITEMIDLIST, const LPCITEMIDLIST*, UINT) DECLSPEC_HIDDEN; +HRESULT ItemMenu_Constructor(IShellFolder*, LPCITEMIDLIST, const LPCITEMIDLIST*, UINT, REFIID, void**) DECLSPEC_HIDDEN; HRESULT BackgroundMenu_Constructor(IShellFolder*, BOOL, REFIID, void**) DECLSPEC_HIDDEN; LPSHELLVIEW IShellView_Constructor(LPSHELLFOLDER) DECLSPEC_HIDDEN; diff --git a/dlls/shell32/shfldr_desktop.c b/dlls/shell32/shfldr_desktop.c index ec9ba63..43d4108 100644 --- a/dlls/shell32/shfldr_desktop.c +++ b/dlls/shell32/shfldr_desktop.c @@ -530,10 +530,7 @@ static HRESULT WINAPI ISF_Desktop_fnGetUIObjectOf (IShellFolder2 * iface, if (IsEqualIID (riid, &IID_IContextMenu)) { if (cidl > 0) - { - pObj = (LPUNKNOWN) ItemMenu_Constructor( (IShellFolder *) iface, This->pidlRoot, apidl, cidl); - hr = S_OK; - } + return ItemMenu_Constructor((IShellFolder*)iface, This->pidlRoot, apidl, cidl, riid, ppvOut); else return BackgroundMenu_Constructor((IShellFolder*)iface, TRUE, riid, ppvOut); } diff --git a/dlls/shell32/shfldr_fs.c b/dlls/shell32/shfldr_fs.c index 49c4e7e..3bbe26e 100644 --- a/dlls/shell32/shfldr_fs.c +++ b/dlls/shell32/shfldr_fs.c @@ -744,9 +744,7 @@ IShellFolder_fnGetUIObjectOf (IShellFolder2 * iface, } if (IsEqualIID (riid, &IID_IContextMenu) && (cidl >= 1)) { - pObj = (LPUNKNOWN) ItemMenu_Constructor ((IShellFolder *) iface, - This->pidlRoot, apidl, cidl); - hr = S_OK; + return ItemMenu_Constructor((IShellFolder*)iface, This->pidlRoot, apidl, cidl, riid, ppvOut); } else if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1)) { pObj = (LPUNKNOWN) IDataObject_Constructor (hwndOwner, This->pidlRoot, apidl, cidl); diff --git a/dlls/shell32/shfldr_mycomp.c b/dlls/shell32/shfldr_mycomp.c index 2482223..200ad86 100644 --- a/dlls/shell32/shfldr_mycomp.c +++ b/dlls/shell32/shfldr_mycomp.c @@ -532,9 +532,7 @@ static HRESULT WINAPI ISF_MyComputer_fnGetUIObjectOf (IShellFolder2 * iface, if (IsEqualIID (riid, &IID_IContextMenu) && (cidl >= 1)) { - pObj = (LPUNKNOWN) ItemMenu_Constructor ((IShellFolder *) iface, - This->pidlRoot, apidl, cidl); - hr = S_OK; + return ItemMenu_Constructor((IShellFolder*) iface, This->pidlRoot, apidl, cidl, riid, ppvOut); } else if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1)) { diff --git a/dlls/shell32/shfldr_netplaces.c b/dlls/shell32/shfldr_netplaces.c index f1fd0e7..39f748b 100644 --- a/dlls/shell32/shfldr_netplaces.c +++ b/dlls/shell32/shfldr_netplaces.c @@ -426,8 +426,7 @@ static HRESULT WINAPI ISF_NetworkPlaces_fnGetUIObjectOf (IShellFolder2 * iface, if (IsEqualIID (riid, &IID_IContextMenu) && (cidl >= 1)) { - pObj = (LPUNKNOWN) ItemMenu_Constructor ((IShellFolder *) iface, This->pidlRoot, apidl, cidl); - hr = S_OK; + return ItemMenu_Constructor((IShellFolder*)iface, This->pidlRoot, apidl, cidl, riid, ppvOut); } else if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1)) { diff --git a/dlls/shell32/shfldr_unixfs.c b/dlls/shell32/shfldr_unixfs.c index 40d4c5c..d22327b 100644 --- a/dlls/shell32/shfldr_unixfs.c +++ b/dlls/shell32/shfldr_unixfs.c @@ -1165,10 +1165,9 @@ static HRESULT WINAPI UnixFolder_IShellFolder2_GetUIObjectOf(IShellFolder2* ifac if(hr != S_FALSE) return hr; } - + if (IsEqualIID(&IID_IContextMenu, riid)) { - *ppvOut = ItemMenu_Constructor((IShellFolder*)iface, This->m_pidlLocation, apidl, cidl); - return S_OK; + return ItemMenu_Constructor((IShellFolder*)iface, This->m_pidlLocation, apidl, cidl, riid, ppvOut); } else if (IsEqualIID(&IID_IDataObject, riid)) { *ppvOut = IDataObject_Constructor(hwndOwner, This->m_pidlLocation, apidl, cidl); return S_OK; diff --git a/dlls/shell32/shlmenu.c b/dlls/shell32/shlmenu.c index c3fd055..911feca 100644 --- a/dlls/shell32/shlmenu.c +++ b/dlls/shell32/shlmenu.c @@ -1275,7 +1275,8 @@ HRESULT WINAPI CDefFolderMenu_Create2(LPCITEMIDLIST pidlFolder, HWND hwnd, UINT } else folder_pidl=ILClone(pidlFolder); - system_menu = (IContextMenu*)ItemMenu_Constructor(psf,folder_pidl,(const LPCITEMIDLIST*)apidl,cidl); + + ItemMenu_Constructor(psf, folder_pidl, (const LPCITEMIDLIST*)apidl, cidl, &IID_IContextMenu, (void**)&system_menu); hres= SHELL_CreateContextMenu(hwnd,system_menu,psf,folder_pidl,apidl,cidl,ahkeys,nKeys,&IID_IContextMenu,(void**)ppcm); IContextMenu_Release(system_menu); ILFree(folder_pidl); @@ -1300,7 +1301,8 @@ HRESULT WINAPI SHCreateDefaultContextMenu(const DEFCONTEXTMENU *pdcm, REFIID rii folder_pidl=ILClone(pdcm->pidlFolder); if(pdcm->cKeys==0) FIXME("Loading shell extensions using IQueryAssociations not yet supported\n"); - system_menu = (IContextMenu*)ItemMenu_Constructor(folder,folder_pidl,(const LPCITEMIDLIST*)pdcm->apidl,pdcm->cidl); + + ItemMenu_Constructor(folder, folder_pidl, (const LPCITEMIDLIST*)pdcm->apidl, pdcm->cidl, &IID_IContextMenu, (void**)&system_menu); ret = SHELL_CreateContextMenu(pdcm->hwnd,system_menu,folder,folder_pidl,(LPCITEMIDLIST*)pdcm->apidl,pdcm->cidl,pdcm->aKeys,pdcm->cKeys,riid,ppv); IContextMenu_Release(system_menu); ILFree(folder_pidl); diff --git a/dlls/shell32/shlview_cmenu.c b/dlls/shell32/shlview_cmenu.c index 7833efe..b46820c 100644 --- a/dlls/shell32/shlview_cmenu.c +++ b/dlls/shell32/shlview_cmenu.c @@ -569,12 +569,16 @@ static const IContextMenu3Vtbl ItemContextMenuVtbl = ContextMenu_HandleMenuMsg2 }; -IContextMenu2 *ItemMenu_Constructor(IShellFolder *parent, LPCITEMIDLIST pidl, const LPCITEMIDLIST *apidl, UINT cidl) +HRESULT ItemMenu_Constructor(IShellFolder *parent, LPCITEMIDLIST pidl, const LPCITEMIDLIST *apidl, UINT cidl, + REFIID riid, void **pObj) { ContextMenu* This; - UINT u; + HRESULT hr; + int i; This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This)); + if (!This) return E_OUTOFMEMORY; + This->IContextMenu3_iface.lpVtbl = &ItemContextMenuVtbl; This->ref = 1; This->verb_offset = 0; @@ -588,12 +592,13 @@ IContextMenu2 *ItemMenu_Constructor(IShellFolder *parent, LPCITEMIDLIST pidl, co This->desktop = FALSE; - for(u = 0; u < cidl; u++) - This->allvalues &= (_ILIsValue(apidl[u]) ? 1 : 0); + for (i = 0; i < cidl; i++) + This->allvalues &= (_ILIsValue(apidl[i]) ? 1 : 0); - TRACE("(%p)\n", This); + hr = IContextMenu3_QueryInterface(&This->IContextMenu3_iface, riid, pObj); + IContextMenu3_Release(&This->IContextMenu3_iface); - return (IContextMenu2*)&This->IContextMenu3_iface; + return hr; } /* Background menu implementation */
1
0
0
0
Nikolay Sivov : shell32: Avoid pointer casts when background menu is created.
by Alexandre Julliard
11 Jan '12
11 Jan '12
Module: wine Branch: master Commit: 3efda60ef650af52d6e3aa28e238cf578a9f9063 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3efda60ef650af52d6e3aa28e…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Jan 11 04:39:24 2012 +0300 shell32: Avoid pointer casts when background menu is created. --- dlls/shell32/shell32_main.h | 2 +- dlls/shell32/shfldr_desktop.c | 6 ++++-- dlls/shell32/shlview.c | 10 ++++------ dlls/shell32/shlview_cmenu.c | 11 ++++++++--- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/dlls/shell32/shell32_main.h b/dlls/shell32/shell32_main.h index 4b883fd..3b0fb83 100644 --- a/dlls/shell32/shell32_main.h +++ b/dlls/shell32/shell32_main.h @@ -79,7 +79,7 @@ LPENUMFORMATETC IEnumFORMATETC_Constructor(UINT, const FORMATETC []) DECLSPEC_HI LPCLASSFACTORY IClassFactory_Constructor(REFCLSID) DECLSPEC_HIDDEN; IContextMenu2 * ItemMenu_Constructor(IShellFolder*, LPCITEMIDLIST, const LPCITEMIDLIST*, UINT) DECLSPEC_HIDDEN; -IContextMenu2 * BackgroundMenu_Constructor(IShellFolder*, BOOL) DECLSPEC_HIDDEN; +HRESULT BackgroundMenu_Constructor(IShellFolder*, BOOL, REFIID, void**) DECLSPEC_HIDDEN; LPSHELLVIEW IShellView_Constructor(LPSHELLFOLDER) DECLSPEC_HIDDEN; HRESULT WINAPI IFSFolder_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv) DECLSPEC_HIDDEN; diff --git a/dlls/shell32/shfldr_desktop.c b/dlls/shell32/shfldr_desktop.c index 202a793..ec9ba63 100644 --- a/dlls/shell32/shfldr_desktop.c +++ b/dlls/shell32/shfldr_desktop.c @@ -530,10 +530,12 @@ static HRESULT WINAPI ISF_Desktop_fnGetUIObjectOf (IShellFolder2 * iface, if (IsEqualIID (riid, &IID_IContextMenu)) { if (cidl > 0) + { pObj = (LPUNKNOWN) ItemMenu_Constructor( (IShellFolder *) iface, This->pidlRoot, apidl, cidl); + hr = S_OK; + } else - pObj = (LPUNKNOWN) BackgroundMenu_Constructor( (IShellFolder *) iface, TRUE); - hr = S_OK; + return BackgroundMenu_Constructor((IShellFolder*)iface, TRUE, riid, ppvOut); } else if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1)) { diff --git a/dlls/shell32/shlview.c b/dlls/shell32/shlview.c index 44cbcb6..efd6e0f 100644 --- a/dlls/shell32/shlview.c +++ b/dlls/shell32/shlview.c @@ -1018,7 +1018,6 @@ static void ShellView_DoContextMenu(IShellViewImpl * This, WORD x, WORD y, BOOL BOOL fExplore = FALSE; HWND hwndTree = 0; LPCONTEXTMENU pContextMenu = NULL; - IContextMenu2 *pCM = NULL; CMINVOKECOMMANDINFO cmi; TRACE("(%p)->(0x%08x 0x%08x 0x%08x) stub\n",This, x, y, bDefault); @@ -1093,9 +1092,11 @@ static void ShellView_DoContextMenu(IShellViewImpl * This, WORD x, WORD y, BOOL } else /* background context menu */ { + IContextMenu2 *pCM; + hMenu = CreatePopupMenu(); - pCM = BackgroundMenu_Constructor(This->pSFParent, FALSE); + BackgroundMenu_Constructor(This->pSFParent, FALSE, &IID_IContextMenu2, (void**)&pCM); IContextMenu2_QueryContextMenu(pCM, hMenu, 0, FCIDM_SHVIEWFIRST, FCIDM_SHVIEWLAST, 0); uCommand = TrackPopupMenu( hMenu, TPM_LEFTALIGN | TPM_RETURNCMD,x,y,0,This->hWnd,NULL); @@ -2049,10 +2050,7 @@ static HRESULT WINAPI IShellView_fnGetItemObject(IShellView2 *iface, UINT uItem, case SVGIO_BACKGROUND: if (IsEqualIID(&IID_IContextMenu, riid)) - { - *ppvOut = BackgroundMenu_Constructor(This->pSFParent, FALSE); - hr = S_OK; - } + return BackgroundMenu_Constructor(This->pSFParent, FALSE, riid, ppvOut); else FIXME("unsupported interface requested %s\n", debugstr_guid(riid)); diff --git a/dlls/shell32/shlview_cmenu.c b/dlls/shell32/shlview_cmenu.c index 31db01e..7833efe 100644 --- a/dlls/shell32/shlview_cmenu.c +++ b/dlls/shell32/shlview_cmenu.c @@ -877,11 +877,14 @@ static const IContextMenu3Vtbl BackgroundContextMenuVtbl = ContextMenu_HandleMenuMsg2 }; -IContextMenu2 *BackgroundMenu_Constructor(IShellFolder *parent, BOOL desktop) +HRESULT BackgroundMenu_Constructor(IShellFolder *parent, BOOL desktop, REFIID riid, void **pObj) { ContextMenu *This; + HRESULT hr; This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This)); + if (!This) return E_OUTOFMEMORY; + This->IContextMenu3_iface.lpVtbl = &BackgroundContextMenuVtbl; This->ref = 1; This->parent = parent; @@ -895,6 +898,8 @@ IContextMenu2 *BackgroundMenu_Constructor(IShellFolder *parent, BOOL desktop) This->desktop = desktop; if (parent) IShellFolder_AddRef(parent); - TRACE("(%p)\n", This); - return (IContextMenu2*)&This->IContextMenu3_iface; + hr = IContextMenu3_QueryInterface(&This->IContextMenu3_iface, riid, pObj); + IContextMenu3_Release(&This->IContextMenu3_iface); + + return hr; }
1
0
0
0
Nikolay Sivov : shell32: Update to IContextMenu3.
by Alexandre Julliard
11 Jan '12
11 Jan '12
Module: wine Branch: master Commit: 9fe57a8acf95f0ceaaabfab7ed516f6fa020f4be URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9fe57a8acf95f0ceaaabfab7e…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Jan 11 04:19:08 2012 +0300 shell32: Update to IContextMenu3. --- dlls/shell32/shlview_cmenu.c | 99 ++++++++++++++++++++--------------------- 1 files changed, 48 insertions(+), 51 deletions(-) diff --git a/dlls/shell32/shlview_cmenu.c b/dlls/shell32/shlview_cmenu.c index 1e1b3b0..31db01e 100644 --- a/dlls/shell32/shlview_cmenu.c +++ b/dlls/shell32/shlview_cmenu.c @@ -45,7 +45,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); typedef struct { - IContextMenu2 IContextMenu2_iface; + IContextMenu3 IContextMenu3_iface; LONG ref; IShellFolder* parent; @@ -61,22 +61,23 @@ typedef struct BOOL desktop; } ContextMenu; -static inline ContextMenu *impl_from_IContextMenu2(IContextMenu2 *iface) +static inline ContextMenu *impl_from_IContextMenu3(IContextMenu3 *iface) { - return CONTAINING_RECORD(iface, ContextMenu, IContextMenu2_iface); + return CONTAINING_RECORD(iface, ContextMenu, IContextMenu3_iface); } -static HRESULT WINAPI ContextMenu_QueryInterface(IContextMenu2 *iface, REFIID riid, LPVOID *ppvObj) +static HRESULT WINAPI ContextMenu_QueryInterface(IContextMenu3 *iface, REFIID riid, LPVOID *ppvObj) { - ContextMenu *This = impl_from_IContextMenu2(iface); + ContextMenu *This = impl_from_IContextMenu3(iface); TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObj); *ppvObj = NULL; - if (IsEqualIID(riid, &IID_IUnknown) || - IsEqualIID(riid, &IID_IContextMenu) || - IsEqualIID(riid, &IID_IContextMenu2)) + if (IsEqualIID(riid, &IID_IUnknown) || + IsEqualIID(riid, &IID_IContextMenu) || + IsEqualIID(riid, &IID_IContextMenu2) || + IsEqualIID(riid, &IID_IContextMenu3)) { *ppvObj = This; } @@ -87,7 +88,7 @@ static HRESULT WINAPI ContextMenu_QueryInterface(IContextMenu2 *iface, REFIID ri if(*ppvObj) { - IContextMenu2_AddRef(iface); + IContextMenu3_AddRef(iface); return S_OK; } @@ -95,17 +96,17 @@ static HRESULT WINAPI ContextMenu_QueryInterface(IContextMenu2 *iface, REFIID ri return E_NOINTERFACE; } -static ULONG WINAPI ContextMenu_AddRef(IContextMenu2 *iface) +static ULONG WINAPI ContextMenu_AddRef(IContextMenu3 *iface) { - ContextMenu *This = impl_from_IContextMenu2(iface); + ContextMenu *This = impl_from_IContextMenu3(iface); ULONG ref = InterlockedIncrement(&This->ref); TRACE("(%p)->(%u)\n", This, ref); return ref; } -static ULONG WINAPI ContextMenu_Release(IContextMenu2 *iface) +static ULONG WINAPI ContextMenu_Release(IContextMenu3 *iface) { - ContextMenu *This = impl_from_IContextMenu2(iface); + ContextMenu *This = impl_from_IContextMenu3(iface); ULONG ref = InterlockedDecrement(&This->ref); TRACE("(%p)->(%u)\n", This, ref); @@ -125,14 +126,14 @@ static ULONG WINAPI ContextMenu_Release(IContextMenu2 *iface) } static HRESULT WINAPI ItemMenu_QueryContextMenu( - IContextMenu2 *iface, + IContextMenu3 *iface, HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) { - ContextMenu *This = impl_from_IContextMenu2(iface); + ContextMenu *This = impl_from_IContextMenu3(iface); INT uIDMax; TRACE("(%p)->(%p %d 0x%x 0x%x 0x%x )\n", This, hmenu, indexMenu, idCmdFirst, idCmdLast, uFlags); @@ -400,10 +401,10 @@ static void DoOpenProperties(ContextMenu *This, HWND hwnd) } static HRESULT WINAPI ItemMenu_InvokeCommand( - IContextMenu2 *iface, + IContextMenu3 *iface, LPCMINVOKECOMMANDINFO lpcmi) { - ContextMenu *This = impl_from_IContextMenu2(iface); + ContextMenu *This = impl_from_IContextMenu3(iface); if (lpcmi->cbSize != sizeof(CMINVOKECOMMANDINFO)) FIXME("Is an EX structure\n"); @@ -485,14 +486,14 @@ static HRESULT WINAPI ItemMenu_InvokeCommand( } static HRESULT WINAPI ItemMenu_GetCommandString( - IContextMenu2 *iface, + IContextMenu3 *iface, UINT_PTR idCommand, UINT uFlags, UINT* lpReserved, LPSTR lpszName, UINT uMaxNameLen) { - ContextMenu *This = impl_from_IContextMenu2(iface); + ContextMenu *This = impl_from_IContextMenu3(iface); HRESULT hr = E_INVALIDARG; TRACE("(%p)->(%lx flags=%x %p name=%p len=%x)\n", This, idCommand, uFlags, lpReserved, lpszName, uMaxNameLen); @@ -540,18 +541,23 @@ static HRESULT WINAPI ItemMenu_GetCommandString( * should be only in IContextMenu2 and IContextMenu3 * is nevertheless called from word95 */ -static HRESULT WINAPI ItemMenu_HandleMenuMsg( - IContextMenu2 *iface, - UINT uMsg, - WPARAM wParam, - LPARAM lParam) +static HRESULT WINAPI ContextMenu_HandleMenuMsg(IContextMenu3 *iface, UINT msg, + WPARAM wParam, LPARAM lParam) { - ContextMenu *This = impl_from_IContextMenu2(iface); - TRACE("(%p)->(0x%x 0x%lx 0x%lx)\n", This, uMsg, wParam, lParam); + ContextMenu *This = impl_from_IContextMenu3(iface); + FIXME("(%p)->(0x%x 0x%lx 0x%lx): stub\n", This, msg, wParam, lParam); return E_NOTIMPL; } -static const IContextMenu2Vtbl ItemContextMenuVtbl = +static HRESULT WINAPI ContextMenu_HandleMenuMsg2(IContextMenu3 *iface, UINT msg, + WPARAM wParam, LPARAM lParam, LRESULT *result) +{ + ContextMenu *This = impl_from_IContextMenu3(iface); + FIXME("(%p)->(0x%x 0x%lx 0x%lx %p): stub\n", This, msg, wParam, lParam, result); + return E_NOTIMPL; +} + +static const IContextMenu3Vtbl ItemContextMenuVtbl = { ContextMenu_QueryInterface, ContextMenu_AddRef, @@ -559,7 +565,8 @@ static const IContextMenu2Vtbl ItemContextMenuVtbl = ItemMenu_QueryContextMenu, ItemMenu_InvokeCommand, ItemMenu_GetCommandString, - ItemMenu_HandleMenuMsg + ContextMenu_HandleMenuMsg, + ContextMenu_HandleMenuMsg2 }; IContextMenu2 *ItemMenu_Constructor(IShellFolder *parent, LPCITEMIDLIST pidl, const LPCITEMIDLIST *apidl, UINT cidl) @@ -568,7 +575,7 @@ IContextMenu2 *ItemMenu_Constructor(IShellFolder *parent, LPCITEMIDLIST pidl, co UINT u; This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This)); - This->IContextMenu2_iface.lpVtbl = &ItemContextMenuVtbl; + This->IContextMenu3_iface.lpVtbl = &ItemContextMenuVtbl; This->ref = 1; This->verb_offset = 0; This->parent = parent; @@ -586,19 +593,19 @@ IContextMenu2 *ItemMenu_Constructor(IShellFolder *parent, LPCITEMIDLIST pidl, co TRACE("(%p)\n", This); - return &This->IContextMenu2_iface; + return (IContextMenu2*)&This->IContextMenu3_iface; } /* Background menu implementation */ static HRESULT WINAPI BackgroundMenu_QueryContextMenu( - IContextMenu2 *iface, + IContextMenu3 *iface, HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) { - ContextMenu *This = impl_from_IContextMenu2(iface); + ContextMenu *This = impl_from_IContextMenu3(iface); HMENU hMyMenu; UINT idMax; HRESULT hr; @@ -752,10 +759,10 @@ static BOOL DoPaste(ContextMenu *This) } static HRESULT WINAPI BackgroundMenu_InvokeCommand( - IContextMenu2 *iface, + IContextMenu3 *iface, LPCMINVOKECOMMANDINFO lpcmi) { - ContextMenu *This = impl_from_IContextMenu2(iface); + ContextMenu *This = impl_from_IContextMenu3(iface); IShellBrowser *browser; IShellView *view = NULL; HWND hWnd = NULL; @@ -828,14 +835,14 @@ static HRESULT WINAPI BackgroundMenu_InvokeCommand( } static HRESULT WINAPI BackgroundMenu_GetCommandString( - IContextMenu2 *iface, + IContextMenu3 *iface, UINT_PTR idCommand, UINT uFlags, UINT* lpReserved, LPSTR lpszName, UINT uMaxNameLen) { - ContextMenu *This = impl_from_IContextMenu2(iface); + ContextMenu *This = impl_from_IContextMenu3(iface); TRACE("(%p)->(idcom=%lx flags=%x %p name=%p len=%x)\n",This, idCommand, uFlags, lpReserved, lpszName, uMaxNameLen); @@ -858,18 +865,7 @@ static HRESULT WINAPI BackgroundMenu_GetCommandString( return E_FAIL; } -static HRESULT WINAPI BackgroundMenu_HandleMenuMsg( - IContextMenu2 *iface, - UINT uMsg, - WPARAM wParam, - LPARAM lParam) -{ - ContextMenu *This = impl_from_IContextMenu2(iface); - FIXME("(%p)->(msg=%x wp=%lx lp=%lx)\n",This, uMsg, wParam, lParam); - return E_NOTIMPL; -} - -static const IContextMenu2Vtbl BackgroundContextMenuVtbl = +static const IContextMenu3Vtbl BackgroundContextMenuVtbl = { ContextMenu_QueryInterface, ContextMenu_AddRef, @@ -877,7 +873,8 @@ static const IContextMenu2Vtbl BackgroundContextMenuVtbl = BackgroundMenu_QueryContextMenu, BackgroundMenu_InvokeCommand, BackgroundMenu_GetCommandString, - BackgroundMenu_HandleMenuMsg + ContextMenu_HandleMenuMsg, + ContextMenu_HandleMenuMsg2 }; IContextMenu2 *BackgroundMenu_Constructor(IShellFolder *parent, BOOL desktop) @@ -885,7 +882,7 @@ IContextMenu2 *BackgroundMenu_Constructor(IShellFolder *parent, BOOL desktop) ContextMenu *This; This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This)); - This->IContextMenu2_iface.lpVtbl = &BackgroundContextMenuVtbl; + This->IContextMenu3_iface.lpVtbl = &BackgroundContextMenuVtbl; This->ref = 1; This->parent = parent; This->verb_offset = 0; @@ -899,5 +896,5 @@ IContextMenu2 *BackgroundMenu_Constructor(IShellFolder *parent, BOOL desktop) if (parent) IShellFolder_AddRef(parent); TRACE("(%p)\n", This); - return &This->IContextMenu2_iface; + return (IContextMenu2*)&This->IContextMenu3_iface; }
1
0
0
0
Nikolay Sivov : shell32: Use shared IUnknown implementation for both vtables.
by Alexandre Julliard
11 Jan '12
11 Jan '12
Module: wine Branch: master Commit: 82c72f2fae591c98e3364adb74dc1fbed8477169 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=82c72f2fae591c98e3364adb7…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Jan 11 03:58:33 2012 +0300 shell32: Use shared IUnknown implementation for both vtables. --- dlls/shell32/shlview_cmenu.c | 74 +++++------------------------------------ 1 files changed, 9 insertions(+), 65 deletions(-) diff --git a/dlls/shell32/shlview_cmenu.c b/dlls/shell32/shlview_cmenu.c index 3c3f369..1e1b3b0 100644 --- a/dlls/shell32/shlview_cmenu.c +++ b/dlls/shell32/shlview_cmenu.c @@ -66,7 +66,7 @@ static inline ContextMenu *impl_from_IContextMenu2(IContextMenu2 *iface) return CONTAINING_RECORD(iface, ContextMenu, IContextMenu2_iface); } -static HRESULT WINAPI ItemMenu_QueryInterface(IContextMenu2 *iface, REFIID riid, LPVOID *ppvObj) +static HRESULT WINAPI ContextMenu_QueryInterface(IContextMenu2 *iface, REFIID riid, LPVOID *ppvObj) { ContextMenu *This = impl_from_IContextMenu2(iface); @@ -95,7 +95,7 @@ static HRESULT WINAPI ItemMenu_QueryInterface(IContextMenu2 *iface, REFIID riid, return E_NOINTERFACE; } -static ULONG WINAPI ItemMenu_AddRef(IContextMenu2 *iface) +static ULONG WINAPI ContextMenu_AddRef(IContextMenu2 *iface) { ContextMenu *This = impl_from_IContextMenu2(iface); ULONG ref = InterlockedIncrement(&This->ref); @@ -103,7 +103,7 @@ static ULONG WINAPI ItemMenu_AddRef(IContextMenu2 *iface) return ref; } -static ULONG WINAPI ItemMenu_Release(IContextMenu2 *iface) +static ULONG WINAPI ContextMenu_Release(IContextMenu2 *iface) { ContextMenu *This = impl_from_IContextMenu2(iface); ULONG ref = InterlockedDecrement(&This->ref); @@ -553,9 +553,9 @@ static HRESULT WINAPI ItemMenu_HandleMenuMsg( static const IContextMenu2Vtbl ItemContextMenuVtbl = { - ItemMenu_QueryInterface, - ItemMenu_AddRef, - ItemMenu_Release, + ContextMenu_QueryInterface, + ContextMenu_AddRef, + ContextMenu_Release, ItemMenu_QueryContextMenu, ItemMenu_InvokeCommand, ItemMenu_GetCommandString, @@ -590,62 +590,6 @@ IContextMenu2 *ItemMenu_Constructor(IShellFolder *parent, LPCITEMIDLIST pidl, co } /* Background menu implementation */ -static HRESULT WINAPI BackgroundMenu_QueryInterface(IContextMenu2 *iface, REFIID riid, void **ppvObj) -{ - ContextMenu *This = impl_from_IContextMenu2(iface); - - TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObj); - - *ppvObj = NULL; - - if(IsEqualIID(riid, &IID_IUnknown) || - IsEqualIID(riid, &IID_IContextMenu) || - IsEqualIID(riid, &IID_IContextMenu2)) - { - *ppvObj = This; - } - else if(IsEqualIID(riid, &IID_IShellExtInit)) /*IShellExtInit*/ - { - FIXME("-- LPSHELLEXTINIT pointer requested\n"); - } - - if(*ppvObj) - { - IContextMenu2_AddRef(iface); - TRACE("-- Interface: (%p)->(%p)\n", ppvObj, *ppvObj); - return S_OK; - } - - TRACE("-- Interface: E_NOINTERFACE\n"); - return E_NOINTERFACE; -} - -static ULONG WINAPI BackgroundMenu_AddRef(IContextMenu2 *iface) -{ - ContextMenu *This = impl_from_IContextMenu2(iface); - ULONG ref = InterlockedIncrement(&This->ref); - TRACE("(%p)->(%u)\n", This, ref); - return ref; -} - -static ULONG WINAPI BackgroundMenu_Release(IContextMenu2 *iface) -{ - ContextMenu *This = impl_from_IContextMenu2(iface); - ULONG ref = InterlockedDecrement(&This->ref); - - TRACE("(%p)->(%u)\n", This, ref); - - if (!ref) - { - if (This->parent) - IShellFolder_Release(This->parent); - - HeapFree(GetProcessHeap(), 0, This); - } - - return ref; -} - static HRESULT WINAPI BackgroundMenu_QueryContextMenu( IContextMenu2 *iface, HMENU hMenu, @@ -927,9 +871,9 @@ static HRESULT WINAPI BackgroundMenu_HandleMenuMsg( static const IContextMenu2Vtbl BackgroundContextMenuVtbl = { - BackgroundMenu_QueryInterface, - BackgroundMenu_AddRef, - BackgroundMenu_Release, + ContextMenu_QueryInterface, + ContextMenu_AddRef, + ContextMenu_Release, BackgroundMenu_QueryContextMenu, BackgroundMenu_InvokeCommand, BackgroundMenu_GetCommandString,
1
0
0
0
Nikolay Sivov : shell32: Get rid of menu enabling helper.
by Alexandre Julliard
11 Jan '12
11 Jan '12
Module: wine Branch: master Commit: bfc39c83b536fc052f97be4881e4c2eb2761f32a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bfc39c83b536fc052f97be488…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Jan 11 03:51:14 2012 +0300 shell32: Get rid of menu enabling helper. --- dlls/shell32/shlview_cmenu.c | 31 ++++++++++++++++--------------- 1 files changed, 16 insertions(+), 15 deletions(-) diff --git a/dlls/shell32/shlview_cmenu.c b/dlls/shell32/shlview_cmenu.c index 3bcf701..3c3f369 100644 --- a/dlls/shell32/shlview_cmenu.c +++ b/dlls/shell32/shlview_cmenu.c @@ -66,20 +66,6 @@ static inline ContextMenu *impl_from_IContextMenu2(IContextMenu2 *iface) return CONTAINING_RECORD(iface, ContextMenu, IContextMenu2_iface); } -static BOOL ItemMenu_CanRenameItems(ContextMenu *This) -{ - DWORD attr; - - TRACE("(%p)\n", This); - - /* can't rename more than one item at a time*/ - if (!This->apidl || This->cidl > 1) return FALSE; - - attr = SFGAO_CANRENAME; - IShellFolder_GetAttributesOf(This->parent, 1, (LPCITEMIDLIST*)This->apidl, &attr); - return attr & SFGAO_CANRENAME; -} - static HRESULT WINAPI ItemMenu_QueryInterface(IContextMenu2 *iface, REFIID riid, LPVOID *ppvObj) { ContextMenu *This = impl_from_IContextMenu2(iface); @@ -189,7 +175,22 @@ static HRESULT WINAPI ItemMenu_QueryContextMenu( if(uFlags & ~CMF_CANRENAME) RemoveMenu(hmenu, FCIDM_SHVIEW_RENAME, MF_BYCOMMAND); else - EnableMenuItem(hmenu, FCIDM_SHVIEW_RENAME, MF_BYCOMMAND | ItemMenu_CanRenameItems(This) ? MFS_ENABLED : MFS_DISABLED); + { + UINT enable = MF_BYCOMMAND; + + /* can't rename more than one item at a time*/ + if (!This->apidl || This->cidl > 1) + enable |= MFS_DISABLED; + else + { + DWORD attr = SFGAO_CANRENAME; + + IShellFolder_GetAttributesOf(This->parent, 1, (LPCITEMIDLIST*)This->apidl, &attr); + enable |= (attr & SFGAO_CANRENAME) ? MFS_ENABLED : MFS_DISABLED; + } + + EnableMenuItem(hmenu, FCIDM_SHVIEW_RENAME, enable); + } return MAKE_HRESULT(SEVERITY_SUCCESS, 0, uIDMax-idCmdFirst); }
1
0
0
0
Nikolay Sivov : shell32: Merge menu implementations together.
by Alexandre Julliard
11 Jan '12
11 Jan '12
Module: wine Branch: master Commit: dff08c977105999ee1ce0c741a7ad3d528f0693f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=dff08c977105999ee1ce0c741…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Jan 11 03:45:28 2012 +0300 shell32: Merge menu implementations together. --- dlls/shell32/shlview_cmenu.c | 443 ++++++++++++++++++++---------------------- 1 files changed, 214 insertions(+), 229 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=dff08c977105999ee1ce0…
1
0
0
0
← Newer
1
...
65
66
67
68
69
70
71
...
98
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
Results per page:
10
25
50
100
200