From: Mohamad Al-Jaf mohamadaljaf@gmail.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52665 --- dlls/windows.applicationmodel/package.c | 10 ++++++++-- dlls/windows.applicationmodel/tests/model.c | 8 ++++---- 2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/dlls/windows.applicationmodel/package.c b/dlls/windows.applicationmodel/package.c index 7a8ff890ae3..e7cc26ec6c1 100644 --- a/dlls/windows.applicationmodel/package.c +++ b/dlls/windows.applicationmodel/package.c @@ -321,8 +321,14 @@ 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]; + + TRACE( "iface %p, value %p\n", iface, value ); + + if (!value) return E_INVALIDARG; + if (!GetModuleFileNameW( NULL, buffer, MAX_PATH )) return HRESULT_FROM_WIN32( GetLastError() ); + + return WindowsCreateString( buffer, wcslen(buffer), value ); }
static HRESULT WINAPI storage_item_get_Attributes( IStorageItem *iface, FileAttributes *value ) diff --git a/dlls/windows.applicationmodel/tests/model.c b/dlls/windows.applicationmodel/tests/model.c index 1111b71ae35..f63ec226bbd 100644 --- a/dlls/windows.applicationmodel/tests/model.c +++ b/dlls/windows.applicationmodel/tests/model.c @@ -115,15 +115,15 @@ static void test_PackageStatics(void) ok( hr == S_OK, "got hr %#lx.\n", hr );
hr = IStorageItem_get_Path( storage_item, NULL ); - todo_wine ok( hr == E_INVALIDARG, "got hr %#lx.\n", hr ); + ok( hr == E_INVALIDARG, "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 = 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) );
ref = IStorageItem_Release( storage_item ); ok( !ref, "got ref %ld.\n", ref );