Commit ed2bfd4a authored by Mohamad Al-Jaf's avatar Mohamad Al-Jaf Committed by Alexandre Julliard

windows.applicationmodel: Implement IStorageItem::get_Path().

parent a7fa496b
MODULE = windows.applicationmodel.dll
IMPORTS = combase
IMPORTS = combase kernelbase
C_SRCS = \
main.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 )
......
......@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment