1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-15 14:14:47 +01:00

always enable GetDiskFreeSpace patch

This commit is contained in:
FunkyFr3sh 2022-10-16 00:02:43 +02:00
parent e4d6f712a4
commit 7abd1f743c
2 changed files with 8 additions and 10 deletions

View File

@ -372,7 +372,6 @@ static void cfg_create_ini()
"allow_wmactivate=false\n"
"dinputhook=false\n"
"flipclear=false\n"
"limit_disk_space=false\n"
"fixmousehook=false\n"
"bpp=0\n"
"\n"
@ -740,7 +739,6 @@ static void cfg_create_ini()
"; Fallout\n"
"[falloutw]\n"
"dinputhook=true\n"
"limit_disk_space=true\n"
"\n"
"; Fallout 2\n"
"[FALLOUT2]\n"

View File

@ -791,19 +791,19 @@ BOOL WINAPI fake_GetDiskFreeSpaceA(
lpNumberOfFreeClusters,
lpTotalNumberOfClusters);
if (cfg_get_bool("limit_disk_space", FALSE))
if (result && lpSectorsPerCluster && lpBytesPerSector && lpNumberOfFreeClusters)
{
if (lpSectorsPerCluster)
long long int free_bytes = (long long int)*lpNumberOfFreeClusters * *lpSectorsPerCluster * *lpBytesPerSector;
if (free_bytes >= 2147155968)
{
*lpSectorsPerCluster = 0x00000040;
if (lpBytesPerSector)
*lpBytesPerSector = 0x00000200;
if (lpNumberOfFreeClusters)
*lpNumberOfFreeClusters = 0x0000FFF6;
if (lpTotalNumberOfClusters)
*lpTotalNumberOfClusters = 0x0000FFF6;
if (lpTotalNumberOfClusters)
*lpTotalNumberOfClusters = 0x0000FFF6;
}
}
return result;