From: Mohamad Al-Jaf mohamadaljaf@gmail.com
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 );