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
July
June
May
April
March
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
September 2023
----- 2025 -----
July 2025
June 2025
May 2025
April 2025
March 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
1 participants
920 discussions
Start a n
N
ew thread
Connor McAdams : uiautomationcore: Check providers for an IProxyProviderWinEventHandler interface when attaching events.
by Alexandre Julliard
25 Sep '23
25 Sep '23
Module: wine Branch: master Commit: 336503f3c9c840ffe623e052729491e2a5fa596f URL:
https://gitlab.winehq.org/wine/wine/-/commit/336503f3c9c840ffe623e052729491…
Author: Connor McAdams <cmcadams(a)codeweavers.com> Date: Wed Aug 2 13:05:58 2023 -0400 uiautomationcore: Check providers for an IProxyProviderWinEventHandler interface when attaching events. Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> --- dlls/uiautomationcore/tests/uiautomation.c | 16 ++++++++-------- dlls/uiautomationcore/uia_client.c | 17 ++++++++++++----- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/dlls/uiautomationcore/tests/uiautomation.c b/dlls/uiautomationcore/tests/uiautomation.c index 89757e2eb84..98990d3b19c 100644 --- a/dlls/uiautomationcore/tests/uiautomation.c +++ b/dlls/uiautomationcore/tests/uiautomation.c @@ -16812,8 +16812,8 @@ static DWORD WINAPI uia_proxy_provider_win_event_handler_test_thread(LPVOID para set_uia_hwnd_expects(1, 1, 1, 2, 0); hr = UiaEventAddWindow(event, hwnd[0]); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - test_provider_event_advise_added(&Provider_hwnd2, 0, TRUE); - test_provider_event_advise_added(&Provider_nc2, 0, TRUE); + test_provider_event_advise_added(&Provider_hwnd2, 0, FALSE); + test_provider_event_advise_added(&Provider_nc2, 0, FALSE); check_uia_hwnd_expects_at_least(1, TRUE, 1, FALSE, 1, FALSE, 1, FALSE, 0, FALSE); /* @@ -16982,9 +16982,9 @@ static DWORD WINAPI uia_proxy_provider_win_event_handler_test_thread(LPVOID para hr = UiaAddEvent(node, UIA_AutomationFocusChangedEventId, uia_event_callback, TreeScope_Element, NULL, 0, &cache_req, &event); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - test_provider_event_advise_added(&Provider_proxy, 0, TRUE); - test_provider_event_advise_added(&Provider_hwnd, 0, TRUE); - test_provider_event_advise_added(&Provider_nc, 0, TRUE); + test_provider_event_advise_added(&Provider_proxy, 0, FALSE); + test_provider_event_advise_added(&Provider_hwnd, 0, FALSE); + test_provider_event_advise_added(&Provider_nc, 0, FALSE); /* Raise WinEvent on the desktop HWND. */ set_provider_runtime_id(&Provider_child, UIA_RUNTIME_ID_PREFIX, HandleToUlong(GetDesktopWindow())); @@ -17026,9 +17026,9 @@ static DWORD WINAPI uia_proxy_provider_win_event_handler_test_thread(LPVOID para hr = UiaAddEvent(node, UIA_AutomationFocusChangedEventId, uia_event_callback, TreeScope_Element, NULL, 0, &cache_req, &event); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - test_provider_event_advise_added(&Provider_hwnd, 0, TRUE); - test_provider_event_advise_added(&Provider_nc, 0, TRUE); - test_provider_event_advise_added(&Provider_proxy, 0, TRUE); + test_provider_event_advise_added(&Provider_hwnd, 0, FALSE); + test_provider_event_advise_added(&Provider_nc, 0, FALSE); + test_provider_event_advise_added(&Provider_proxy, 0, FALSE); /* WinEvent handled. */ set_uia_hwnd_expects(1, 1, 1, 2, 1); diff --git a/dlls/uiautomationcore/uia_client.c b/dlls/uiautomationcore/uia_client.c index 57d1ca812f7..6ec675e197e 100644 --- a/dlls/uiautomationcore/uia_client.c +++ b/dlls/uiautomationcore/uia_client.c @@ -1835,7 +1835,7 @@ static HRESULT WINAPI uia_provider_attach_event(IWineUiaProvider *iface, LONG_PT { struct uia_provider *prov = impl_from_IWineUiaProvider(iface); struct uia_event *event = (struct uia_event *)huiaevent; - IRawElementProviderFragmentRoot *elroot; + IRawElementProviderFragmentRoot *elroot = NULL; IRawElementProviderFragment *elfrag; SAFEARRAY *embedded_roots = NULL; HRESULT hr; @@ -1863,12 +1863,17 @@ static HRESULT WINAPI uia_provider_attach_event(IWineUiaProvider *iface, LONG_PT if (elroot) { + IProxyProviderWinEventHandler *winevent_handler; IRawElementProviderAdviseEvents *advise_events; - hr = IRawElementProviderFragmentRoot_QueryInterface(elroot, &IID_IRawElementProviderAdviseEvents, - (void **)&advise_events); - IRawElementProviderFragmentRoot_Release(elroot); - if (SUCCEEDED(hr)) + if (!prov->return_nested_node && SUCCEEDED(IRawElementProviderFragmentRoot_QueryInterface(elroot, + &IID_IProxyProviderWinEventHandler, (void **)&winevent_handler))) + { + FIXME("MSAA to UIA event bridge currently unimplemented\n"); + IProxyProviderWinEventHandler_Release(winevent_handler); + } + else if (SUCCEEDED(IRawElementProviderFragmentRoot_QueryInterface(elroot, &IID_IRawElementProviderAdviseEvents, + (void **)&advise_events))) { hr = uia_event_add_provider_event_adviser(advise_events, event); IRawElementProviderAdviseEvents_Release(advise_events); @@ -1918,6 +1923,8 @@ static HRESULT WINAPI uia_provider_attach_event(IWineUiaProvider *iface, LONG_PT } exit: + if (elroot) + IRawElementProviderFragmentRoot_Release(elroot); IRawElementProviderFragment_Release(elfrag); SafeArrayDestroy(embedded_roots);
1
0
0
0
Connor McAdams : uiautomationcore/tests: Add tests for IProxyProviderWinEventHandler based MSAA to UIA event bridging.
by Alexandre Julliard
25 Sep '23
25 Sep '23
Module: wine Branch: master Commit: 87af89cb3b008e35f1b618dcf694e8a97ad7023f URL:
https://gitlab.winehq.org/wine/wine/-/commit/87af89cb3b008e35f1b618dcf694e8…
Author: Connor McAdams <cmcadams(a)codeweavers.com> Date: Tue Jul 18 12:33:54 2023 -0400 uiautomationcore/tests: Add tests for IProxyProviderWinEventHandler based MSAA to UIA event bridging. Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> --- dlls/uiautomationcore/tests/uiautomation.c | 673 ++++++++++++++++++++++++++++- 1 file changed, 654 insertions(+), 19 deletions(-)
1
0
0
0
Mohamad Al-Jaf : windows.applicationmodel: Implement IStorageItem::get_Path().
by Alexandre Julliard
25 Sep '23
25 Sep '23
Module: wine Branch: master Commit: ed2bfd4ad7561d4480ed4309f5b30e933a2b53e5 URL:
https://gitlab.winehq.org/wine/wine/-/commit/ed2bfd4ad7561d4480ed4309f5b30e…
Author: Mohamad Al-Jaf <mohamadaljaf(a)gmail.com> Date: Thu Feb 23 00:17:09 2023 -0500 windows.applicationmodel: Implement IStorageItem::get_Path(). Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=52665
--- dlls/windows.applicationmodel/Makefile.in | 2 +- dlls/windows.applicationmodel/package.c | 13 +++++++++++-- dlls/windows.applicationmodel/tests/application.c | 8 ++++---- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/dlls/windows.applicationmodel/Makefile.in b/dlls/windows.applicationmodel/Makefile.in index 7404721796e..ca0d03b0b23 100644 --- a/dlls/windows.applicationmodel/Makefile.in +++ b/dlls/windows.applicationmodel/Makefile.in @@ -1,5 +1,5 @@ MODULE = windows.applicationmodel.dll -IMPORTS = combase +IMPORTS = combase kernelbase C_SRCS = \ main.c \ diff --git a/dlls/windows.applicationmodel/package.c b/dlls/windows.applicationmodel/package.c index 66ea1b728c9..5d5518848ed 100644 --- a/dlls/windows.applicationmodel/package.c +++ b/dlls/windows.applicationmodel/package.c @@ -20,6 +20,8 @@ #include "private.h" #include "wine/debug.h" +#include "pathcch.h" + WINE_DEFAULT_DEBUG_CHANNEL(model); struct package_statics @@ -320,8 +322,15 @@ static HRESULT WINAPI storage_item_get_Name( IStorageItem *iface, HSTRING *value static HRESULT WINAPI storage_item_get_Path( IStorageItem *iface, HSTRING *value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + WCHAR buffer[MAX_PATH]; + HRESULT hr; + + TRACE( "iface %p, value %p\n", iface, value ); + + if (!GetModuleFileNameW( NULL, buffer, MAX_PATH )) return HRESULT_FROM_WIN32( GetLastError() ); + if (FAILED( hr = PathCchRemoveFileSpec( buffer, ARRAY_SIZE(buffer) ) )) return hr; + + return WindowsCreateString( buffer, wcslen(buffer), value ); } static HRESULT WINAPI storage_item_get_Attributes( IStorageItem *iface, FileAttributes *value ) diff --git a/dlls/windows.applicationmodel/tests/application.c b/dlls/windows.applicationmodel/tests/application.c index 44ae82533d7..426d0d526a0 100644 --- a/dlls/windows.applicationmodel/tests/application.c +++ b/dlls/windows.applicationmodel/tests/application.c @@ -111,15 +111,15 @@ static void test_PackageStatics(void) ok( hr == S_OK, "got hr %#lx.\n", hr ); hr = IStorageItem_get_Path( storage_item, &str ); - todo_wine ok( hr == S_OK, "got hr %#lx.\n", hr ); + ok( hr == S_OK, "got hr %#lx.\n", hr ); GetModuleFileNameW( NULL, buffer, MAX_PATH ); hr = PathCchRemoveFileSpec( buffer, ARRAY_SIZE(buffer) ); - todo_wine ok( hr == S_OK, "got hr %#lx.\n", hr ); + ok( hr == S_OK, "got hr %#lx.\n", hr ); hr = WindowsCreateString( buffer, wcslen(buffer), &wine_str ); ok( hr == S_OK, "got hr %#lx.\n", hr ); hr = WindowsCompareStringOrdinal( str, wine_str, &res ); - todo_wine ok( hr == S_OK, "got hr %#lx.\n", hr ); - todo_wine ok( !res, "got string %s.\n", debugstr_hstring(str) ); + ok( hr == S_OK, "got hr %#lx.\n", hr ); + ok( !res, "got string %s.\n", debugstr_hstring(str) ); WindowsDeleteString( str ); WindowsDeleteString( wine_str );
1
0
0
0
Mohamad Al-Jaf : windows.applicationmodel/tests: Add IStorageItem::get_Path() tests.
by Alexandre Julliard
25 Sep '23
25 Sep '23
Module: wine Branch: master Commit: a7fa496b4bb46e0e2a099ee4f8600840e49bcf2a URL:
https://gitlab.winehq.org/wine/wine/-/commit/a7fa496b4bb46e0e2a099ee4f86008…
Author: Mohamad Al-Jaf <mohamadaljaf(a)gmail.com> Date: Fri Aug 11 01:06:32 2023 -0400 windows.applicationmodel/tests: Add IStorageItem::get_Path() tests. --- dlls/windows.applicationmodel/tests/Makefile.in | 2 +- dlls/windows.applicationmodel/tests/application.c | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/dlls/windows.applicationmodel/tests/Makefile.in b/dlls/windows.applicationmodel/tests/Makefile.in index ba41bd7be94..9289fe0bc8c 100644 --- a/dlls/windows.applicationmodel/tests/Makefile.in +++ b/dlls/windows.applicationmodel/tests/Makefile.in @@ -1,5 +1,5 @@ TESTDLL = windows.applicationmodel.dll -IMPORTS = combase advapi32 +IMPORTS = combase advapi32 kernelbase application_EXTRADLLFLAGS = -mconsole diff --git a/dlls/windows.applicationmodel/tests/application.c b/dlls/windows.applicationmodel/tests/application.c index a011b50d2de..44ae82533d7 100644 --- a/dlls/windows.applicationmodel/tests/application.c +++ b/dlls/windows.applicationmodel/tests/application.c @@ -28,6 +28,7 @@ #include "winbase.h" #include "initguid.h" #include "winstring.h" +#include "pathcch.h" #include "roapi.h" @@ -61,9 +62,11 @@ static void test_PackageStatics(void) IStorageFolder *storage_folder; IActivationFactory *factory; IStorageItem *storage_item; + WCHAR buffer[MAX_PATH]; + HSTRING str, wine_str; IPackage *package; - HSTRING str; HRESULT hr; + INT32 res; LONG ref; hr = WindowsCreateString( package_statics_name, wcslen( package_statics_name ), &str ); @@ -107,6 +110,19 @@ static void test_PackageStatics(void) hr = IStorageFolder_QueryInterface( storage_folder, &IID_IStorageItem, (void **)&storage_item ); ok( hr == S_OK, "got hr %#lx.\n", hr ); + hr = IStorageItem_get_Path( storage_item, &str ); + todo_wine ok( hr == S_OK, "got hr %#lx.\n", hr ); + GetModuleFileNameW( NULL, buffer, MAX_PATH ); + hr = PathCchRemoveFileSpec( buffer, ARRAY_SIZE(buffer) ); + todo_wine ok( hr == S_OK, "got hr %#lx.\n", hr ); + hr = WindowsCreateString( buffer, wcslen(buffer), &wine_str ); + ok( hr == S_OK, "got hr %#lx.\n", hr ); + hr = WindowsCompareStringOrdinal( str, wine_str, &res ); + todo_wine ok( hr == S_OK, "got hr %#lx.\n", hr ); + todo_wine ok( !res, "got string %s.\n", debugstr_hstring(str) ); + WindowsDeleteString( str ); + WindowsDeleteString( wine_str ); + ref = IStorageItem_Release( storage_item ); ok( ref == 1, "got ref %ld.\n", ref ); ref = IStorageFolder_Release( storage_folder );
1
0
0
0
Mohamad Al-Jaf : windows.applicationmodel: Add IStorageItem stub interface.
by Alexandre Julliard
25 Sep '23
25 Sep '23
Module: wine Branch: master Commit: 8d3ef2bb85ab4b98f9215de3ac1bb93a69a39837 URL:
https://gitlab.winehq.org/wine/wine/-/commit/8d3ef2bb85ab4b98f9215de3ac1bb9…
Author: Mohamad Al-Jaf <mohamadaljaf(a)gmail.com> Date: Wed Feb 22 23:42:52 2023 -0500 windows.applicationmodel: Add IStorageItem stub interface. Needed for Minecraft Windows 10. --- dlls/windows.applicationmodel/package.c | 93 +++++++++++++++++++++++ dlls/windows.applicationmodel/tests/application.c | 6 ++ 2 files changed, 99 insertions(+) diff --git a/dlls/windows.applicationmodel/package.c b/dlls/windows.applicationmodel/package.c index cb464aed2c1..66ea1b728c9 100644 --- a/dlls/windows.applicationmodel/package.c +++ b/dlls/windows.applicationmodel/package.c @@ -118,6 +118,7 @@ static const struct IActivationFactoryVtbl factory_vtbl = struct storage_folder { IStorageFolder IStorageFolder_iface; + IStorageItem IStorageItem_iface; LONG ref; }; @@ -141,6 +142,13 @@ static HRESULT WINAPI storage_folder_QueryInterface( IStorageFolder *iface, REFI return S_OK; } + if (IsEqualGUID( iid, &IID_IStorageItem )) + { + *out = &impl->IStorageItem_iface; + IInspectable_AddRef( *out ); + return S_OK; + } + FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); *out = NULL; return E_NOINTERFACE; @@ -272,6 +280,90 @@ static const struct IStorageFolderVtbl storage_folder_vtbl = storage_folder_GetItemsAsyncOverloadDefaultStartAndCount, }; +DEFINE_IINSPECTABLE( storage_item, IStorageItem, struct storage_folder, IStorageFolder_iface ) + +static HRESULT WINAPI storage_item_RenameAsyncOverloadDefaultOptions( IStorageItem *iface, HSTRING name, IAsyncAction **operation ) +{ + FIXME( "iface %p, name %s, operation %p stub!\n", iface, debugstr_hstring(name), operation ); + return E_NOTIMPL; +} + +static HRESULT WINAPI storage_item_RenameAsync( IStorageItem *iface, HSTRING name, NameCollisionOption option, IAsyncAction **operation ) +{ + FIXME( "iface %p, name %s, option %d, operation %p stub!\n", iface, debugstr_hstring(name), option, operation ); + return E_NOTIMPL; +} + +static HRESULT WINAPI storage_item_DeleteAsyncOverloadDefaultOptions( IStorageItem *iface, IAsyncAction **operation ) +{ + FIXME( "iface %p, operation %p stub!\n", iface, operation ); + return E_NOTIMPL; +} + +static HRESULT WINAPI storage_item_DeleteAsync( IStorageItem *iface, StorageDeleteOption option, IAsyncAction **operation ) +{ + FIXME( "iface %p, option %d, operation %p stub!\n", iface, option, operation ); + return E_NOTIMPL; +} + +static HRESULT WINAPI storage_item_GetBasicPropertiesAsync( IStorageItem *iface, IAsyncOperation_BasicProperties **operation ) +{ + FIXME( "iface %p, operation %p stub!\n", iface, operation ); + return E_NOTIMPL; +} + +static HRESULT WINAPI storage_item_get_Name( IStorageItem *iface, HSTRING *value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static HRESULT WINAPI storage_item_get_Path( IStorageItem *iface, HSTRING *value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static HRESULT WINAPI storage_item_get_Attributes( IStorageItem *iface, FileAttributes *value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static HRESULT WINAPI storage_item_get_DateCreated( IStorageItem *iface, DateTime *value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static HRESULT WINAPI storage_item_IsOfType( IStorageItem *iface, StorageItemTypes type, boolean *value ) +{ + FIXME( "iface %p, type %d, value %p stub!\n", iface, type, value ); + return E_NOTIMPL; +} + +static const struct IStorageItemVtbl storage_item_vtbl = +{ + storage_item_QueryInterface, + storage_item_AddRef, + storage_item_Release, + /* IInspectable methods */ + storage_item_GetIids, + storage_item_GetRuntimeClassName, + storage_item_GetTrustLevel, + /* IStorageItem methods */ + storage_item_RenameAsyncOverloadDefaultOptions, + storage_item_RenameAsync, + storage_item_DeleteAsyncOverloadDefaultOptions, + storage_item_DeleteAsync, + storage_item_GetBasicPropertiesAsync, + storage_item_get_Name, + storage_item_get_Path, + storage_item_get_Attributes, + storage_item_get_DateCreated, + storage_item_IsOfType, +}; + struct package { IPackage IPackage_iface; @@ -357,6 +449,7 @@ static HRESULT WINAPI package_get_InstalledLocation( IPackage *iface, IStorageFo if (!(impl = calloc( 1, sizeof(*impl) ))) return E_OUTOFMEMORY; impl->IStorageFolder_iface.lpVtbl = &storage_folder_vtbl; + impl->IStorageItem_iface.lpVtbl = &storage_item_vtbl; impl->ref = 1; *value = &impl->IStorageFolder_iface; diff --git a/dlls/windows.applicationmodel/tests/application.c b/dlls/windows.applicationmodel/tests/application.c index 37e2e2338f1..a011b50d2de 100644 --- a/dlls/windows.applicationmodel/tests/application.c +++ b/dlls/windows.applicationmodel/tests/application.c @@ -60,6 +60,7 @@ static void test_PackageStatics(void) IPackageStatics *package_statics; IStorageFolder *storage_folder; IActivationFactory *factory; + IStorageItem *storage_item; IPackage *package; HSTRING str; HRESULT hr; @@ -103,6 +104,11 @@ static void test_PackageStatics(void) check_interface( storage_folder, &IID_IInspectable ); check_interface( storage_folder, &IID_IStorageFolder ); + hr = IStorageFolder_QueryInterface( storage_folder, &IID_IStorageItem, (void **)&storage_item ); + ok( hr == S_OK, "got hr %#lx.\n", hr ); + + ref = IStorageItem_Release( storage_item ); + ok( ref == 1, "got ref %ld.\n", ref ); ref = IStorageFolder_Release( storage_folder ); ok( !ref, "got ref %ld.\n", ref ); ref = IPackage_Release( package );
1
0
0
0
Mohamad Al-Jaf : windows.applicationmodel: Implement IPackage::get_InstalledLocation().
by Alexandre Julliard
25 Sep '23
25 Sep '23
Module: wine Branch: master Commit: 4108dfe267cce4cafd1298c71425479824ec62c1 URL:
https://gitlab.winehq.org/wine/wine/-/commit/4108dfe267cce4cafd1298c7142547…
Author: Mohamad Al-Jaf <mohamadaljaf(a)gmail.com> Date: Wed Feb 22 20:31:43 2023 -0500 windows.applicationmodel: Implement IPackage::get_InstalledLocation(). Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=52665
--- dlls/windows.applicationmodel/package.c | 172 +++++++++++++++++++++- dlls/windows.applicationmodel/tests/application.c | 13 ++ 2 files changed, 183 insertions(+), 2 deletions(-) diff --git a/dlls/windows.applicationmodel/package.c b/dlls/windows.applicationmodel/package.c index f7f6573526e..cb464aed2c1 100644 --- a/dlls/windows.applicationmodel/package.c +++ b/dlls/windows.applicationmodel/package.c @@ -115,6 +115,163 @@ static const struct IActivationFactoryVtbl factory_vtbl = factory_ActivateInstance, }; +struct storage_folder +{ + IStorageFolder IStorageFolder_iface; + LONG ref; +}; + +static inline struct storage_folder *impl_from_IStorageFolder( IStorageFolder *iface ) +{ + return CONTAINING_RECORD( iface, struct storage_folder, IStorageFolder_iface ); +} + +static HRESULT WINAPI storage_folder_QueryInterface( IStorageFolder *iface, REFIID iid, void **out ) +{ + struct storage_folder *impl = impl_from_IStorageFolder( iface ); + + TRACE( "iface %p, iid %s, out %p.\n", iface, debugstr_guid( iid ), out ); + + if (IsEqualGUID( iid, &IID_IUnknown ) || + IsEqualGUID( iid, &IID_IInspectable ) || + IsEqualGUID( iid, &IID_IStorageFolder )) + { + *out = &impl->IStorageFolder_iface; + IInspectable_AddRef( *out ); + return S_OK; + } + + FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI storage_folder_AddRef( IStorageFolder *iface ) +{ + struct storage_folder *impl = impl_from_IStorageFolder( iface ); + ULONG ref = InterlockedIncrement( &impl->ref ); + TRACE( "iface %p increasing refcount to %lu.\n", iface, ref ); + return ref; +} + +static ULONG WINAPI storage_folder_Release( IStorageFolder *iface ) +{ + struct storage_folder *impl = impl_from_IStorageFolder( iface ); + ULONG ref = InterlockedDecrement( &impl->ref ); + + TRACE( "iface %p decreasing refcount to %lu.\n", iface, ref ); + + if (!ref) free( impl ); + return ref; +} + +static HRESULT WINAPI storage_folder_GetIids( IStorageFolder *iface, ULONG *iid_count, IID **iids ) +{ + FIXME( "iface %p, iid_count %p, iids %p stub!\n", iface, iid_count, iids ); + return E_NOTIMPL; +} + +static HRESULT WINAPI storage_folder_GetRuntimeClassName( IStorageFolder *iface, HSTRING *class_name ) +{ + FIXME( "iface %p, class_name %p stub!\n", iface, class_name ); + return E_NOTIMPL; +} + +static HRESULT WINAPI storage_folder_GetTrustLevel( IStorageFolder *iface, TrustLevel *trust_level ) +{ + FIXME( "iface %p, trust_level %p stub!\n", iface, trust_level ); + return E_NOTIMPL; +} + +static HRESULT WINAPI storage_folder_CreateFileAsyncOverloadDefaultOptions( IStorageFolder *iface, HSTRING name, + IAsyncOperation_StorageFile **operation ) +{ + FIXME( "iface %p, name %s, operation %p stub!\n", iface, debugstr_hstring(name), operation ); + return E_NOTIMPL; +} + +static HRESULT WINAPI storage_folder_CreateFileAsync( IStorageFolder *iface, HSTRING name, CreationCollisionOption options, + IAsyncOperation_StorageFile **operation ) +{ + FIXME( "iface %p, name %s, options %d, operation %p stub!\n", iface, debugstr_hstring(name), options, operation ); + return E_NOTIMPL; +} + +static HRESULT WINAPI storage_folder_CreateFolderAsyncOverloadDefaultOptions( IStorageFolder *iface, HSTRING name, + IAsyncOperation_StorageFolder **operation ) +{ + FIXME( "iface %p, name %s, operation %p stub!\n", iface, debugstr_hstring(name), operation ); + return E_NOTIMPL; +} + +static HRESULT WINAPI storage_folder_CreateFolderAsync( IStorageFolder *iface, HSTRING name, CreationCollisionOption options, + IAsyncOperation_StorageFolder **operation ) +{ + FIXME( "iface %p, name %s, options %d, operation %p stub!\n", iface, debugstr_hstring(name), options, operation ); + return E_NOTIMPL; +} + +static HRESULT WINAPI storage_folder_GetFileAsync( IStorageFolder *iface, HSTRING name, IAsyncOperation_StorageFile **operation ) +{ + FIXME( "iface %p, name %s, operation %p stub!\n", iface, debugstr_hstring(name), operation ); + return E_NOTIMPL; +} + +static HRESULT WINAPI storage_folder_GetFolderAsync( IStorageFolder *iface, HSTRING name, IAsyncOperation_StorageFolder **operation ) +{ + FIXME( "iface %p, name %s, operation %p stub!\n", iface, debugstr_hstring(name), operation ); + return E_NOTIMPL; +} + +static HRESULT WINAPI storage_folder_GetItemAsync( IStorageFolder *iface, HSTRING name, IAsyncOperation_IStorageItem **operation ) +{ + FIXME( "iface %p, name %s, operation %p stub!\n", iface, debugstr_hstring(name), operation ); + return E_NOTIMPL; +} + +static HRESULT WINAPI storage_folder_GetFilesAsyncOverloadDefaultOptionsStartAndCount( IStorageFolder *iface, + IAsyncOperation_IVectorView_StorageFile **operation ) +{ + FIXME( "iface %p, operation %p stub!\n", iface, operation ); + return E_NOTIMPL; +} + +static HRESULT WINAPI storage_folder_GetFoldersAsyncOverloadDefaultOptionsStartAndCount( IStorageFolder *iface, + IAsyncOperation_IVectorView_StorageFolder **operation ) +{ + FIXME( "iface %p, operation %p stub!\n", iface, operation ); + return E_NOTIMPL; +} + +static HRESULT WINAPI storage_folder_GetItemsAsyncOverloadDefaultStartAndCount( IStorageFolder *iface, + IAsyncOperation_IVectorView_IStorageItem **operation ) +{ + FIXME( "iface %p, operation %p stub!\n", iface, operation ); + return E_NOTIMPL; +} + +static const struct IStorageFolderVtbl storage_folder_vtbl = +{ + storage_folder_QueryInterface, + storage_folder_AddRef, + storage_folder_Release, + /* IInspectable methods */ + storage_folder_GetIids, + storage_folder_GetRuntimeClassName, + storage_folder_GetTrustLevel, + /* IStorageFolder methods */ + storage_folder_CreateFileAsyncOverloadDefaultOptions, + storage_folder_CreateFileAsync, + storage_folder_CreateFolderAsyncOverloadDefaultOptions, + storage_folder_CreateFolderAsync, + storage_folder_GetFileAsync, + storage_folder_GetFolderAsync, + storage_folder_GetItemAsync, + storage_folder_GetFilesAsyncOverloadDefaultOptionsStartAndCount, + storage_folder_GetFoldersAsyncOverloadDefaultOptionsStartAndCount, + storage_folder_GetItemsAsyncOverloadDefaultStartAndCount, +}; + struct package { IPackage IPackage_iface; @@ -192,8 +349,19 @@ static HRESULT WINAPI package_get_Id( IPackage *iface, IPackageId **value ) static HRESULT WINAPI package_get_InstalledLocation( IPackage *iface, IStorageFolder **value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + struct storage_folder *impl; + + TRACE( "iface %p, value %p\n", iface, value ); + + if (!value) return E_INVALIDARG; + if (!(impl = calloc( 1, sizeof(*impl) ))) return E_OUTOFMEMORY; + + impl->IStorageFolder_iface.lpVtbl = &storage_folder_vtbl; + impl->ref = 1; + + *value = &impl->IStorageFolder_iface; + TRACE( "created IStorageFolder %p.\n", *value ); + return S_OK; } static HRESULT WINAPI package_get_IsFramework( IPackage *iface, boolean *value ) diff --git a/dlls/windows.applicationmodel/tests/application.c b/dlls/windows.applicationmodel/tests/application.c index 3dbed916530..37e2e2338f1 100644 --- a/dlls/windows.applicationmodel/tests/application.c +++ b/dlls/windows.applicationmodel/tests/application.c @@ -35,6 +35,7 @@ #define WIDL_using_Windows_Foundation_Collections #include "windows.foundation.h" #define WIDL_using_Windows_ApplicationModel +#define WIDL_using_Windows_Storage #include "windows.applicationmodel.h" #define WINE_WINRT_TEST @@ -57,6 +58,7 @@ static void test_PackageStatics(void) { static const WCHAR *package_statics_name = L"Windows.ApplicationModel.Package"; IPackageStatics *package_statics; + IStorageFolder *storage_folder; IActivationFactory *factory; IPackage *package; HSTRING str; @@ -92,6 +94,17 @@ static void test_PackageStatics(void) check_interface( package, &IID_IAgileObject ); check_interface( package, &IID_IPackage ); + hr = IPackage_get_InstalledLocation( package, NULL ); + ok( hr == E_INVALIDARG, "got hr %#lx.\n", hr ); + hr = IPackage_get_InstalledLocation( package, &storage_folder ); + ok( hr == S_OK, "got hr %#lx.\n", hr ); + + check_interface( storage_folder, &IID_IUnknown ); + check_interface( storage_folder, &IID_IInspectable ); + check_interface( storage_folder, &IID_IStorageFolder ); + + ref = IStorageFolder_Release( storage_folder ); + ok( !ref, "got ref %ld.\n", ref ); ref = IPackage_Release( package ); ok( !ref, "got ref %ld.\n", ref ); ref = IPackageStatics_Release( package_statics );
1
0
0
0
Mohamad Al-Jaf : windows.applicationmodel: Implement IPackageStatics::get_Current().
by Alexandre Julliard
25 Sep '23
25 Sep '23
Module: wine Branch: master Commit: ee567bb1b0f910f905a19bc830877c2ff4b89f98 URL:
https://gitlab.winehq.org/wine/wine/-/commit/ee567bb1b0f910f905a19bc830877c…
Author: Mohamad Al-Jaf <mohamadaljaf(a)gmail.com> Date: Fri Feb 17 18:24:14 2023 -0500 windows.applicationmodel: Implement IPackageStatics::get_Current(). Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=52665
--- dlls/windows.applicationmodel/package.c | 124 +++++++++++++++++++++- dlls/windows.applicationmodel/private.h | 1 + dlls/windows.applicationmodel/tests/application.c | 14 +++ dlls/windows.applicationmodel/tests/model.c | 7 ++ 4 files changed, 144 insertions(+), 2 deletions(-) diff --git a/dlls/windows.applicationmodel/package.c b/dlls/windows.applicationmodel/package.c index d894897b504..f7f6573526e 100644 --- a/dlls/windows.applicationmodel/package.c +++ b/dlls/windows.applicationmodel/package.c @@ -115,14 +115,134 @@ static const struct IActivationFactoryVtbl factory_vtbl = factory_ActivateInstance, }; -DEFINE_IINSPECTABLE( package_statics, IPackageStatics, struct package_statics, IActivationFactory_iface ) +struct package +{ + IPackage IPackage_iface; + LONG ref; +}; -static HRESULT WINAPI package_statics_get_Current( IPackageStatics *iface, IPackage **value ) +static inline struct package *impl_from_IPackage( IPackage *iface ) +{ + return CONTAINING_RECORD( iface, struct package, IPackage_iface ); +} + +static HRESULT WINAPI package_QueryInterface( IPackage *iface, REFIID iid, void **out ) +{ + struct package *impl = impl_from_IPackage( iface ); + + TRACE( "iface %p, iid %s, out %p.\n", iface, debugstr_guid( iid ), out ); + + if (IsEqualGUID( iid, &IID_IUnknown ) || + IsEqualGUID( iid, &IID_IInspectable ) || + IsEqualGUID( iid, &IID_IAgileObject ) || + IsEqualGUID( iid, &IID_IPackage )) + { + *out = &impl->IPackage_iface; + IInspectable_AddRef( *out ); + return S_OK; + } + + FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI package_AddRef( IPackage *iface ) +{ + struct package *impl = impl_from_IPackage( iface ); + ULONG ref = InterlockedIncrement( &impl->ref ); + TRACE( "iface %p increasing refcount to %lu.\n", iface, ref ); + return ref; +} + +static ULONG WINAPI package_Release( IPackage *iface ) +{ + struct package *impl = impl_from_IPackage( iface ); + ULONG ref = InterlockedDecrement( &impl->ref ); + + TRACE( "iface %p decreasing refcount to %lu.\n", iface, ref ); + + if (!ref) free( impl ); + return ref; +} + +static HRESULT WINAPI package_GetIids( IPackage *iface, ULONG *iid_count, IID **iids ) +{ + FIXME( "iface %p, iid_count %p, iids %p stub!\n", iface, iid_count, iids ); + return E_NOTIMPL; +} + +static HRESULT WINAPI package_GetRuntimeClassName( IPackage *iface, HSTRING *class_name ) +{ + FIXME( "iface %p, class_name %p stub!\n", iface, class_name ); + return E_NOTIMPL; +} + +static HRESULT WINAPI package_GetTrustLevel( IPackage *iface, TrustLevel *trust_level ) +{ + FIXME( "iface %p, trust_level %p stub!\n", iface, trust_level ); + return E_NOTIMPL; +} + +static HRESULT WINAPI package_get_Id( IPackage *iface, IPackageId **value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static HRESULT WINAPI package_get_InstalledLocation( IPackage *iface, IStorageFolder **value ) { FIXME( "iface %p, value %p stub!\n", iface, value ); return E_NOTIMPL; } +static HRESULT WINAPI package_get_IsFramework( IPackage *iface, boolean *value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static HRESULT WINAPI package_get_Dependencies( IPackage *iface, IVectorView_Package **value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static const struct IPackageVtbl package_vtbl = +{ + package_QueryInterface, + package_AddRef, + package_Release, + /* IInspectable methods */ + package_GetIids, + package_GetRuntimeClassName, + package_GetTrustLevel, + /* IPackage methods */ + package_get_Id, + package_get_InstalledLocation, + package_get_IsFramework, + package_get_Dependencies, +}; + +DEFINE_IINSPECTABLE( package_statics, IPackageStatics, struct package_statics, IActivationFactory_iface ) + +static HRESULT WINAPI package_statics_get_Current( IPackageStatics *iface, IPackage **value ) +{ + struct package *impl; + + TRACE( "iface %p, value %p\n", iface, value ); + + if (!value) return E_INVALIDARG; + if (!(impl = calloc( 1, sizeof(*impl) ))) return E_OUTOFMEMORY; + + impl->IPackage_iface.lpVtbl = &package_vtbl; + impl->ref = 1; + + *value = &impl->IPackage_iface; + TRACE( "created IPackage %p.\n", *value ); + return S_OK; +} + static const struct IPackageStaticsVtbl package_statics_vtbl = { package_statics_QueryInterface, diff --git a/dlls/windows.applicationmodel/private.h b/dlls/windows.applicationmodel/private.h index 0ca3c8931bb..ef7750159d2 100644 --- a/dlls/windows.applicationmodel/private.h +++ b/dlls/windows.applicationmodel/private.h @@ -33,6 +33,7 @@ #define WIDL_using_Windows_Foundation_Collections #include "windows.foundation.h" #define WIDL_using_Windows_ApplicationModel +#define WIDL_using_Windows_Storage #include "windows.applicationmodel.h" extern IActivationFactory *package_factory; diff --git a/dlls/windows.applicationmodel/tests/application.c b/dlls/windows.applicationmodel/tests/application.c index 9e4bd14b3e6..3dbed916530 100644 --- a/dlls/windows.applicationmodel/tests/application.c +++ b/dlls/windows.applicationmodel/tests/application.c @@ -58,6 +58,7 @@ static void test_PackageStatics(void) static const WCHAR *package_statics_name = L"Windows.ApplicationModel.Package"; IPackageStatics *package_statics; IActivationFactory *factory; + IPackage *package; HSTRING str; HRESULT hr; LONG ref; @@ -80,6 +81,19 @@ static void test_PackageStatics(void) hr = IActivationFactory_QueryInterface( factory, &IID_IPackageStatics, (void **)&package_statics ); ok( hr == S_OK, "got hr %#lx.\n", hr ); + hr = IPackageStatics_get_Current( package_statics, NULL ); + ok( hr == E_INVALIDARG, "got hr %#lx.\n", hr ); + hr = IPackageStatics_get_Current( package_statics, &package ); + ok( hr == S_OK, "got hr %#lx.\n", hr ); + ok( package != NULL, "got NULL package %p.\n", package ); + + check_interface( package, &IID_IUnknown ); + check_interface( package, &IID_IInspectable ); + check_interface( package, &IID_IAgileObject ); + check_interface( package, &IID_IPackage ); + + ref = IPackage_Release( package ); + ok( !ref, "got ref %ld.\n", ref ); ref = IPackageStatics_Release( package_statics ); ok( ref == 2, "got ref %ld.\n", ref ); ref = IActivationFactory_Release( factory ); diff --git a/dlls/windows.applicationmodel/tests/model.c b/dlls/windows.applicationmodel/tests/model.c index 44546194690..b603e4c551e 100644 --- a/dlls/windows.applicationmodel/tests/model.c +++ b/dlls/windows.applicationmodel/tests/model.c @@ -543,6 +543,7 @@ static void test_PackageStatics(void) static const WCHAR *package_statics_name = L"Windows.ApplicationModel.Package"; IPackageStatics *package_statics; IActivationFactory *factory; + IPackage *package; HSTRING str; HRESULT hr; LONG ref; @@ -565,6 +566,12 @@ static void test_PackageStatics(void) hr = IActivationFactory_QueryInterface( factory, &IID_IPackageStatics, (void **)&package_statics ); ok( hr == S_OK, "got hr %#lx.\n", hr ); + hr = IPackageStatics_get_Current( package_statics, NULL ); + ok( hr == E_INVALIDARG, "got hr %#lx.\n", hr ); + hr = IPackageStatics_get_Current( package_statics, &package ); + todo_wine ok( hr == 0x80073d54, "got hr %#lx.\n", hr ); + todo_wine ok( !package, "got package %p.\n", package ); + ref = IPackageStatics_Release( package_statics ); ok( ref == 2, "got ref %ld.\n", ref ); ref = IActivationFactory_Release( factory );
1
0
0
0
Mohamad Al-Jaf : windows.applicationmodel: Add IPackageStatics stub interface.
by Alexandre Julliard
25 Sep '23
25 Sep '23
Module: wine Branch: master Commit: 612375a5019cfbffc6157481a445c9ac79699e5c URL:
https://gitlab.winehq.org/wine/wine/-/commit/612375a5019cfbffc6157481a445c9…
Author: Mohamad Al-Jaf <mohamadaljaf(a)gmail.com> Date: Wed Jan 25 22:21:35 2023 -0500 windows.applicationmodel: Add IPackageStatics stub interface. --- dlls/windows.applicationmodel/package.c | 30 +++++++++++++ dlls/windows.applicationmodel/private.h | 38 ++++++++++++++++ dlls/windows.applicationmodel/tests/application.c | 54 +++++++++++++++++++++++ dlls/windows.applicationmodel/tests/model.c | 6 +++ 4 files changed, 128 insertions(+) diff --git a/dlls/windows.applicationmodel/package.c b/dlls/windows.applicationmodel/package.c index 087d96b5ec8..d894897b504 100644 --- a/dlls/windows.applicationmodel/package.c +++ b/dlls/windows.applicationmodel/package.c @@ -25,6 +25,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(model); struct package_statics { IActivationFactory IActivationFactory_iface; + IPackageStatics IPackageStatics_iface; LONG ref; }; @@ -49,6 +50,13 @@ static HRESULT WINAPI factory_QueryInterface( IActivationFactory *iface, REFIID return S_OK; } + if (IsEqualGUID( iid, &IID_IPackageStatics )) + { + *out = &impl->IPackageStatics_iface; + IInspectable_AddRef( *out ); + return S_OK; + } + FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); *out = NULL; return E_NOINTERFACE; @@ -107,9 +115,31 @@ static const struct IActivationFactoryVtbl factory_vtbl = factory_ActivateInstance, }; +DEFINE_IINSPECTABLE( package_statics, IPackageStatics, struct package_statics, IActivationFactory_iface ) + +static HRESULT WINAPI package_statics_get_Current( IPackageStatics *iface, IPackage **value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static const struct IPackageStaticsVtbl package_statics_vtbl = +{ + package_statics_QueryInterface, + package_statics_AddRef, + package_statics_Release, + /* IInspectable methods */ + package_statics_GetIids, + package_statics_GetRuntimeClassName, + package_statics_GetTrustLevel, + /* IPackageStatics methods */ + package_statics_get_Current, +}; + static struct package_statics package_statics = { {&factory_vtbl}, + {&package_statics_vtbl}, 1, }; diff --git a/dlls/windows.applicationmodel/private.h b/dlls/windows.applicationmodel/private.h index df4b3721a13..0ca3c8931bb 100644 --- a/dlls/windows.applicationmodel/private.h +++ b/dlls/windows.applicationmodel/private.h @@ -37,4 +37,42 @@ extern IActivationFactory *package_factory; +#define DEFINE_IINSPECTABLE_( pfx, iface_type, impl_type, impl_from, iface_mem, expr ) \ + static inline impl_type *impl_from( iface_type *iface ) \ + { \ + return CONTAINING_RECORD( iface, impl_type, iface_mem ); \ + } \ + static HRESULT WINAPI pfx##_QueryInterface( iface_type *iface, REFIID iid, void **out ) \ + { \ + impl_type *impl = impl_from( iface ); \ + return IInspectable_QueryInterface( (IInspectable *)(expr), iid, out ); \ + } \ + static ULONG WINAPI pfx##_AddRef( iface_type *iface ) \ + { \ + impl_type *impl = impl_from( iface ); \ + return IInspectable_AddRef( (IInspectable *)(expr) ); \ + } \ + static ULONG WINAPI pfx##_Release( iface_type *iface ) \ + { \ + impl_type *impl = impl_from( iface ); \ + return IInspectable_Release( (IInspectable *)(expr) ); \ + } \ + static HRESULT WINAPI pfx##_GetIids( iface_type *iface, ULONG *iid_count, IID **iids ) \ + { \ + impl_type *impl = impl_from( iface ); \ + return IInspectable_GetIids( (IInspectable *)(expr), iid_count, iids ); \ + } \ + static HRESULT WINAPI pfx##_GetRuntimeClassName( iface_type *iface, HSTRING *class_name ) \ + { \ + impl_type *impl = impl_from( iface ); \ + return IInspectable_GetRuntimeClassName( (IInspectable *)(expr), class_name ); \ + } \ + static HRESULT WINAPI pfx##_GetTrustLevel( iface_type *iface, TrustLevel *trust_level ) \ + { \ + impl_type *impl = impl_from( iface ); \ + return IInspectable_GetTrustLevel( (IInspectable *)(expr), trust_level ); \ + } +#define DEFINE_IINSPECTABLE( pfx, iface_type, impl_type, base_iface ) \ + DEFINE_IINSPECTABLE_( pfx, iface_type, impl_type, impl_from_##iface_type, iface_type##_iface, &impl->base_iface ) + #endif diff --git a/dlls/windows.applicationmodel/tests/application.c b/dlls/windows.applicationmodel/tests/application.c index a3f0ceb07d9..9e4bd14b3e6 100644 --- a/dlls/windows.applicationmodel/tests/application.c +++ b/dlls/windows.applicationmodel/tests/application.c @@ -31,9 +31,61 @@ #include "roapi.h" +#define WIDL_using_Windows_Foundation +#define WIDL_using_Windows_Foundation_Collections +#include "windows.foundation.h" +#define WIDL_using_Windows_ApplicationModel +#include "windows.applicationmodel.h" + #define WINE_WINRT_TEST #include "winrt_test.h" +#define check_interface( obj, iid ) check_interface_( __LINE__, obj, iid ) +static void check_interface_( unsigned int line, void *obj, const IID *iid ) +{ + IUnknown *iface = obj; + IUnknown *unk; + HRESULT hr; + + hr = IUnknown_QueryInterface( iface, iid, (void **)&unk ); + ok_(__FILE__, line)( hr == S_OK, "got hr %#lx.\n", hr ); + if (SUCCEEDED(hr)) + IUnknown_Release( unk ); +} + +static void test_PackageStatics(void) +{ + static const WCHAR *package_statics_name = L"Windows.ApplicationModel.Package"; + IPackageStatics *package_statics; + IActivationFactory *factory; + HSTRING str; + HRESULT hr; + LONG ref; + + hr = WindowsCreateString( package_statics_name, wcslen( package_statics_name ), &str ); + ok( hr == S_OK, "got hr %#lx.\n", hr ); + + hr = RoGetActivationFactory( str, &IID_IActivationFactory, (void **)&factory ); + WindowsDeleteString( str ); + ok( hr == S_OK || broken( hr == REGDB_E_CLASSNOTREG ), "got hr %#lx.\n", hr ); + if (hr == REGDB_E_CLASSNOTREG) + { + win_skip( "%s runtimeclass not registered, skipping tests.\n", wine_dbgstr_w( package_statics_name ) ); + return; + } + + check_interface( factory, &IID_IUnknown ); + check_interface( factory, &IID_IInspectable ); + + hr = IActivationFactory_QueryInterface( factory, &IID_IPackageStatics, (void **)&package_statics ); + ok( hr == S_OK, "got hr %#lx.\n", hr ); + + ref = IPackageStatics_Release( package_statics ); + ok( ref == 2, "got ref %ld.\n", ref ); + ref = IActivationFactory_Release( factory ); + ok( ref == 1, "got ref %ld.\n", ref ); +} + int main( int argc, char const *argv[] ) { HRESULT hr; @@ -43,6 +95,8 @@ int main( int argc, char const *argv[] ) hr = RoInitialize( RO_INIT_MULTITHREADED ); ok( hr == S_OK, "RoInitialize failed, hr %#lx\n", hr ); + test_PackageStatics(); + RoUninitialize(); winrt_test_exit(); diff --git a/dlls/windows.applicationmodel/tests/model.c b/dlls/windows.applicationmodel/tests/model.c index 2d0494dabda..44546194690 100644 --- a/dlls/windows.applicationmodel/tests/model.c +++ b/dlls/windows.applicationmodel/tests/model.c @@ -541,6 +541,7 @@ skip_tests: static void test_PackageStatics(void) { static const WCHAR *package_statics_name = L"Windows.ApplicationModel.Package"; + IPackageStatics *package_statics; IActivationFactory *factory; HSTRING str; HRESULT hr; @@ -561,6 +562,11 @@ static void test_PackageStatics(void) check_interface( factory, &IID_IUnknown ); check_interface( factory, &IID_IInspectable ); + hr = IActivationFactory_QueryInterface( factory, &IID_IPackageStatics, (void **)&package_statics ); + ok( hr == S_OK, "got hr %#lx.\n", hr ); + + ref = IPackageStatics_Release( package_statics ); + ok( ref == 2, "got ref %ld.\n", ref ); ref = IActivationFactory_Release( factory ); ok( ref == 1, "got ref %ld.\n", ref ); }
1
0
0
0
Alexandre Julliard : widl: Use the IMAGE_FIRST_SECTION helper macro.
by Alexandre Julliard
25 Sep '23
25 Sep '23
Module: wine Branch: master Commit: c7fafe7eb209365dbda7411f79ebff9f853e9273 URL:
https://gitlab.winehq.org/wine/wine/-/commit/c7fafe7eb209365dbda7411f79ebff…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Sep 25 13:01:56 2023 +0200 widl: Use the IMAGE_FIRST_SECTION helper macro. --- tools/widl/typelib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/widl/typelib.c b/tools/widl/typelib.c index 202702c54dd..1f17996c420 100644 --- a/tools/widl/typelib.c +++ b/tools/widl/typelib.c @@ -289,7 +289,7 @@ static void read_msft_importlib(importlib_t *importlib, void *data, unsigned int static unsigned int rva_to_va( const IMAGE_NT_HEADERS32 *nt, unsigned int rva ) { - IMAGE_SECTION_HEADER *sec = (IMAGE_SECTION_HEADER *)((char *)&nt->OptionalHeader + nt->FileHeader.SizeOfOptionalHeader); + IMAGE_SECTION_HEADER *sec = IMAGE_FIRST_SECTION( nt ); unsigned int i; for (i = 0; i < nt->FileHeader.NumberOfSections; i++, sec++) @@ -312,7 +312,7 @@ static void read_pe_importlib(importlib_t *importlib, void *data, unsigned int s if (dos->e_lfanew < sizeof(*dos) || dos->e_lfanew >= size) error( "not a PE file\n" ); nt = (IMAGE_NT_HEADERS32 *)((char *)data + dos->e_lfanew); if (nt->Signature != IMAGE_NT_SIGNATURE) error( "not a PE file\n" ); - if ((char *)&nt->OptionalHeader + nt->FileHeader.SizeOfOptionalHeader > (char *)data + size) + if ((char *)(IMAGE_FIRST_SECTION(nt) + nt->FileHeader.NumberOfSections) > (char *)data + size) error( "invalid PE file\n" ); switch (nt->OptionalHeader.Magic) {
1
0
0
0
Alexandre Julliard : krnl386: Use the IMAGE_FIRST_SECTION helper macro.
by Alexandre Julliard
25 Sep '23
25 Sep '23
Module: wine Branch: master Commit: 176a6ca279f0c257655526a9b9ab76ab05652094 URL:
https://gitlab.winehq.org/wine/wine/-/commit/176a6ca279f0c257655526a9b9ab76…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Sep 25 13:01:45 2023 +0200 krnl386: Use the IMAGE_FIRST_SECTION helper macro. --- dlls/krnl386.exe16/vxd.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/dlls/krnl386.exe16/vxd.c b/dlls/krnl386.exe16/vxd.c index 599ebb32edb..966ac272303 100644 --- a/dlls/krnl386.exe16/vxd.c +++ b/dlls/krnl386.exe16/vxd.c @@ -983,10 +983,7 @@ void WINAPI __wine_vxd_win32s( CONTEXT *context ) struct Win32sModule *module = moduleTable + context->Ecx; IMAGE_NT_HEADERS *nt_header = RtlImageNtHeader( (HMODULE)module->baseAddr ); - IMAGE_SECTION_HEADER *pe_seg = (IMAGE_SECTION_HEADER*)((char *)&nt_header->OptionalHeader + - nt_header->FileHeader.SizeOfOptionalHeader); - - + IMAGE_SECTION_HEADER *pe_seg = IMAGE_FIRST_SECTION( nt_header ); HFILE image = _lopen(module->pathName, OF_READ); BOOL error = (image == HFILE_ERROR); UINT i;
1
0
0
0
← Newer
1
...
12
13
14
15
16
17
18
...
92
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
Results per page:
10
25
50
100
200