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

This commit is contained in:
Pierre Schweitzer 2017-10-04 22:30:18 +02:00
parent 5bee374c82
commit 87448f3d8b

View file

@ -189,19 +189,24 @@ GetDiskFreeSpaceA(IN LPCSTR lpRootPathName,
OUT LPDWORD lpNumberOfFreeClusters,
OUT LPDWORD lpTotalNumberOfClusters)
{
PWCHAR RootPathNameW=NULL;
PCSTR RootPath;
PUNICODE_STRING RootPathU;
if (lpRootPathName)
RootPath = lpRootPathName;
if (RootPath == NULL)
{
if (!(RootPathNameW = FilenameA2W(lpRootPathName, FALSE)))
return FALSE;
RootPath = "\\";
}
return GetDiskFreeSpaceW (RootPathNameW,
lpSectorsPerCluster,
lpBytesPerSector,
lpNumberOfFreeClusters,
lpTotalNumberOfClusters);
RootPathU = Basep8BitStringToStaticUnicodeString(RootPath);
if (RootPathU == NULL)
{
return FALSE;
}
return GetDiskFreeSpaceW(RootPathU->Buffer, lpSectorsPerCluster,
lpBytesPerSector, lpNumberOfFreeClusters,
lpTotalNumberOfClusters);
}
/*