scrrun: Added DateCreated property for IFile.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=42857
This commit is contained in:
Robert Wilhelm 2022-08-22 08:36:10 +02:00 committed by Alexandre Julliard
parent 51604ad186
commit 8eb7843d20
2 changed files with 17 additions and 3 deletions

View file

@ -2947,11 +2947,17 @@ static HRESULT get_date_from_filetime(const FILETIME *ft, DATE *date)
return S_OK;
}
static HRESULT WINAPI file_get_DateCreated(IFile *iface, DATE *pdate)
static HRESULT WINAPI file_get_DateCreated(IFile *iface, DATE *date)
{
struct file *This = impl_from_IFile(iface);
FIXME("(%p)->(%p)\n", This, pdate);
return E_NOTIMPL;
WIN32_FILE_ATTRIBUTE_DATA attrs;
TRACE("(%p)->(%p)\n", This, date);
if (GetFileAttributesExW(This->path, GetFileExInfoStandard, &attrs))
return get_date_from_filetime(&attrs.ftCreationTime, date);
return E_FAIL;
}
static HRESULT WINAPI file_get_DateLastModified(IFile *iface, DATE *date)

View file

@ -635,6 +635,14 @@ static void test_GetFile(void)
hr = IFileSystem3_GetFile(fs3, path, &file);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IFile_get_DateCreated(file, NULL);
ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
date = 0.0;
hr = IFile_get_DateCreated(file, &date);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(date > 0.0, "got %f\n", date);
hr = IFile_get_DateLastModified(file, NULL);
ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);