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
February 2018
----- 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
804 discussions
Start a n
N
ew thread
Nikolay Sivov : shell32: Added IShellExtInit stub for context menus.
by Alexandre Julliard
19 Feb '18
19 Feb '18
Module: wine Branch: master Commit: 408f856f02d33042bb6ec48bb181251a38666687 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=408f856f02d33042bb6ec48b…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Feb 18 19:10:44 2018 +0300 shell32: Added IShellExtInit stub for context menus. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/shell32/shlview_cmenu.c | 48 ++++++++++++++++++++++++++++++++++++++++-- dlls/shell32/tests/shlfolder.c | 2 -- 2 files changed, 46 insertions(+), 4 deletions(-) diff --git a/dlls/shell32/shlview_cmenu.c b/dlls/shell32/shlview_cmenu.c index 3f09413..2b5d526 100644 --- a/dlls/shell32/shlview_cmenu.c +++ b/dlls/shell32/shlview_cmenu.c @@ -45,6 +45,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); typedef struct { IContextMenu3 IContextMenu3_iface; + IShellExtInit IShellExtInit_iface; LONG ref; IShellFolder* parent; @@ -64,6 +65,11 @@ static inline ContextMenu *impl_from_IContextMenu3(IContextMenu3 *iface) return CONTAINING_RECORD(iface, ContextMenu, IContextMenu3_iface); } +static inline ContextMenu *impl_from_IShellExtInit(IShellExtInit *iface) +{ + return CONTAINING_RECORD(iface, ContextMenu, IShellExtInit_iface); +} + static HRESULT WINAPI ContextMenu_QueryInterface(IContextMenu3 *iface, REFIID riid, LPVOID *ppvObj) { ContextMenu *This = impl_from_IContextMenu3(iface); @@ -79,9 +85,9 @@ static HRESULT WINAPI ContextMenu_QueryInterface(IContextMenu3 *iface, REFIID ri { *ppvObj = &This->IContextMenu3_iface; } - else if (IsEqualIID(riid, &IID_IShellExtInit)) /*IShellExtInit*/ + else if (IsEqualIID(riid, &IID_IShellExtInit)) { - FIXME("-- LPSHELLEXTINIT pointer requested\n"); + *ppvObj = &This->IShellExtInit_iface; } if(*ppvObj) @@ -580,6 +586,42 @@ static const IContextMenu3Vtbl ItemContextMenuVtbl = ContextMenu_HandleMenuMsg2 }; +static HRESULT WINAPI ShellExtInit_QueryInterface(IShellExtInit *iface, REFIID riid, void **obj) +{ + ContextMenu *This = impl_from_IShellExtInit(iface); + return IContextMenu3_QueryInterface(&This->IContextMenu3_iface, riid, obj); +} + +static ULONG WINAPI ShellExtInit_AddRef(IShellExtInit *iface) +{ + ContextMenu *This = impl_from_IShellExtInit(iface); + return IContextMenu3_AddRef(&This->IContextMenu3_iface); +} + +static ULONG WINAPI ShellExtInit_Release(IShellExtInit *iface) +{ + ContextMenu *This = impl_from_IShellExtInit(iface); + return IContextMenu3_Release(&This->IContextMenu3_iface); +} + +static HRESULT WINAPI ShellExtInit_Initialize(IShellExtInit *iface, LPCITEMIDLIST folder, + IDataObject *dataobj, HKEY progidkey) +{ + ContextMenu *This = impl_from_IShellExtInit(iface); + + FIXME("(%p)->(%p %p %p): stub\n", This, folder, dataobj, progidkey); + + return E_NOTIMPL; +} + +static const IShellExtInitVtbl ShellExtInitVtbl = +{ + ShellExtInit_QueryInterface, + ShellExtInit_AddRef, + ShellExtInit_Release, + ShellExtInit_Initialize +}; + HRESULT ItemMenu_Constructor(IShellFolder *parent, LPCITEMIDLIST pidl, const LPCITEMIDLIST *apidl, UINT cidl, REFIID riid, void **pObj) { @@ -591,6 +633,7 @@ HRESULT ItemMenu_Constructor(IShellFolder *parent, LPCITEMIDLIST pidl, const LPC if (!This) return E_OUTOFMEMORY; This->IContextMenu3_iface.lpVtbl = &ItemContextMenuVtbl; + This->IShellExtInit_iface.lpVtbl = &ShellExtInitVtbl; This->ref = 1; This->parent = parent; if (parent) IShellFolder_AddRef(parent); @@ -899,6 +942,7 @@ HRESULT BackgroundMenu_Constructor(IShellFolder *parent, BOOL desktop, REFIID ri if (!This) return E_OUTOFMEMORY; This->IContextMenu3_iface.lpVtbl = &BackgroundContextMenuVtbl; + This->IShellExtInit_iface.lpVtbl = &ShellExtInitVtbl; This->ref = 1; This->parent = parent; diff --git a/dlls/shell32/tests/shlfolder.c b/dlls/shell32/tests/shlfolder.c index 1cf04b5..fac0801 100644 --- a/dlls/shell32/tests/shlfolder.c +++ b/dlls/shell32/tests/shlfolder.c @@ -4354,9 +4354,7 @@ static void test_contextmenu(IContextMenu *menu, BOOL background) HRESULT hr; hr = IContextMenu_QueryInterface(menu, &IID_IShellExtInit, (void **)&unk); -todo_wine ok(hr == S_OK, "Failed to get IShellExtInit, hr %#x.\n", hr); -if (hr == S_OK) IUnknown_Release(unk); hr = IContextMenu_QueryInterface(menu, &IID_IObjectWithSite, (void **)&unk);
1
0
0
0
Nikolay Sivov : shell32/tests: Run context menu tests on background menu too.
by Alexandre Julliard
19 Feb '18
19 Feb '18
Module: wine Branch: master Commit: 68056a3d27af5931b236021dc1c6d897e269e456 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=68056a3d27af5931b236021d…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Feb 18 19:10:43 2018 +0300 shell32/tests: Run context menu tests on background menu too. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/shell32/tests/shlfolder.c | 191 +++++++++++++++++++++++------------------ 1 file changed, 108 insertions(+), 83 deletions(-) diff --git a/dlls/shell32/tests/shlfolder.c b/dlls/shell32/tests/shlfolder.c index 40ba378..1cf04b5 100644 --- a/dlls/shell32/tests/shlfolder.c +++ b/dlls/shell32/tests/shlfolder.c @@ -4343,6 +4343,96 @@ static void test_desktop_IPersist(void) IShellFolder_Release(desktop); } +static void test_contextmenu(IContextMenu *menu, BOOL background) +{ + HMENU hmenu = CreatePopupMenu(); + const int id_upper_limit = 32767; + const int baseItem = 0x40; + INT max_id, max_id_check; + IUnknown *unk; + UINT count, i; + HRESULT hr; + + hr = IContextMenu_QueryInterface(menu, &IID_IShellExtInit, (void **)&unk); +todo_wine + ok(hr == S_OK, "Failed to get IShellExtInit, hr %#x.\n", hr); +if (hr == S_OK) + IUnknown_Release(unk); + + hr = IContextMenu_QueryInterface(menu, &IID_IObjectWithSite, (void **)&unk); +todo_wine + ok(hr == S_OK, "Failed to get IShellExtInit, hr %#x.\n", hr); +if (hr == S_OK) + IUnknown_Release(unk); + + hr = IContextMenu_QueryContextMenu(menu, hmenu, 0, baseItem, id_upper_limit, CMF_NORMAL); + ok(SUCCEEDED(hr), "Failed to query the menu, hr %#x.\n", hr); + + max_id = HRESULT_CODE(hr) - 1; /* returns max_id + 1 */ + ok(max_id <= id_upper_limit, "Got %d\n", max_id); + count = GetMenuItemCount(hmenu); + ok(count, "Got %d\n", count); + + max_id_check = 0; + for (i = 0; i < count; i++) + { + MENUITEMINFOA mii; + INT res; + char buf[255], buf2[255]; + ZeroMemory(&mii, sizeof(MENUITEMINFOA)); + mii.cbSize = sizeof(MENUITEMINFOA); + mii.fMask = MIIM_ID | MIIM_FTYPE | MIIM_STRING; + mii.dwTypeData = buf2; + mii.cch = sizeof(buf2); + + res = GetMenuItemInfoA(hmenu, i, TRUE, &mii); + ok(res, "Failed to get menu item info, error %d.\n", GetLastError()); + + ok((mii.wID <= id_upper_limit) || (mii.fType & MFT_SEPARATOR), + "Got non-separator ID out of range: %d (type: %x)\n", mii.wID, mii.fType); + if (!(mii.fType & MFT_SEPARATOR)) + { + max_id_check = (mii.wID > max_id_check) ? mii.wID : max_id_check; + hr = IContextMenu_GetCommandString(menu, mii.wID - baseItem, GCS_VERBA, 0, buf, sizeof(buf)); + todo_wine_if(background) + ok(SUCCEEDED(hr) || hr == E_NOTIMPL, "for id 0x%x got 0x%08x (menustr: %s)\n", mii.wID - baseItem, hr, mii.dwTypeData); + if (SUCCEEDED(hr)) + trace("for id 0x%x got string %s (menu string: %s)\n", mii.wID - baseItem, buf, mii.dwTypeData); + else if (hr == E_NOTIMPL) + trace("for id 0x%x got E_NOTIMPL (menu string: %s)\n", mii.wID - baseItem, mii.dwTypeData); + } + } + max_id_check -= baseItem; + ok((max_id_check == max_id) || + (max_id_check == max_id-1) || /* Win 7 */ + (max_id_check == max_id-2) || /* Win 8 */ + (max_id_check == max_id-3), + "Not equal (or near equal), got %d and %d\n", max_id_check, max_id); + + if (count) + { + CMINVOKECOMMANDINFO cmi; + + memset(&cmi, 0, sizeof(CMINVOKECOMMANDINFO)); + cmi.cbSize = sizeof(CMINVOKECOMMANDINFO); + + /* Attempt to execute a nonexistent command */ + cmi.lpVerb = MAKEINTRESOURCEA(9999); + hr = IContextMenu_InvokeCommand(menu, &cmi); + todo_wine_if(background) + ok(hr == E_INVALIDARG, "Got 0x%08x\n", hr); + + cmi.lpVerb = "foobar_wine_test"; + hr = IContextMenu_InvokeCommand(menu, &cmi); + todo_wine_if(background) + ok((hr == E_INVALIDARG) || (hr == E_FAIL /* Win7 */) || + (hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION) /* Vista */), + "Unexpected hr %#x.\n", hr); + } + + DestroyMenu(hmenu); +} + static void test_GetUIObject(void) { IShellFolder *psf_desktop; @@ -4352,6 +4442,8 @@ static void test_GetUIObject(void) WCHAR path[MAX_PATH]; const WCHAR filename[] = {'\\','t','e','s','t','d','i','r','\\','t','e','s','t','1','.','t','x','t',0}; + LPCITEMIDLIST pidl_child; + IShellFolder *psf; GetCurrentDirectoryW(MAX_PATH, path); if (!path[0]) @@ -4366,91 +4458,24 @@ static void test_GetUIObject(void) hr = IShellFolder_ParseDisplayName(psf_desktop, NULL, NULL, path, NULL, &pidl, 0); ok(hr == S_OK, "Got 0x%08x\n", hr); - if(SUCCEEDED(hr)) - { - IShellFolder *psf; - LPCITEMIDLIST pidl_child; - hr = SHBindToParent(pidl, &IID_IShellFolder, (void**)&psf, &pidl_child); - ok(hr == S_OK, "Got 0x%08x\n", hr); - if(SUCCEEDED(hr)) - { - hr = IShellFolder_GetUIObjectOf(psf, NULL, 1, &pidl_child, &IID_IContextMenu, NULL, - (void**)&pcm); - ok(hr == S_OK, "Got 0x%08x\n", hr); - if(SUCCEEDED(hr)) - { - const int baseItem = 0x40; - HMENU hmenu = CreatePopupMenu(); - INT max_id, max_id_check; - UINT count, i; - const int id_upper_limit = 32767; - hr = IContextMenu_QueryContextMenu(pcm, hmenu, 0, baseItem, id_upper_limit, CMF_NORMAL); - ok(SUCCEEDED(hr), "Got 0x%08x\n", hr); - max_id = HRESULT_CODE(hr) - 1; /* returns max_id + 1 */ - ok(max_id <= id_upper_limit, "Got %d\n", max_id); - count = GetMenuItemCount(hmenu); - ok(count, "Got %d\n", count); - - max_id_check = 0; - for(i = 0; i < count; i++) - { - MENUITEMINFOA mii; - INT res; - char buf[255], buf2[255]; - ZeroMemory(&mii, sizeof(MENUITEMINFOA)); - mii.cbSize = sizeof(MENUITEMINFOA); - mii.fMask = MIIM_ID | MIIM_FTYPE | MIIM_STRING; - mii.dwTypeData = buf2; - mii.cch = sizeof(buf2); - - SetLastError(0); - res = GetMenuItemInfoA(hmenu, i, TRUE, &mii); - ok(res, "Failed (last error: %d).\n", GetLastError()); - - ok( (mii.wID <= id_upper_limit) || (mii.fType & MFT_SEPARATOR), - "Got non-separator ID out of range: %d (type: %x)\n", mii.wID, mii.fType); - if(!(mii.fType & MFT_SEPARATOR)) - { - max_id_check = (mii.wID>max_id_check)?mii.wID:max_id_check; - hr = IContextMenu_GetCommandString(pcm, mii.wID - baseItem, GCS_VERBA, 0, buf, sizeof(buf)); - ok(SUCCEEDED(hr) || hr == E_NOTIMPL, "for id 0x%x got 0x%08x (menustr: %s)\n", mii.wID - baseItem, hr, mii.dwTypeData); - if (SUCCEEDED(hr)) - trace("for id 0x%x got string %s (menu string: %s)\n", mii.wID - baseItem, buf, mii.dwTypeData); - else if (hr == E_NOTIMPL) - trace("for id 0x%x got E_NOTIMPL (menu string: %s)\n", mii.wID - baseItem, mii.dwTypeData); - } - } - max_id_check -= baseItem; - ok((max_id_check == max_id) || - (max_id_check == max_id-1) || /* Win 7 */ - (max_id_check == max_id-2), /* Win 8 */ - "Not equal (or near equal), got %d and %d\n", max_id_check, max_id); - if(count) - { - CMINVOKECOMMANDINFO cmi; - ZeroMemory(&cmi, sizeof(CMINVOKECOMMANDINFO)); - cmi.cbSize = sizeof(CMINVOKECOMMANDINFO); - - /* Attempt to execute a nonexistent command */ - cmi.lpVerb = MAKEINTRESOURCEA(9999); - hr = IContextMenu_InvokeCommand(pcm, &cmi); - ok(hr == E_INVALIDARG, "Got 0x%08x\n", hr); - - cmi.lpVerb = "foobar_wine_test"; - hr = IContextMenu_InvokeCommand(pcm, &cmi); - ok( (hr == E_INVALIDARG) || (hr == E_FAIL /* Win7 */) || - (hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION) /* Vista */), - "Got 0x%08x\n", hr); - } + hr = SHBindToParent(pidl, &IID_IShellFolder, (void **)&psf, &pidl_child); + ok(hr == S_OK, "Failed to bind to folder, hr %#x.\n", hr); - DestroyMenu(hmenu); - IContextMenu_Release(pcm); - } - IShellFolder_Release(psf); - } - ILFree(pidl); - } + /* Item menu */ + hr = IShellFolder_GetUIObjectOf(psf, NULL, 1, &pidl_child, &IID_IContextMenu, NULL, (void **)&pcm); + ok(hr == S_OK, "GetUIObjectOf() failed, hr %#x.\n", hr); + test_contextmenu(pcm, FALSE); + IContextMenu_Release(pcm); + + /* Background menu */ + hr = IShellFolder_GetUIObjectOf(psf_desktop, NULL, 0, NULL, &IID_IContextMenu, NULL, (void **)&pcm); + ok(hr == S_OK, "GetUIObjectOf() failed, hr %#x.\n", hr); + test_contextmenu(pcm, TRUE); + IContextMenu_Release(pcm); + + IShellFolder_Release(psf); + ILFree(pidl); IShellFolder_Release(psf_desktop); Cleanup();
1
0
0
0
Nikolay Sivov : shell32/tests: Add a basic test for NewMenu object creation.
by Alexandre Julliard
19 Feb '18
19 Feb '18
Module: wine Branch: master Commit: 1f1f190bf05ca44d2aef47a2eee508925c888adf URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1f1f190bf05ca44d2aef47a2…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Feb 18 19:10:42 2018 +0300 shell32/tests: Add a basic test for NewMenu object creation. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/shell32/tests/shlview.c | 30 ++++++++++++++++++++++++++++++ include/shlguid.h | 1 + 2 files changed, 31 insertions(+) diff --git a/dlls/shell32/tests/shlview.c b/dlls/shell32/tests/shlview.c index 7685506..f31d16e 100644 --- a/dlls/shell32/tests/shlview.c +++ b/dlls/shell32/tests/shlview.c @@ -1476,6 +1476,35 @@ if (0) IShellFolder_Release(desktop); } +static void test_newmenu(void) +{ + IUnknown *unk, *unk2; + HRESULT hr; + + hr = CoCreateInstance(&CLSID_NewMenu, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)&unk); +todo_wine + ok(hr == S_OK, "Failed to create NewMenu object, hr %#x.\n", hr); + if (hr != S_OK) + { + skip("NewMenu is not supported.\n"); + return; + } + + hr = IUnknown_QueryInterface(unk, &IID_IShellExtInit, (void **)&unk2); + ok(hr == S_OK, "Failed to get IShellExtInit, hr %#x.\n", hr); + IUnknown_Release(unk2); + + hr = IUnknown_QueryInterface(unk, &IID_IContextMenu3, (void **)&unk2); + ok(hr == S_OK, "Failed to get IContextMenu3, hr %#x.\n", hr); + IUnknown_Release(unk2); + + hr = IUnknown_QueryInterface(unk, &IID_IObjectWithSite, (void **)&unk2); + ok(hr == S_OK, "Failed to get IObjectWithSite, hr %#x.\n", hr); + IUnknown_Release(unk2); + + IUnknown_Release(unk); +} + START_TEST(shlview) { OleInitialize(NULL); @@ -1491,6 +1520,7 @@ START_TEST(shlview) test_IOleCommandTarget(); test_SHCreateShellFolderView(); test_SHCreateShellFolderViewEx(); + test_newmenu(); OleUninitialize(); } diff --git a/include/shlguid.h b/include/shlguid.h index 028cb61..687bbec 100644 --- a/include/shlguid.h +++ b/include/shlguid.h @@ -146,6 +146,7 @@ DEFINE_GUID(CLSID_DragDropHelper, 0x4657278a, 0x411b, 0x11d2, 0x83, 0x9a, 0x00, DEFINE_GUID(CLSID_ProgressDialog, 0xf8383852, 0xfcd3, 0x11d1, 0xa6, 0xb9, 0x0, 0x60, 0x97, 0xdf, 0x5b, 0xd4); DEFINE_GUID(CLSID_ShellItem, 0x2fe352ea, 0xfd1f, 0x11d2, 0xb1, 0xf4, 0x00, 0xc0, 0x4f, 0x8e, 0xeb, 0x3e); +DEFINE_GUID(CLSID_NewMenu, 0xd969a300, 0xe7ff, 0x11d0, 0xa9, 0x3b, 0x0, 0xa0, 0xc9, 0xf, 0x27, 0x19); #define PSGUID_SHELLDETAILS {0x28636aa6, 0x953d, 0x11d2, 0xb5, 0xd6, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0xd0} DEFINE_GUID(FMTID_ShellDetails, 0x28636aa6, 0x953d, 0x11d2, 0xb5, 0xd6, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0xd0);
1
0
0
0
Zebediah Figura : msi/tests: Add a test for MsiGetDatabaseState() called from a custom action.
by Alexandre Julliard
19 Feb '18
19 Feb '18
Module: wine Branch: master Commit: 237ec6480749741af45e852151089dada22ae8fd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=237ec6480749741af45e8521…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Wed Feb 14 20:54:56 2018 -0600 msi/tests: Add a test for MsiGetDatabaseState() called from a custom action. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msi/tests/custom.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c index c00b7aa..0eedb8e 100644 --- a/dlls/msi/tests/custom.c +++ b/dlls/msi/tests/custom.c @@ -56,6 +56,7 @@ static void ok_(MSIHANDLE hinst, int todo, const char *file, int line, int condi * or have undesired side effects should go here. */ UINT WINAPI main_test(MSIHANDLE hinst) { + UINT res; IUnknown *unk = NULL; HRESULT hres; @@ -65,6 +66,10 @@ UINT WINAPI main_test(MSIHANDLE hinst) if (unk) IUnknown_Release(unk); + /* Test MsiGetDatabaseState() */ + res = MsiGetDatabaseState(hinst); + todo_wine_ok(hinst, res == MSIDBSTATE_ERROR, "expected MSIDBSTATE_ERROR, got %u\n", res); + return ERROR_SUCCESS; }
1
0
0
0
Zebediah Figura : msi/tests: Add a test for creating MTA objects from a custom action.
by Alexandre Julliard
19 Feb '18
19 Feb '18
Module: wine Branch: master Commit: 77e6bd13b60ca2a6c1793687be60c1efaf0d9967 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=77e6bd13b60ca2a6c1793687…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Wed Feb 14 20:54:55 2018 -0600 msi/tests: Add a test for creating MTA objects from a custom action. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msi/tests/Makefile.in | 2 +- dlls/msi/tests/custom.c | 42 ++++++++++++++++++++++++++++++++++++++++++ dlls/msi/tests/custom.spec | 1 + dlls/msi/tests/install.c | 30 +++++++++++++++++++++++++++++- 4 files changed, 73 insertions(+), 2 deletions(-) diff --git a/dlls/msi/tests/Makefile.in b/dlls/msi/tests/Makefile.in index 70080ea..9c991d6 100644 --- a/dlls/msi/tests/Makefile.in +++ b/dlls/msi/tests/Makefile.in @@ -1,7 +1,7 @@ TESTDLL = msi.dll IMPORTS = cabinet msi shell32 ole32 oleaut32 user32 advapi32 version -custom_IMPORTS = msi +custom_IMPORTS = uuid msi ole32 SOURCES = \ action.c \ diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c index d68d082..c00b7aa 100644 --- a/dlls/msi/tests/custom.c +++ b/dlls/msi/tests/custom.c @@ -23,9 +23,51 @@ #include <windef.h> #include <winbase.h> +#define COBJMACROS +#include <objbase.h> +#include <unknwn.h> #include <msi.h> #include <msiquery.h> +static void ok_(MSIHANDLE hinst, int todo, const char *file, int line, int condition, const char *msg, ...) +{ + static char buffer[2000]; + MSIHANDLE record; + va_list valist; + + va_start(valist, msg); + vsprintf(buffer, msg, valist); + va_end(valist); + + record = MsiCreateRecord(5); + MsiRecordSetInteger(record, 1, todo); + MsiRecordSetStringA(record, 2, file); + MsiRecordSetInteger(record, 3, line); + MsiRecordSetInteger(record, 4, condition); + MsiRecordSetStringA(record, 5, buffer); + MsiProcessMessage(hinst, INSTALLMESSAGE_USER, record); + MsiCloseHandle(record); +} +#define ok(hinst, condition, ...) ok_(hinst, 0, __FILE__, __LINE__, condition, __VA_ARGS__) +#define todo_wine_ok(hinst, condition, ...) ok_(hinst, 1, __FILE__, __LINE__, condition, __VA_ARGS__) + + +/* Main test. Anything that doesn't depend on a specific install configuration + * or have undesired side effects should go here. */ +UINT WINAPI main_test(MSIHANDLE hinst) +{ + IUnknown *unk = NULL; + HRESULT hres; + + /* Test for an MTA apartment */ + hres = CoCreateInstance(&CLSID_Picture_Metafile, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)&unk); + todo_wine_ok(hinst, hres == S_OK, "CoCreateInstance failed with %08x\n", hres); + + if (unk) IUnknown_Release(unk); + + return ERROR_SUCCESS; +} + UINT WINAPI test_retval(MSIHANDLE hinst) { char prop[10]; diff --git a/dlls/msi/tests/custom.spec b/dlls/msi/tests/custom.spec index 2a01b3d..9d1e821 100644 --- a/dlls/msi/tests/custom.spec +++ b/dlls/msi/tests/custom.spec @@ -1 +1,2 @@ +@ stdcall main_test(long) @ stdcall test_retval(long) diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c index 9ba4f07..55d83d4 100644 --- a/dlls/msi/tests/install.c +++ b/dlls/msi/tests/install.c @@ -695,11 +695,13 @@ static const CHAR wrv_component_dat[] = "Component\tComponentId\tDirectory_\tAtt static const CHAR ca1_install_exec_seq_dat[] = "Action\tCondition\tSequence\n" "s72\tS255\tI2\n" "InstallExecuteSequence\tAction\n" - "testretval\t\t710\n"; + "maintest\tMAIN_TEST\t700\n" + "testretval\tTEST_RETVAL\t710\n"; static const CHAR ca1_custom_action_dat[] = "Action\tType\tSource\tTarget\n" "s72\ti2\tS64\tS0\n" "CustomAction\tAction\n" + "maintest\t1\tcustom.dll\tmain_test\n" "testretval\t1\tcustom.dll\ttest_retval\n"; static const CHAR ca51_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n" @@ -4081,6 +4083,27 @@ static void add_custom_dll(void) MsiCloseHandle(hdb); } +static INT CALLBACK ok_callback(void *context, UINT message_type, MSIHANDLE record) +{ + if (message_type == INSTALLMESSAGE_USER) + { + char file[200]; + char msg[2000]; + DWORD len; + + len = sizeof(file); + MsiRecordGetStringA(record, 2, file, &len); + len = sizeof(msg); + MsiRecordGetStringA(record, 5, msg, &len); + + todo_wine_if(MsiRecordGetInteger(record, 1)) + ok_(file, MsiRecordGetInteger(record, 3)) (MsiRecordGetInteger(record, 4), "%s", msg); + + return 1; + } + return 0; +} + static void test_customaction1(void) { UINT r; @@ -4090,6 +4113,10 @@ static void test_customaction1(void) MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); + r = MsiInstallProductA(msifile, "MAIN_TEST=1"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + + /* Test return values */ r = MsiInstallProductA(msifile, "TEST_RETVAL=0"); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); @@ -6083,6 +6110,7 @@ START_TEST(install) MsiEnableLogA(INSTALLLOGMODE_FATALEXIT, log_file, 0); customdll = load_resource("custom.dll"); + MsiSetExternalUIRecord(ok_callback, INSTALLLOGMODE_USER, NULL, NULL); if (pSRSetRestorePointA) /* test has side-effects on win2k3 that cause failures in following tests */ test_MsiInstallProduct();
1
0
0
0
Zebediah Figura : msi/tests: Add tests for custom action return values.
by Alexandre Julliard
19 Feb '18
19 Feb '18
Module: wine Branch: master Commit: 6dcb3dabd4d540b65d68193d7037db748bcf7c4a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6dcb3dabd4d540b65d68193d…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Wed Feb 14 20:54:54 2018 -0600 msi/tests: Add tests for custom action return values. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msi/tests/Makefile.in | 6 ++- dlls/msi/tests/custom.c | 38 +++++++++++++++++ dlls/msi/tests/custom.spec | 1 + dlls/msi/tests/install.c | 100 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 144 insertions(+), 1 deletion(-) diff --git a/dlls/msi/tests/Makefile.in b/dlls/msi/tests/Makefile.in index 66f8abb..70080ea 100644 --- a/dlls/msi/tests/Makefile.in +++ b/dlls/msi/tests/Makefile.in @@ -1,9 +1,13 @@ TESTDLL = msi.dll IMPORTS = cabinet msi shell32 ole32 oleaut32 user32 advapi32 version -C_SRCS = \ +custom_IMPORTS = msi + +SOURCES = \ action.c \ automation.c \ + custom.c \ + custom.spec \ db.c \ format.c \ install.c \ diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c new file mode 100644 index 0000000..d68d082 --- /dev/null +++ b/dlls/msi/tests/custom.c @@ -0,0 +1,38 @@ +/* + * DLL for testing type 1 custom actions + * + * Copyright 2017 Zebediah Figura + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <stdarg.h> +#include <stdio.h> + +#include <windef.h> +#include <winbase.h> +#include <msi.h> +#include <msiquery.h> + +UINT WINAPI test_retval(MSIHANDLE hinst) +{ + char prop[10]; + DWORD len = sizeof(prop); + UINT retval; + + MsiGetPropertyA(hinst, "TEST_RETVAL", prop, &len); + sscanf(prop, "%u", &retval); + return retval; +} diff --git a/dlls/msi/tests/custom.spec b/dlls/msi/tests/custom.spec new file mode 100644 index 0000000..2a01b3d --- /dev/null +++ b/dlls/msi/tests/custom.spec @@ -0,0 +1 @@ +@ stdcall test_retval(long) diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c index acbf162..9ba4f07 100644 --- a/dlls/msi/tests/install.c +++ b/dlls/msi/tests/install.c @@ -70,6 +70,8 @@ static CHAR COMMON_FILES_DIR[MAX_PATH]; static CHAR APP_DATA_DIR[MAX_PATH]; static CHAR WINDOWS_DIR[MAX_PATH]; +static const char *customdll; + /* msi database data */ static const CHAR component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n" @@ -690,6 +692,16 @@ static const CHAR wrv_component_dat[] = "Component\tComponentId\tDirectory_\tAtt "Component\tComponent\n" "augustus\t\tMSITESTDIR\t0\t\taugustus\n"; +static const CHAR ca1_install_exec_seq_dat[] = "Action\tCondition\tSequence\n" + "s72\tS255\tI2\n" + "InstallExecuteSequence\tAction\n" + "testretval\t\t710\n"; + +static const CHAR ca1_custom_action_dat[] = "Action\tType\tSource\tTarget\n" + "s72\ti2\tS64\tS0\n" + "CustomAction\tAction\n" + "testretval\t1\tcustom.dll\ttest_retval\n"; + static const CHAR ca51_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n" "s72\tS38\ts72\ti2\tS255\tS72\n" "Component\tComponent\n" @@ -1683,6 +1695,13 @@ static const msi_table sf_tables[] = ADD_TABLE(property), }; +static const msi_table ca1_tables[] = +{ + ADD_TABLE(property), + ADD_TABLE(ca1_install_exec_seq), + ADD_TABLE(ca1_custom_action), +}; + static const msi_table ca51_tables[] = { ADD_TABLE(ca51_component), @@ -2589,6 +2608,29 @@ static LONG delete_key( HKEY key, LPCSTR subkey, REGSAM access ) return RegDeleteKeyA( key, subkey ); } +static char *load_resource(const char *name) +{ + static char path[MAX_PATH]; + DWORD written; + HANDLE file; + HRSRC res; + void *ptr; + + GetTempFileNameA(".", name, 0, path); + + file = CreateFileA(path, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0); + ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %d\n", path, GetLastError()); + + res = FindResourceA(NULL, name, "TESTDLL"); + ok( res != 0, "couldn't find resource\n" ); + ptr = LockResource( LoadResource( GetModuleHandleA(NULL), res )); + WriteFile( file, ptr, SizeofResource( GetModuleHandleA(NULL), res ), &written, NULL ); + ok( written == SizeofResource( GetModuleHandleA(NULL), res ), "couldn't write resource\n" ); + CloseHandle( file ); + + return path; +} + static void test_MsiInstallProduct(void) { UINT r; @@ -4014,6 +4056,59 @@ error: DeleteFileA("augustus"); } +static void add_custom_dll(void) +{ + MSIHANDLE hdb = 0, record; + UINT res; + + res = MsiOpenDatabaseW(msifileW, MSIDBOPEN_TRANSACT, &hdb); + ok(res == ERROR_SUCCESS, "failed to open db: %u\n", res); + + res = run_query(hdb, 0, "CREATE TABLE `Binary` (`Name` CHAR(72) NOT NULL, `Data` OBJECT NOT NULL PRIMARY KEY `Name`)"); + ok(res == ERROR_SUCCESS, "failed to create Binary table: %u\n", res); + + record = MsiCreateRecord(1); + res = MsiRecordSetStreamA(record, 1, customdll); + ok(res == ERROR_SUCCESS, "failed to add %s to stream: %u\n", customdll, res); + + res = run_query(hdb, record, "INSERT INTO `Binary` (`Name`, `Data`) VALUES ('custom.dll', ?)"); + ok(res == ERROR_SUCCESS, "failed to insert into Binary table: %u\n", res); + + res = MsiDatabaseCommit(hdb); + ok(res == ERROR_SUCCESS, "failed to commit database: %u\n", res); + + MsiCloseHandle(record); + MsiCloseHandle(hdb); +} + +static void test_customaction1(void) +{ + UINT r; + + create_database(msifile, ca1_tables, sizeof(ca1_tables) / sizeof(msi_table)); + add_custom_dll(); + + MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); + + r = MsiInstallProductA(msifile, "TEST_RETVAL=0"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + + r = MsiInstallProductA(msifile, "TEST_RETVAL=1626"); /* ERROR_FUNCTION_NOT_CALLED*/ + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + + r = MsiInstallProductA(msifile, "TEST_RETVAL=1602"); + ok(r == ERROR_INSTALL_USEREXIT, "Expected ERROR_INSTALL_USEREXIT, got %u\n", r); + + r = MsiInstallProductA(msifile, "TEST_RETVAL=259"); /* ERROR_NO_MORE_ITEMS */ + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + + /* any other error maps to ERROR_INSTALL_FAILURE */ + r = MsiInstallProductA(msifile, "TEST_RETVAL=1"); + ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r); + + DeleteFileA(msifile); +} + static void test_customaction51(void) { UINT r; @@ -5987,6 +6082,8 @@ START_TEST(install) lstrcatA(log_file, "\\msitest.log"); MsiEnableLogA(INSTALLLOGMODE_FATALEXIT, log_file, 0); + customdll = load_resource("custom.dll"); + if (pSRSetRestorePointA) /* test has side-effects on win2k3 that cause failures in following tests */ test_MsiInstallProduct(); test_MsiSetComponentState(); @@ -6006,6 +6103,7 @@ START_TEST(install) test_adminprops(); test_missingcab(); test_sourcefolder(); + test_customaction1(); test_customaction51(); test_installstate(); test_sourcepath(); @@ -6031,6 +6129,8 @@ START_TEST(install) test_feature_tree(); test_deferred_action(); + DeleteFileA(customdll); + DeleteFileA(log_file); if (pSRSetRestorePointA && !pMsiGetComponentPathExA && ret)
1
0
0
0
Alexandre Julliard : makefiles: Add support for creating helper dlls in tests.
by Alexandre Julliard
19 Feb '18
19 Feb '18
Module: wine Branch: master Commit: 2435357d60d2236fea5f8ccd529a5130c65591dc URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2435357d60d2236fea5f8ccd…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Sat Feb 17 11:46:25 2018 +0100 makefiles: Add support for creating helper dlls in tests. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/make_makefiles | 4 +++ tools/makedep.c | 98 +++++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 89 insertions(+), 13 deletions(-) diff --git a/tools/make_makefiles b/tools/make_makefiles index a3f19d8..0cf2344 100755 --- a/tools/make_makefiles +++ b/tools/make_makefiles @@ -431,6 +431,10 @@ sub assign_sources_to_makefiles(@) { push @{${$make}{"=IN_SRCS"}}, $name; } + elsif ($name =~ /\.spec$/) + { + next unless defined ${$make}{"TESTDLL"}; + } else { next; diff --git a/tools/makedep.c b/tools/makedep.c index 0db2733..0083661 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -2685,20 +2685,96 @@ static void output_source_in( struct makefile *make, struct incl_file *source, c /******************************************************************* + * output_source_spec + */ +static void output_source_spec( struct makefile *make, struct incl_file *source, const char *obj ) +{ + struct strarray imports = get_expanded_file_local_var( make, obj, "IMPORTS" ); + struct strarray all_libs, dep_libs = empty_strarray; + + if (!imports.count) imports = make->imports; + all_libs = add_import_libs( make, &dep_libs, imports, 0 ); + add_import_libs( make, &dep_libs, get_default_imports( make ), 0 ); /* dependencies only */ + strarray_addall( &all_libs, libs ); + + strarray_add( &make->clean_files, strmake( "%s.dll%s", obj, dll_ext )); + strarray_add( &make->object_files, strmake( "%s.res", obj )); + output( "%s.res: %s.dll%s\n", obj_dir_path( make, obj ), obj_dir_path( make, obj ), dll_ext ); + output( "\techo \"%s.dll TESTDLL \\\"%s.dll%s\\\"\" | %s -o $@\n", obj, + obj_dir_path( make, obj ), dll_ext, tools_path( make, "wrc" )); + + output( "%s.dll%s:", obj_dir_path( make, obj ), dll_ext ); + output_filename( source->filename ); + output_filename( strmake( "%s.o", obj_dir_path( make, obj ))); + output_filenames( dep_libs ); + output_filename( tools_path( make, "winebuild" )); + output_filename( tools_path( make, "winegcc" )); + output( "\n" ); + output( "\t%s -s -o $@", tools_path( make, "winegcc" )); + output_filename( strmake( "-B%s", tools_dir_path( make, "winebuild" ))); + if (tools_dir) output_filename( strmake( "--sysroot=%s", top_obj_dir_path( make, "" ))); + output_filenames( target_flags ); + output_filenames( unwind_flags ); + output_filenames( make->extradllflags ); + output_filename( "-shared" ); + output_filename( source->filename ); + output_filename( strmake( "%s.o", obj_dir_path( make, obj ))); + output_filenames( all_libs ); + output_filename( "$(LDFLAGS)" ); + output( "\n" ); + + if (crosstarget) + { + dep_libs = empty_strarray; + all_libs = add_import_libs( make, &dep_libs, imports, 1 ); + add_import_libs( make, &dep_libs, get_default_imports( make ), 1 ); /* dependencies only */ + strarray_addall( &all_libs, libs ); + + strarray_add( &make->clean_files, strmake( "%s.dll", obj )); + strarray_add( &make->crossobj_files, strmake( "%s.cross.res", obj )); + output( "%s.cross.res: %s.dll\n", obj_dir_path( make, obj ), obj_dir_path( make, obj ) ); + output( "\techo \"%s.dll TESTDLL \\\"%s.dll\\\"\" | %s -o $@\n", obj, + obj_dir_path( make, obj ), tools_path( make, "wrc" )); + + output( "%s.dll:", obj_dir_path( make, obj )); + output_filename( source->filename ); + output_filename( strmake( "%s.cross.o", obj_dir_path( make, obj ))); + output_filenames( dep_libs ); + output_filename( tools_path( make, "winebuild" )); + output_filename( tools_path( make, "winegcc" )); + output( "\n" ); + output( "\t%s -s -o $@ -b %s", tools_path( make, "winegcc" ), crosstarget ); + output_filename( strmake( "-B%s", tools_dir_path( make, "winebuild" ))); + if (tools_dir) output_filename( strmake( "--sysroot=%s", top_obj_dir_path( make, "" ))); + output_filename( "--lib-suffix=.cross.a" ); + output_filename( "-shared" ); + output_filename( source->filename ); + output_filename( strmake( "%s.cross.o", obj_dir_path( make, obj ))); + output_filenames( all_libs ); + output_filename( "$(LDFLAGS)" ); + output( "\n" ); + } +} + + +/******************************************************************* * output_source_default */ static void output_source_default( struct makefile *make, struct incl_file *source, const char *obj ) { struct strarray extradefs = get_expanded_file_local_var( make, obj, "EXTRADEFS" ); - int need_cross = make->testdll || - (source->file->flags & FLAG_C_IMPLIB) || - (make->module && make->staticlib); + int is_dll_src = (make->testdll && + strendswith( source->name, ".c" ) && + find_src_file( make, replace_extension( source->name, ".c", ".spec" ))); + int need_cross = (make->testdll || + (source->file->flags & FLAG_C_IMPLIB) || + (make->module && make->staticlib)); if ((source->file->flags & FLAG_GENERATED) && (!make->testdll || !strendswith( source->filename, "testlist.c" ))) strarray_add( &make->clean_files, source->filename ); if (source->file->flags & FLAG_C_IMPLIB) strarray_add( &make->implib_objs, strmake( "%s.o", obj )); - strarray_add( &make->object_files, strmake( "%s.o", obj )); + strarray_add( is_dll_src ? &make->clean_files : &make->object_files, strmake( "%s.o", obj )); output( "%s.o: %s\n", obj_dir_path( make, obj ), source->filename ); output( "\t$(CC) -c -o $@ %s", source->filename ); output_filenames( make->include_args ); @@ -2715,7 +2791,7 @@ static void output_source_default( struct makefile *make, struct incl_file *sour output( "\n" ); if (crosstarget && need_cross) { - strarray_add( &make->crossobj_files, strmake( "%s.cross.o", obj )); + strarray_add( is_dll_src ? &make->clean_files : &make->crossobj_files, strmake( "%s.cross.o", obj )); output( "%s.cross.o: %s\n", obj_dir_path( make, obj ), source->filename ); output( "\t$(CROSSCC) -c -o $@ %s", source->filename ); output_filenames( make->include_args ); @@ -2730,7 +2806,7 @@ static void output_source_default( struct makefile *make, struct incl_file *sour if (strendswith( source->name, ".c" ) && !(source->file->flags & FLAG_GENERATED)) { strarray_add( &make->c2man_files, source->filename ); - if (make->testdll) + if (make->testdll && !is_dll_src) { strarray_add( &make->ok_files, strmake( "%s.ok", obj )); output( "%s.ok:\n", obj_dir_path( make, obj )); @@ -2770,6 +2846,7 @@ static const struct { "po", output_source_po }, { "in", output_source_in }, { "x", output_source_x }, + { "spec", output_source_spec }, { NULL, output_source_default } }; @@ -3453,15 +3530,10 @@ static void output_testlist( const struct makefile *make ) { const char *dest = base_dir_path( make, "testlist.c" ); struct strarray files = empty_strarray; - struct incl_file *source; unsigned int i; - LIST_FOR_EACH_ENTRY( source, &make->sources, struct incl_file, entry ) - { - if (source->file->flags & FLAG_GENERATED) continue; - if (!strendswith( source->name, ".c" )) continue; - strarray_add( &files, replace_extension( source->name, ".c", "" )); - } + for (i = 0; i < make->ok_files.count; i++) + strarray_add( &files, replace_extension( make->ok_files.str[i], ".ok", "" )); output_file = create_temp_file( dest );
1
0
0
0
Alexandre Julliard : makefiles: Add support for a generic SOURCES variable.
by Alexandre Julliard
19 Feb '18
19 Feb '18
Module: wine Branch: master Commit: 54a123f4ef96d554180ccce1f69eb71726da1c5e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=54a123f4ef96d554180ccce1…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Sat Feb 17 11:39:05 2018 +0100 makefiles: Add support for a generic SOURCES variable. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/Makefile.in | 444 +++++++++++++++++++++++++-------------------------- tools/make_makefiles | 29 ++-- tools/makedep.c | 1 + 3 files changed, 239 insertions(+), 235 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=54a123f4ef96d554180c…
1
0
0
0
Alexandre Julliard : makefiles: Split the makefile generation into multiple functions.
by Alexandre Julliard
19 Feb '18
19 Feb '18
Module: wine Branch: master Commit: 4eb9ad983ecc33d24ccf68692590605dcd02914a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4eb9ad983ecc33d24ccf6869…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Sat Feb 17 09:53:42 2018 +0100 makefiles: Split the makefile generation into multiple functions. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/makedep.c | 1617 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 889 insertions(+), 728 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=4eb9ad983ecc33d24ccf…
1
0
0
0
Francois Gouget : testbot: Add some traces to help diagnose scheduler issues.
by Alexandre Julliard
19 Feb '18
19 Feb '18
Module: tools Branch: master Commit: b8967f23d80d84311decba77b3febc76385566b9 URL:
https://source.winehq.org/git/tools.git/?a=commit;h=b8967f23d80d84311decba7…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Mon Feb 19 04:25:14 2018 +0100 testbot: Add some traces to help diagnose scheduler issues. Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- testbot/lib/WineTestBot/Jobs.pm | 59 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/testbot/lib/WineTestBot/Jobs.pm b/testbot/lib/WineTestBot/Jobs.pm index 0362221..9a0f8bc 100644 --- a/testbot/lib/WineTestBot/Jobs.pm +++ b/testbot/lib/WineTestBot/Jobs.pm @@ -1012,6 +1012,63 @@ sub _SacrificeVM($$$) return 1; } +sub _DumpHostCounters($$) +{ + my ($Sched, $VM) = @_; + my $Host = _GetSchedHost($Sched, $VM); + return if ($Host->{dumpedcounters}); + + my $Counters = ""; + if ($Host->{active}) + { + $Counters .= " active=$Host->{active}/$Host->{MaxActiveVMs}"; + } + if ($Host->{idle}) + { + $Counters .= " idle=$Host->{idle}". ($Host->{queued} ? "" : "/$Host->{MaxVMsWhenIdle}"); + } + if ($Host->{reverting}) + { + $Counters .= " reverting=$Host->{reverting}/". _GetMaxReverts($Host); + } + for my $Counter ("sleeping", "running", "dirty", "queued") + { + $Counters .= " $Counter=$Host->{$Counter}" if ($Host->{$Counter}); + } + my $HostKey = $VM->GetHost(); + my $PrettyHost = ($PrettyHostNames ? $PrettyHostNames->{$HostKey} : "") || + $HostKey; + require WineTestBot::Log; + WineTestBot::Log::LogMsg("$PrettyHost:$Counters\n") if ($Counters); + + $Host->{dumpedcounters} = 1; +} + +sub _DumpHostVMs($$$$) +{ + my ($Sched, $VM, $SortedNeededVMs, $NeededVMs) = @_; + my $Host = _GetSchedHost($Sched, $VM); + return if ($Host->{dumpedvms}); + + _DumpHostCounters($Sched, $VM); + + my @VMInfo; + my $HostKey = $VM->GetHost(); + foreach my $VMKey (@$SortedNeededVMs) + { + $VM = $Sched->{VMs}->GetItem($VMKey); + next if ($VM->GetHost() ne $HostKey); + + push @VMInfo, join(":", "$VMKey(". $VM->Status .")", $NeededVMs->{$VMKey}->[0], $NeededVMs->{$VMKey}->[1], $NeededVMs->{$VMKey}->[2]); + } + my $PrettyHost = ($PrettyHostNames ? $PrettyHostNames->{$HostKey} : "") || + $HostKey; + require WineTestBot::Log; + WineTestBot::Log::LogMsg("$PrettyHost: @VMInfo\n"); + + $Host->{dumpedvms} = 1; +} + sub _RevertVMs($$) { my ($Sched, $NeededVMs) = @_; @@ -1027,6 +1084,7 @@ sub _RevertVMs($$) # Check if the host has reached its reverting VMs limit my $Host = _GetSchedHost($Sched, $VM); next if ($Host->{reverting} >= _GetMaxReverts($Host)); + _DumpHostCounters($Sched, $VM); # Skip this VM if the previous step's tasks are not about to run yet next if (_HasMissingDependencies($Sched, $NeededVMs, $VMKey)); @@ -1071,6 +1129,7 @@ sub _RevertVMs($$) $NeedsSacrifice = ($FutureActive > $Host->{MaxActiveVMs}); } + _DumpHostVMs($Sched, $VM, \@SortedNeededVMs, $NeededVMs); if ($NeedsSacrifice) { # Find an active VM to sacrifice so we can revert this VM in the next
1
0
0
0
← Newer
1
...
29
30
31
32
33
34
35
...
81
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
Results per page:
10
25
50
100
200