Nikolay Sivov : scrrun: Use existing helper to return file size.
Alexandre Julliard
julliard at winehq.org
Wed May 21 13:39:23 CDT 2014
Module: wine
Branch: master
Commit: 05a80d0f189c199d13fb23ef8af619c8d701a612
URL: http://source.winehq.org/git/wine.git/?a=commit;h=05a80d0f189c199d13fb23ef8af619c8d701a612
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Tue May 20 15:27:34 2014 +0400
scrrun: Use existing helper to return file size.
---
dlls/scrrun/filesystem.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/dlls/scrrun/filesystem.c b/dlls/scrrun/filesystem.c
index 6473210..94b8083 100644
--- a/dlls/scrrun/filesystem.c
+++ b/dlls/scrrun/filesystem.c
@@ -2635,6 +2635,7 @@ static HRESULT WINAPI file_get_DateLastAccessed(IFile *iface, DATE *pdate)
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;
@@ -2648,14 +2649,10 @@ static HRESULT WINAPI file_get_Size(IFile *iface, VARIANT *pvarSize)
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.LowPart = fd.nFileSizeLow;
+ size.HighPart = fd.nFileSizeHigh;
+
+ return variant_from_largeint(&size, pvarSize);
}
static HRESULT WINAPI file_get_Type(IFile *iface, BSTR *pbstrType)
More information about the wine-cvs
mailing list