Commit c43985b2 authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

GetDiskFreeSpace needs to set the last error on failure.

parent a51ff76b
...@@ -1289,11 +1289,17 @@ BOOL WINAPI GetDiskFreeSpaceA( LPCSTR root, LPDWORD cluster_sectors, ...@@ -1289,11 +1289,17 @@ BOOL WINAPI GetDiskFreeSpaceA( LPCSTR root, LPDWORD cluster_sectors,
else else
if (path[0] == '\\') if (path[0] == '\\')
path++; path++;
if (strlen(path)) /* oops, we are in a subdir */ if (path[0]) /* oops, we are in a subdir */
{
SetLastError(ERROR_INVALID_NAME);
return FALSE; return FALSE;
} }
}
else else
{
SetLastError(ERROR_INVALID_NAME);
return FALSE; return FALSE;
}
if (!DRIVE_GetFreeSpace(drive, &size, &available)) return FALSE; if (!DRIVE_GetFreeSpace(drive, &size, &available)) return FALSE;
...@@ -1311,7 +1317,7 @@ BOOL WINAPI GetDiskFreeSpaceA( LPCSTR root, LPDWORD cluster_sectors, ...@@ -1311,7 +1317,7 @@ BOOL WINAPI GetDiskFreeSpaceA( LPCSTR root, LPDWORD cluster_sectors,
sec_size = (DRIVE_GetType(drive)==DRIVE_CDROM) ? 2048 : 512; sec_size = (DRIVE_GetType(drive)==DRIVE_CDROM) ? 2048 : 512;
size.s.LowPart /= sec_size; size.s.LowPart /= sec_size;
available.s.LowPart /= sec_size; available.s.LowPart /= sec_size;
/* fixme: probably have to adjust those variables too for CDFS */ /* FIXME: probably have to adjust those variables too for CDFS */
cluster_sec = 1; cluster_sec = 1;
while (cluster_sec * 65536 < size.s.LowPart) cluster_sec *= 2; while (cluster_sec * 65536 < size.s.LowPart) cluster_sec *= 2;
......
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