[SCRRUN] Sync with Wine Staging 2.9. CORE-13362
authorAmine Khaldi <amine.khaldi@reactos.org>
Sat, 3 Jun 2017 22:38:57 +0000 (22:38 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Sat, 3 Jun 2017 22:38:57 +0000 (22:38 +0000)
f601660 scrrun: Added DateLastModified property for IFile.

svn path=/trunk/; revision=74845

reactos/dll/win32/scrrun/filesystem.c
reactos/media/doc/README.WINE

index 14c1e36..45370e1 100644 (file)
@@ -2699,6 +2699,21 @@ static HRESULT WINAPI file_put_Attributes(IFile *iface, FileAttribute pfa)
     return SetFileAttributesW(This->path, pfa) ? S_OK : create_error(GetLastError());
 }
 
+static HRESULT get_date_from_filetime(const FILETIME *ft, DATE *date)
+{
+    FILETIME ftlocal;
+    SYSTEMTIME st;
+
+    if (!date)
+        return E_POINTER;
+
+    FileTimeToLocalFileTime(ft, &ftlocal);
+    FileTimeToSystemTime(&ftlocal, &st);
+    SystemTimeToVariantTime(&st, date);
+
+    return S_OK;
+}
+
 static HRESULT WINAPI file_get_DateCreated(IFile *iface, DATE *pdate)
 {
     struct file *This = impl_from_IFile(iface);
@@ -2706,11 +2721,17 @@ static HRESULT WINAPI file_get_DateCreated(IFile *iface, DATE *pdate)
     return E_NOTIMPL;
 }
 
-static HRESULT WINAPI file_get_DateLastModified(IFile *iface, DATE *pdate)
+static HRESULT WINAPI file_get_DateLastModified(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.ftLastWriteTime, date);
+
+    return E_FAIL;
 }
 
 static HRESULT WINAPI file_get_DateLastAccessed(IFile *iface, DATE *pdate)
index 74f7811..56eb2e9 100644 (file)
@@ -165,7 +165,7 @@ reactos/dll/win32/rsabase             # Synced to WineStaging-1.9.11
 reactos/dll/win32/rsaenh              # Synced to WineStaging-2.9
 reactos/dll/win32/sccbase             # Synced to WineStaging-1.9.11
 reactos/dll/win32/schannel            # Synced to WineStaging-1.9.11
-reactos/dll/win32/scrrun              # Synced to WineStaging-2.2
+reactos/dll/win32/scrrun              # Synced to WineStaging-2.9
 reactos/dll/win32/secur32             # Forked
 reactos/dll/win32/security            # Forked (different .spec)
 reactos/dll/win32/sensapi             # Synced to WineStaging-1.9.11