mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 17:34:57 +00:00
[SCRRUN]
* Sync with Wine 1.7.27. CORE-8540 svn path=/trunk/; revision=64601
This commit is contained in:
parent
6eaad90ebb
commit
91c1f8a294
2 changed files with 105 additions and 32 deletions
|
@ -875,6 +875,24 @@ static HRESULT WINAPI drive_get_RootFolder(IDrive *iface, IFolder **folder)
|
||||||
return E_NOTIMPL;
|
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)
|
static HRESULT WINAPI drive_get_AvailableSpace(IDrive *iface, VARIANT *v)
|
||||||
{
|
{
|
||||||
struct drive *This = impl_from_IDrive(iface);
|
struct drive *This = impl_from_IDrive(iface);
|
||||||
|
@ -888,8 +906,7 @@ static HRESULT WINAPI drive_get_AvailableSpace(IDrive *iface, VARIANT *v)
|
||||||
if (!GetDiskFreeSpaceExW(This->root, &avail, NULL, NULL))
|
if (!GetDiskFreeSpaceExW(This->root, &avail, NULL, NULL))
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
|
||||||
V_VT(v) = VT_R8;
|
return variant_from_largeint(&avail, v);
|
||||||
return VarR8FromUI8(avail.QuadPart, &V_R8(v));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI drive_get_FreeSpace(IDrive *iface, VARIANT *v)
|
static HRESULT WINAPI drive_get_FreeSpace(IDrive *iface, VARIANT *v)
|
||||||
|
@ -905,8 +922,7 @@ static HRESULT WINAPI drive_get_FreeSpace(IDrive *iface, VARIANT *v)
|
||||||
if (!GetDiskFreeSpaceExW(This->root, &freespace, NULL, NULL))
|
if (!GetDiskFreeSpaceExW(This->root, &freespace, NULL, NULL))
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
|
||||||
V_VT(v) = VT_R8;
|
return variant_from_largeint(&freespace, v);
|
||||||
return VarR8FromUI8(freespace.QuadPart, &V_R8(v));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI drive_get_TotalSize(IDrive *iface, VARIANT *v)
|
static HRESULT WINAPI drive_get_TotalSize(IDrive *iface, VARIANT *v)
|
||||||
|
@ -922,15 +938,25 @@ static HRESULT WINAPI drive_get_TotalSize(IDrive *iface, VARIANT *v)
|
||||||
if (!GetDiskFreeSpaceExW(This->root, NULL, &total, NULL))
|
if (!GetDiskFreeSpaceExW(This->root, NULL, &total, NULL))
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
|
||||||
V_VT(v) = VT_R8;
|
return variant_from_largeint(&total, v);
|
||||||
return VarR8FromUI8(total.QuadPart, &V_R8(v));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI drive_get_VolumeName(IDrive *iface, BSTR *name)
|
static HRESULT WINAPI drive_get_VolumeName(IDrive *iface, BSTR *name)
|
||||||
{
|
{
|
||||||
struct drive *This = impl_from_IDrive(iface);
|
struct drive *This = impl_from_IDrive(iface);
|
||||||
FIXME("(%p)->(%p): stub\n", This, name);
|
WCHAR nameW[MAX_PATH+1];
|
||||||
return E_NOTIMPL;
|
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)
|
static HRESULT WINAPI drive_put_VolumeName(IDrive *iface, BSTR name)
|
||||||
|
@ -943,15 +969,33 @@ static HRESULT WINAPI drive_put_VolumeName(IDrive *iface, BSTR name)
|
||||||
static HRESULT WINAPI drive_get_FileSystem(IDrive *iface, BSTR *fs)
|
static HRESULT WINAPI drive_get_FileSystem(IDrive *iface, BSTR *fs)
|
||||||
{
|
{
|
||||||
struct drive *This = impl_from_IDrive(iface);
|
struct drive *This = impl_from_IDrive(iface);
|
||||||
FIXME("(%p)->(%p): stub\n", This, fs);
|
WCHAR nameW[MAX_PATH+1];
|
||||||
return E_NOTIMPL;
|
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)
|
static HRESULT WINAPI drive_get_SerialNumber(IDrive *iface, LONG *serial)
|
||||||
{
|
{
|
||||||
struct drive *This = impl_from_IDrive(iface);
|
struct drive *This = impl_from_IDrive(iface);
|
||||||
FIXME("(%p)->(%p): stub\n", This, serial);
|
BOOL ret;
|
||||||
return E_NOTIMPL;
|
|
||||||
|
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)
|
static HRESULT WINAPI drive_get_IsReady(IDrive *iface, VARIANT_BOOL *ready)
|
||||||
|
@ -1073,7 +1117,7 @@ static HANDLE start_enumeration(const WCHAR *path, WIN32_FIND_DATAW *data, BOOL
|
||||||
|
|
||||||
strcpyW(pathW, path);
|
strcpyW(pathW, path);
|
||||||
len = strlenW(pathW);
|
len = strlenW(pathW);
|
||||||
if (pathW[len-1] != '\\')
|
if (len && pathW[len-1] != '\\')
|
||||||
strcatW(pathW, bsW);
|
strcatW(pathW, bsW);
|
||||||
strcatW(pathW, allW);
|
strcatW(pathW, allW);
|
||||||
handle = FindFirstFileW(pathW, data);
|
handle = FindFirstFileW(pathW, data);
|
||||||
|
@ -1818,8 +1862,32 @@ static HRESULT WINAPI filecoll_get__NewEnum(IFileCollection *iface, IUnknown **p
|
||||||
static HRESULT WINAPI filecoll_get_Count(IFileCollection *iface, LONG *count)
|
static HRESULT WINAPI filecoll_get_Count(IFileCollection *iface, LONG *count)
|
||||||
{
|
{
|
||||||
struct filecollection *This = impl_from_IFileCollection(iface);
|
struct filecollection *This = impl_from_IFileCollection(iface);
|
||||||
FIXME("(%p)->(%p)\n", This, count);
|
static const WCHAR allW[] = {'\\','*',0};
|
||||||
return E_NOTIMPL;
|
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 = {
|
static const IFileCollectionVtbl filecollectionvtbl = {
|
||||||
|
@ -2583,6 +2651,7 @@ static HRESULT WINAPI file_get_DateLastAccessed(IFile *iface, DATE *pdate)
|
||||||
static HRESULT WINAPI file_get_Size(IFile *iface, VARIANT *pvarSize)
|
static HRESULT WINAPI file_get_Size(IFile *iface, VARIANT *pvarSize)
|
||||||
{
|
{
|
||||||
struct file *This = impl_from_IFile(iface);
|
struct file *This = impl_from_IFile(iface);
|
||||||
|
ULARGE_INTEGER size;
|
||||||
WIN32_FIND_DATAW fd;
|
WIN32_FIND_DATAW fd;
|
||||||
HANDLE f;
|
HANDLE f;
|
||||||
|
|
||||||
|
@ -2596,14 +2665,10 @@ static HRESULT WINAPI file_get_Size(IFile *iface, VARIANT *pvarSize)
|
||||||
return create_error(GetLastError());
|
return create_error(GetLastError());
|
||||||
FindClose(f);
|
FindClose(f);
|
||||||
|
|
||||||
if(fd.nFileSizeHigh || fd.nFileSizeLow>INT_MAX) {
|
size.u.LowPart = fd.nFileSizeLow;
|
||||||
V_VT(pvarSize) = VT_R8;
|
size.u.HighPart = fd.nFileSizeHigh;
|
||||||
V_R8(pvarSize) = ((ULONGLONG)fd.nFileSizeHigh<<32) + fd.nFileSizeLow;
|
|
||||||
}else {
|
return variant_from_largeint(&size, pvarSize);
|
||||||
V_VT(pvarSize) = VT_I4;
|
|
||||||
V_I4(pvarSize) = fd.nFileSizeLow;
|
|
||||||
}
|
|
||||||
return S_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI file_get_Type(IFile *iface, BSTR *pbstrType)
|
static HRESULT WINAPI file_get_Type(IFile *iface, BSTR *pbstrType)
|
||||||
|
@ -2708,9 +2773,6 @@ static HRESULT create_file(BSTR path, IFile **file)
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(path[len-1]=='/' || path[len-1]=='\\')
|
|
||||||
path[len-1] = 0;
|
|
||||||
|
|
||||||
attrs = GetFileAttributesW(f->path);
|
attrs = GetFileAttributesW(f->path);
|
||||||
if(attrs==INVALID_FILE_ATTRIBUTES ||
|
if(attrs==INVALID_FILE_ATTRIBUTES ||
|
||||||
(attrs&(FILE_ATTRIBUTE_DIRECTORY|FILE_ATTRIBUTE_DEVICE))) {
|
(attrs&(FILE_ATTRIBUTE_DIRECTORY|FILE_ATTRIBUTE_DEVICE))) {
|
||||||
|
@ -2891,12 +2953,19 @@ static HRESULT WINAPI filesys_BuildPath(IFileSystem3 *iface, BSTR Path,
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI filesys_GetDriveName(IFileSystem3 *iface, BSTR Path,
|
static HRESULT WINAPI filesys_GetDriveName(IFileSystem3 *iface, BSTR path, BSTR *drive)
|
||||||
BSTR *pbstrResult)
|
|
||||||
{
|
{
|
||||||
FIXME("%p %s %p\n", iface, debugstr_w(Path), pbstrResult);
|
TRACE("(%p)->(%s %p)\n", iface, debugstr_w(path), drive);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
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)
|
static inline DWORD get_parent_folder_name(const WCHAR *path, DWORD len)
|
||||||
|
@ -3644,11 +3713,15 @@ static HRESULT WINAPI filesys_GetFileVersion(IFileSystem3 *iface, BSTR name, BST
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = VerQueryValueW(ptr, rootW, (void**)&info, &len);
|
ret = VerQueryValueW(ptr, rootW, (void**)&info, &len);
|
||||||
heap_free(ptr);
|
|
||||||
if (!ret)
|
if (!ret)
|
||||||
|
{
|
||||||
|
heap_free(ptr);
|
||||||
return HRESULT_FROM_WIN32(GetLastError());
|
return HRESULT_FROM_WIN32(GetLastError());
|
||||||
|
}
|
||||||
|
|
||||||
get_versionstring(info, ver);
|
get_versionstring(info, ver);
|
||||||
|
heap_free(ptr);
|
||||||
|
|
||||||
*version = SysAllocString(ver);
|
*version = SysAllocString(ver);
|
||||||
TRACE("version=%s\n", debugstr_w(ver));
|
TRACE("version=%s\n", debugstr_w(ver));
|
||||||
|
|
||||||
|
|
|
@ -176,7 +176,7 @@ reactos/dll/win32/rsabase # Synced to Wine-1.7.17
|
||||||
reactos/dll/win32/rsaenh # Synced to Wine-1.7.27
|
reactos/dll/win32/rsaenh # Synced to Wine-1.7.27
|
||||||
reactos/dll/win32/sccbase # Synced to Wine-1.7.17
|
reactos/dll/win32/sccbase # Synced to Wine-1.7.17
|
||||||
reactos/dll/win32/schannel # Synced to Wine-1.7.27
|
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/secur32 # Forked
|
||||||
reactos/dll/win32/security # Forked (different .spec)
|
reactos/dll/win32/security # Forked (different .spec)
|
||||||
reactos/dll/win32/sensapi # Synced to Wine-1.7.17
|
reactos/dll/win32/sensapi # Synced to Wine-1.7.17
|
||||||
|
|
Loading…
Reference in a new issue