Author: akhaldi
Date: Wed Oct 8 18:03:53 2014
New Revision: 64601
URL:
http://svn.reactos.org/svn/reactos?rev=64601&view=rev
Log:
[SCRRUN]
* Sync with Wine 1.7.27.
CORE-8540
Modified:
trunk/reactos/dll/win32/scrrun/filesystem.c
trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/win32/scrrun/filesystem.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/scrrun/filesyste…
==============================================================================
--- trunk/reactos/dll/win32/scrrun/filesystem.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/scrrun/filesystem.c [iso-8859-1] Wed Oct 8 18:03:53 2014
@@ -875,6 +875,24 @@
return E_NOTIMPL;
}
+static HRESULT variant_from_largeint(const ULARGE_INTEGER *src, VARIANT *v)
+{
+ HRESULT hr = S_OK;
+
+ if (src->u.HighPart || src->u.LowPart > INT_MAX)
+ {
+ V_VT(v) = VT_R8;
+ hr = VarR8FromUI8(src->QuadPart, &V_R8(v));
+ }
+ else
+ {
+ V_VT(v) = VT_I4;
+ V_I4(v) = src->u.LowPart;
+ }
+
+ return hr;
+}
+
static HRESULT WINAPI drive_get_AvailableSpace(IDrive *iface, VARIANT *v)
{
struct drive *This = impl_from_IDrive(iface);
@@ -888,8 +906,7 @@
if (!GetDiskFreeSpaceExW(This->root, &avail, NULL, NULL))
return E_FAIL;
- V_VT(v) = VT_R8;
- return VarR8FromUI8(avail.QuadPart, &V_R8(v));
+ return variant_from_largeint(&avail, v);
}
static HRESULT WINAPI drive_get_FreeSpace(IDrive *iface, VARIANT *v)
@@ -905,8 +922,7 @@
if (!GetDiskFreeSpaceExW(This->root, &freespace, NULL, NULL))
return E_FAIL;
- V_VT(v) = VT_R8;
- return VarR8FromUI8(freespace.QuadPart, &V_R8(v));
+ return variant_from_largeint(&freespace, v);
}
static HRESULT WINAPI drive_get_TotalSize(IDrive *iface, VARIANT *v)
@@ -922,15 +938,25 @@
if (!GetDiskFreeSpaceExW(This->root, NULL, &total, NULL))
return E_FAIL;
- V_VT(v) = VT_R8;
- return VarR8FromUI8(total.QuadPart, &V_R8(v));
+ return variant_from_largeint(&total, v);
}
static HRESULT WINAPI drive_get_VolumeName(IDrive *iface, BSTR *name)
{
struct drive *This = impl_from_IDrive(iface);
- FIXME("(%p)->(%p): stub\n", This, name);
- return E_NOTIMPL;
+ WCHAR nameW[MAX_PATH+1];
+ BOOL ret;
+
+ TRACE("(%p)->(%p)\n", This, name);
+
+ if (!name)
+ return E_POINTER;
+
+ *name = NULL;
+ ret = GetVolumeInformationW(This->root, nameW, sizeof(nameW)/sizeof(WCHAR), NULL,
NULL, NULL, NULL, 0);
+ if (ret)
+ *name = SysAllocString(nameW);
+ return ret ? S_OK : E_FAIL;
}
static HRESULT WINAPI drive_put_VolumeName(IDrive *iface, BSTR name)
@@ -943,15 +969,33 @@
static HRESULT WINAPI drive_get_FileSystem(IDrive *iface, BSTR *fs)
{
struct drive *This = impl_from_IDrive(iface);
- FIXME("(%p)->(%p): stub\n", This, fs);
- return E_NOTIMPL;
+ WCHAR nameW[MAX_PATH+1];
+ BOOL ret;
+
+ TRACE("(%p)->(%p)\n", This, fs);
+
+ if (!fs)
+ return E_POINTER;
+
+ *fs = NULL;
+ ret = GetVolumeInformationW(This->root, NULL, 0, NULL, NULL, NULL, nameW,
sizeof(nameW)/sizeof(WCHAR));
+ if (ret)
+ *fs = SysAllocString(nameW);
+ return ret ? S_OK : E_FAIL;
}
static HRESULT WINAPI drive_get_SerialNumber(IDrive *iface, LONG *serial)
{
struct drive *This = impl_from_IDrive(iface);
- FIXME("(%p)->(%p): stub\n", This, serial);
- return E_NOTIMPL;
+ BOOL ret;
+
+ TRACE("(%p)->(%p)\n", This, serial);
+
+ if (!serial)
+ return E_POINTER;
+
+ ret = GetVolumeInformationW(This->root, NULL, 0, (DWORD*)serial, NULL, NULL, NULL,
0);
+ return ret ? S_OK : E_FAIL;
}
static HRESULT WINAPI drive_get_IsReady(IDrive *iface, VARIANT_BOOL *ready)
@@ -1073,7 +1117,7 @@
strcpyW(pathW, path);
len = strlenW(pathW);
- if (pathW[len-1] != '\\')
+ if (len && pathW[len-1] != '\\')
strcatW(pathW, bsW);
strcatW(pathW, allW);
handle = FindFirstFileW(pathW, data);
@@ -1818,8 +1862,32 @@
static HRESULT WINAPI filecoll_get_Count(IFileCollection *iface, LONG *count)
{
struct filecollection *This = impl_from_IFileCollection(iface);
- FIXME("(%p)->(%p)\n", This, count);
- return E_NOTIMPL;
+ static const WCHAR allW[] = {'\\','*',0};
+ WIN32_FIND_DATAW data;
+ WCHAR pathW[MAX_PATH];
+ HANDLE handle;
+
+ TRACE("(%p)->(%p)\n", This, count);
+
+ if(!count)
+ return E_POINTER;
+
+ *count = 0;
+
+ strcpyW(pathW, This->path);
+ strcatW(pathW, allW);
+ handle = FindFirstFileW(pathW, &data);
+ if (handle == INVALID_HANDLE_VALUE)
+ return HRESULT_FROM_WIN32(GetLastError());
+
+ do
+ {
+ if (is_file_data(&data))
+ *count += 1;
+ } while (FindNextFileW(handle, &data));
+ FindClose(handle);
+
+ return S_OK;
}
static const IFileCollectionVtbl filecollectionvtbl = {
@@ -2583,6 +2651,7 @@
static HRESULT WINAPI file_get_Size(IFile *iface, VARIANT *pvarSize)
{
struct file *This = impl_from_IFile(iface);
+ ULARGE_INTEGER size;
WIN32_FIND_DATAW fd;
HANDLE f;
@@ -2596,14 +2665,10 @@
return create_error(GetLastError());
FindClose(f);
- if(fd.nFileSizeHigh || fd.nFileSizeLow>INT_MAX) {
- V_VT(pvarSize) = VT_R8;
- V_R8(pvarSize) = ((ULONGLONG)fd.nFileSizeHigh<<32) + fd.nFileSizeLow;
- }else {
- V_VT(pvarSize) = VT_I4;
- V_I4(pvarSize) = fd.nFileSizeLow;
- }
- return S_OK;
+ size.u.LowPart = fd.nFileSizeLow;
+ size.u.HighPart = fd.nFileSizeHigh;
+
+ return variant_from_largeint(&size, pvarSize);
}
static HRESULT WINAPI file_get_Type(IFile *iface, BSTR *pbstrType)
@@ -2707,9 +2772,6 @@
heap_free(f);
return E_FAIL;
}
-
- if(path[len-1]=='/' || path[len-1]=='\\')
- path[len-1] = 0;
attrs = GetFileAttributesW(f->path);
if(attrs==INVALID_FILE_ATTRIBUTES ||
@@ -2891,12 +2953,19 @@
return S_OK;
}
-static HRESULT WINAPI filesys_GetDriveName(IFileSystem3 *iface, BSTR Path,
- BSTR *pbstrResult)
-{
- FIXME("%p %s %p\n", iface, debugstr_w(Path), pbstrResult);
-
- return E_NOTIMPL;
+static HRESULT WINAPI filesys_GetDriveName(IFileSystem3 *iface, BSTR path, BSTR *drive)
+{
+ TRACE("(%p)->(%s %p)\n", iface, debugstr_w(path), drive);
+
+ if (!drive)
+ return E_POINTER;
+
+ *drive = NULL;
+
+ if (path && strlenW(path) > 1 && path[1] == ':')
+ *drive = SysAllocStringLen(path, 2);
+
+ return S_OK;
}
static inline DWORD get_parent_folder_name(const WCHAR *path, DWORD len)
@@ -3644,11 +3713,15 @@
}
ret = VerQueryValueW(ptr, rootW, (void**)&info, &len);
+ if (!ret)
+ {
+ heap_free(ptr);
+ return HRESULT_FROM_WIN32(GetLastError());
+ }
+
+ get_versionstring(info, ver);
heap_free(ptr);
- if (!ret)
- return HRESULT_FROM_WIN32(GetLastError());
-
- get_versionstring(info, ver);
+
*version = SysAllocString(ver);
TRACE("version=%s\n", debugstr_w(ver));
Modified: trunk/reactos/media/doc/README.WINE
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
==============================================================================
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Wed Oct 8 18:03:53 2014
@@ -176,7 +176,7 @@
reactos/dll/win32/rsaenh # Synced to Wine-1.7.27
reactos/dll/win32/sccbase # Synced to Wine-1.7.17
reactos/dll/win32/schannel # Synced to Wine-1.7.27
-reactos/dll/win32/scrrun # Synced to Wine-1.7.17
+reactos/dll/win32/scrrun # Synced to Wine-1.7.27
reactos/dll/win32/secur32 # Forked
reactos/dll/win32/security # Forked (different .spec)
reactos/dll/win32/sensapi # Synced to Wine-1.7.17