Akihiro Sagawa : krnl386.exe: Cap GetFreeSpace value to 2GB.

Alexandre Julliard julliard at winehq.org
Mon Jun 7 15:02:06 CDT 2021


Module: wine
Branch: stable
Commit: 0dc595d4e1ee612be0157bde8b27c7308b524091
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=0dc595d4e1ee612be0157bde8b27c7308b524091

Author: Akihiro Sagawa <sagawa.aki at gmail.com>
Date:   Sat Feb 20 21:26:27 2021 +0900

krnl386.exe: Cap GetFreeSpace value to 2GB.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46962
Signed-off-by: Akihiro Sagawa <sagawa.aki at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit eca2bfd071ea2142f5c4126badb5bcf923a9a655)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 dlls/krnl386.exe16/global.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/krnl386.exe16/global.c b/dlls/krnl386.exe16/global.c
index e66007784ee..0a8da28e99b 100644
--- a/dlls/krnl386.exe16/global.c
+++ b/dlls/krnl386.exe16/global.c
@@ -750,7 +750,7 @@ DWORD WINAPI GetFreeSpace16( UINT16 wFlags )
 {
     MEMORYSTATUS ms;
     GlobalMemoryStatus( &ms );
-    return ms.dwAvailVirtual;
+    return min( ms.dwAvailVirtual, MAXLONG );
 }
 
 /***********************************************************************




More information about the wine-cvs mailing list