Nikolay Sivov : scrrun: Return float type size when signed I4 limit exceeded.

Alexandre Julliard julliard at winehq.org
Tue May 20 14:36:24 CDT 2014


Module: wine
Branch: master
Commit: f82cb7003338f4614582d429fc68cc1a2ad87bc1
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f82cb7003338f4614582d429fc68cc1a2ad87bc1

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Tue May 20 15:17:24 2014 +0400

scrrun: Return float type size when signed I4 limit exceeded.

---

 dlls/scrrun/filesystem.c       |    2 +-
 dlls/scrrun/tests/filesystem.c |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/dlls/scrrun/filesystem.c b/dlls/scrrun/filesystem.c
index 9412491..6473210 100644
--- a/dlls/scrrun/filesystem.c
+++ b/dlls/scrrun/filesystem.c
@@ -892,7 +892,7 @@ static HRESULT variant_from_largeint(const ULARGE_INTEGER *src, VARIANT *v)
 {
     HRESULT hr = S_OK;
 
-    if (src->HighPart)
+    if (src->HighPart || src->LowPart > INT_MAX)
     {
         V_VT(v) = VT_R8;
         hr = VarR8FromUI8(src->QuadPart, &V_R8(v));
diff --git a/dlls/scrrun/tests/filesystem.c b/dlls/scrrun/tests/filesystem.c
index 61cadb9..c06b43d 100644
--- a/dlls/scrrun/tests/filesystem.c
+++ b/dlls/scrrun/tests/filesystem.c
@@ -20,6 +20,7 @@
 
 #define COBJMACROS
 #include <stdio.h>
+#include <limits.h>
 
 #include "windows.h"
 #include "ole2.h"
@@ -1296,7 +1297,7 @@ static void test_DriveCollection(void)
             ok(hr == S_OK, "got 0x%08x\n", hr);
             ok(V_VT(&size) == VT_R8 || V_VT(&size) == VT_I4, "got %d\n", V_VT(&size));
             if (V_VT(&size) == VT_R8)
-                ok(V_R8(&size) > 0, "got %f\n", V_R8(&size));
+                ok(V_R8(&size) > (double)INT_MAX, "got %f\n", V_R8(&size));
             else
                 ok(V_I4(&size) > 0, "got %d\n", V_I4(&size));
 




More information about the wine-cvs mailing list