From: Amine Khaldi Date: Sat, 5 Mar 2016 10:06:02 +0000 (+0000) Subject: [SCRRUN] Sync with Wine Staging 1.9.4. CORE-10912 X-Git-Tag: ReactOS-0.4.1~289 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=c3885d354659c58fa0550c2ea184c7426396b046 [SCRRUN] Sync with Wine Staging 1.9.4. CORE-10912 svn path=/trunk/; revision=70926 --- diff --git a/reactos/dll/win32/scrrun/filesystem.c b/reactos/dll/win32/scrrun/filesystem.c index 40741f4a5e7..db82f59fe19 100644 --- a/reactos/dll/win32/scrrun/filesystem.c +++ b/reactos/dll/win32/scrrun/filesystem.c @@ -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, diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index b52e3c85e6c..97d8d8bad9f 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -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