Commit a1e8ba9f authored by Rein Klazes's avatar Rein Klazes Committed by Alexandre Julliard

In INT21_GetFreeDiskSpace adjust the sectors-per-cluster value to make

the total number of clusters fit in a 16 bit register.
parent f32a1053
......@@ -3397,6 +3397,12 @@ static int INT21_GetFreeDiskSpace( CONTEXT86 *context )
root[0] += INT21_MapDrive(DL_reg(context));
if (!GetDiskFreeSpaceW( root, &cluster_sectors, &sector_bytes,
&free_clusters, &total_clusters )) return 0;
/* make sure that the number of clusters fits in a 16 bits value */
while( total_clusters & 0xffff0000) {
cluster_sectors <<= 1;
free_clusters >>= 1;
total_clusters >>= 1;
}
SET_AX( context, cluster_sectors );
SET_BX( context, free_clusters );
SET_CX( context, sector_bytes );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment