[KERNEL32]: Reimplement GetDiskFreeSpaceExA() to make it w2k3 compliant

This commit is contained in:
Pierre Schweitzer 2017-10-04 23:02:22 +02:00
parent 1e2424ee98
commit 8b6518139d

View file

@ -359,18 +359,23 @@ GetDiskFreeSpaceExA(IN LPCSTR lpDirectoryName OPTIONAL,
OUT PULARGE_INTEGER lpTotalNumberOfBytes,
OUT PULARGE_INTEGER lpTotalNumberOfFreeBytes)
{
PWCHAR DirectoryNameW=NULL;
PCSTR RootPath;
PUNICODE_STRING RootPathU;
if (lpDirectoryName)
RootPath = lpDirectoryName;
if (RootPath == NULL)
{
if (!(DirectoryNameW = FilenameA2W(lpDirectoryName, FALSE)))
return FALSE;
RootPath = "\\";
}
return GetDiskFreeSpaceExW (DirectoryNameW ,
lpFreeBytesAvailableToCaller,
lpTotalNumberOfBytes,
lpTotalNumberOfFreeBytes);
RootPathU = Basep8BitStringToStaticUnicodeString(RootPath);
if (RootPathU == NULL)
{
return FALSE;
}
return GetDiskFreeSpaceExW(RootPathU->Buffer, lpFreeBytesAvailableToCaller,
lpTotalNumberOfBytes, lpTotalNumberOfFreeBytes);
}
/*