scrrun: Implement Path() property for IFile.
This commit is contained in:
parent
7e480d3c6d
commit
574350d838
|
@ -2546,11 +2546,20 @@ static HRESULT WINAPI file_Invoke(IFile *iface, DISPID dispIdMember, REFIID riid
|
|||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI file_get_Path(IFile *iface, BSTR *pbstrPath)
|
||||
static HRESULT WINAPI file_get_Path(IFile *iface, BSTR *path)
|
||||
{
|
||||
struct file *This = impl_from_IFile(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pbstrPath);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, path);
|
||||
|
||||
if (!path)
|
||||
return E_POINTER;
|
||||
|
||||
*path = SysAllocString(This->path);
|
||||
if (!*path)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI file_get_Name(IFile *iface, BSTR *name)
|
||||
|
|
|
@ -538,7 +538,7 @@ static void test_GetAbsolutePathName(void)
|
|||
static void test_GetFile(void)
|
||||
{
|
||||
static const WCHAR slW[] = {'\\',0};
|
||||
BSTR path;
|
||||
BSTR path, str;
|
||||
WCHAR pathW[MAX_PATH];
|
||||
FileAttribute fa;
|
||||
VARIANT size;
|
||||
|
@ -572,6 +572,14 @@ static void test_GetFile(void)
|
|||
hr = IFileSystem3_GetFile(fs3, path, &file);
|
||||
ok(hr == S_OK, "GetFile returned %x, expected S_OK\n", hr);
|
||||
|
||||
hr = IFile_get_Path(file, NULL);
|
||||
ok(hr == E_POINTER, "got 0x%08x\n", hr);
|
||||
|
||||
hr = IFile_get_Path(file, &str);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok(!lstrcmpW(str, pathW), "got %s\n", wine_dbgstr_w(str));
|
||||
SysFreeString(str);
|
||||
|
||||
hr = IFile_get_Attributes(file, &fa);
|
||||
gfa = GetFileAttributesW(pathW) & (FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN |
|
||||
FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_ARCHIVE |
|
||||
|
|
Loading…
Reference in New Issue