FIX: Don't show Windows error dialog when cannot retrieve drive free space.

This commit is contained in:
cobines 2010-01-06 22:57:35 +00:00
commit a8e2f4e2aa

View file

@ -589,9 +589,12 @@ end;
{$ELSE}
var
wPath: WideString;
OldErrorMode: Word;
begin
wPath:= UTF8Decode(Path);
OldErrorMode:= SetErrorMode(SEM_FAILCRITICALERRORS or SEM_NOOPENFILEERRORBOX);
Result:= GetDiskFreeSpaceExW(PWChar(wPath), FreeSize, TotalSize, nil);
SetErrorMode(OldErrorMode);
end;
{$ENDIF}