[SCRRUN] Sync with Wine Staging 1.9.4. CORE-10912
authorAmine Khaldi <amine.khaldi@reactos.org>
Sat, 5 Mar 2016 10:06:02 +0000 (10:06 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Sat, 5 Mar 2016 10:06:02 +0000 (10:06 +0000)
svn path=/trunk/; revision=70926

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

index 40741f4..db82f59 100644 (file)
@@ -3208,9 +3208,27 @@ static HRESULT WINAPI filesys_GetTempName(IFileSystem3 *iface, BSTR *pbstrResult
 static HRESULT WINAPI filesys_DriveExists(IFileSystem3 *iface, BSTR DriveSpec,
                                             VARIANT_BOOL *pfExists)
 {
-    FIXME("%p %s %p\n", iface, debugstr_w(DriveSpec), pfExists);
+    UINT len;
+    WCHAR driveletter;
+    TRACE("%p %s %p\n", iface, debugstr_w(DriveSpec), pfExists);
+
+    if (!pfExists) return E_POINTER;
+
+    *pfExists = VARIANT_FALSE;
+    len = SysStringLen(DriveSpec);
+
+    if (len >= 1) {
+        driveletter = toupperW(DriveSpec[0]);
+        if (driveletter >= 'A' && driveletter <= 'Z'
+                && (len < 2 || DriveSpec[1] == ':')
+                && (len < 3 || DriveSpec[2] == '\\')) {
+            const WCHAR root[] = {driveletter, ':', '\\', 0};
+            UINT drivetype = GetDriveTypeW(root);
+            *pfExists = drivetype != DRIVE_NO_ROOT_DIR && drivetype != DRIVE_UNKNOWN ? VARIANT_TRUE : VARIANT_FALSE;
+        }
+    }
 
-    return E_NOTIMPL;
+    return S_OK;
 }
 
 static HRESULT WINAPI filesys_FileExists(IFileSystem3 *iface, BSTR path, VARIANT_BOOL *ret)
@@ -3241,9 +3259,40 @@ static HRESULT WINAPI filesys_FolderExists(IFileSystem3 *iface, BSTR path, VARIA
 static HRESULT WINAPI filesys_GetDrive(IFileSystem3 *iface, BSTR DriveSpec,
                                             IDrive **ppdrive)
 {
-    FIXME("%p %s %p\n", iface, debugstr_w(DriveSpec), ppdrive);
+    UINT len;
+    HRESULT hr;
+    WCHAR driveletter;
+    VARIANT_BOOL drive_exists;
 
-    return E_NOTIMPL;
+    TRACE("%p %s %p\n", iface, debugstr_w(DriveSpec), ppdrive);
+
+    if (!ppdrive)
+        return E_POINTER;
+
+    *ppdrive = NULL;
+
+    /* DriveSpec may be one of: 'x', 'x:', 'x:\', '\\computer\share' */
+    len = SysStringLen(DriveSpec);
+    if (!len)
+        return E_INVALIDARG;
+    else if (len <= 3) {
+        driveletter = toupperW(DriveSpec[0]);
+        if (driveletter < 'A' || driveletter > 'Z'
+                || (len >= 2 && DriveSpec[1] != ':')
+                || (len == 3 && DriveSpec[2] != '\\'))
+            return E_INVALIDARG;
+        hr = IFileSystem3_DriveExists(iface, DriveSpec, &drive_exists);
+        if (FAILED(hr))
+            return hr;
+        if (drive_exists == VARIANT_FALSE)
+            return CTL_E_DEVICEUNAVAILABLE;
+        return create_drive(driveletter, ppdrive);
+    } else {
+        if (DriveSpec[0] != '\\' || DriveSpec[1] != '\\')
+            return E_INVALIDARG;
+        FIXME("%s not implemented yet\n", debugstr_w(DriveSpec));
+        return E_NOTIMPL;
+    }
 }
 
 static HRESULT WINAPI filesys_GetFile(IFileSystem3 *iface, BSTR FilePath,
index b52e3c8..97d8d8b 100644 (file)
@@ -168,7 +168,7 @@ reactos/dll/win32/rsabase             # Synced to WineStaging-1.7.55
 reactos/dll/win32/rsaenh              # Synced to WineStaging-1.7.55
 reactos/dll/win32/sccbase             # Synced to WineStaging-1.7.55
 reactos/dll/win32/schannel            # Synced to WineStaging-1.7.55
-reactos/dll/win32/scrrun              # Synced to WineStaging-1.7.55
+reactos/dll/win32/scrrun              # Synced to WineStaging-1.9.4
 reactos/dll/win32/secur32             # Forked
 reactos/dll/win32/security            # Forked (different .spec)
 reactos/dll/win32/sensapi             # Synced to WineStaging-1.7.55