scrrun: Add IFile::get_Attributes implementation.
This commit is contained in:
parent
1257db2109
commit
4135874f0f
|
@ -778,8 +778,19 @@ static HRESULT WINAPI file_get_ParentFolder(IFile *iface, IFolder **ppfolder)
|
||||||
static HRESULT WINAPI file_get_Attributes(IFile *iface, FileAttribute *pfa)
|
static HRESULT WINAPI file_get_Attributes(IFile *iface, FileAttribute *pfa)
|
||||||
{
|
{
|
||||||
struct file *This = impl_from_IFile(iface);
|
struct file *This = impl_from_IFile(iface);
|
||||||
FIXME("(%p)->(%p)\n", This, pfa);
|
DWORD fa;
|
||||||
return E_NOTIMPL;
|
|
||||||
|
TRACE("(%p)->(%p)\n", This, pfa);
|
||||||
|
|
||||||
|
if(!pfa)
|
||||||
|
return E_POINTER;
|
||||||
|
|
||||||
|
fa = GetFileAttributesW(This->path);
|
||||||
|
if(fa == INVALID_FILE_ATTRIBUTES)
|
||||||
|
return create_error(GetLastError());
|
||||||
|
|
||||||
|
*pfa = fa & ~FILE_ATTRIBUTE_NORMAL;
|
||||||
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI file_put_Attributes(IFile *iface, FileAttribute pfa)
|
static HRESULT WINAPI file_put_Attributes(IFile *iface, FileAttribute pfa)
|
||||||
|
|
|
@ -466,6 +466,8 @@ static void test_GetFile(void)
|
||||||
static const WCHAR get_file[] = {'g','e','t','_','f','i','l','e','.','t','s','t',0};
|
static const WCHAR get_file[] = {'g','e','t','_','f','i','l','e','.','t','s','t',0};
|
||||||
|
|
||||||
BSTR path = SysAllocString(get_file);
|
BSTR path = SysAllocString(get_file);
|
||||||
|
FileAttribute fa;
|
||||||
|
DWORD gfa;
|
||||||
IFile *file;
|
IFile *file;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
HANDLE hf;
|
HANDLE hf;
|
||||||
|
@ -498,6 +500,11 @@ static void test_GetFile(void)
|
||||||
|
|
||||||
hr = IFileSystem3_GetFile(fs3, path, &file);
|
hr = IFileSystem3_GetFile(fs3, path, &file);
|
||||||
ok(hr == S_OK, "GetFile returned %x, expected S_OK\n", hr);
|
ok(hr == S_OK, "GetFile returned %x, expected S_OK\n", hr);
|
||||||
|
|
||||||
|
hr = IFile_get_Attributes(file, &fa);
|
||||||
|
gfa = GetFileAttributesW(get_file) & ~FILE_ATTRIBUTE_NORMAL;
|
||||||
|
ok(hr == S_OK, "get_Attributes returned %x, expected S_OK\n", hr);
|
||||||
|
ok(fa == gfa, "fa = %x, expected %x\n", fa, gfa);
|
||||||
IFile_Release(file);
|
IFile_Release(file);
|
||||||
|
|
||||||
DeleteFileW(path);
|
DeleteFileW(path);
|
||||||
|
|
Loading…
Reference in New Issue