hInstance = LoadLibrary(_T("KERNEL32"));
if (hInstance != NULL)
{
-#ifndef UNICODE
- pGetFreeDiskSpaceEx = GetProcAddress(hInstance,
- "GetDiskFreeSpaceExA");
+ pGetFreeDiskSpaceEx = (PGETFREEDISKSPACEEX)GetProcAddress(hInstance,
+#ifdef _UNICODE
+ _T("GetDiskFreeSpaceExW"));
#else
- pGetFreeDiskSpaceEx = GetProcAddress(hInstance,
- "GetDiskFreeSpaceExW");
+ _T("GetDiskFreeSpaceExA"));
#endif
if (pGetFreeDiskSpaceEx != NULL)
{
}
GetDiskFreeSpace(lpRoot,
- &dwSecPerCl,
- &dwBytPerSec,
- &dwFreeCl,
- &dwTotCl);
+ &dwSecPerCl,
+ &dwBytPerSec,
+ &dwFreeCl,
+ &dwTotCl);
lpFreeSpace->QuadPart = dwSecPerCl * dwBytPerSec * dwFreeCl;
}
ConvertULargeInteger (bytes, buffer, sizeof(buffer));
ConOutPrintf (_T(" %15s byte%c\n"),
buffer, bytes.QuadPart == 1 ? _T(' ') : _T('s'));
- ConOutPrintf (_T(" %I64u byte%c\n"),
- bytes.QuadPart, bytes.QuadPart == 1 ? _T(' ') : _T('s'));
if (IncLine (pLine, dwFlags))
return 1;
/* print file size */
if (file.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
- ConOutPrintf ("%-14s", "<DIR>");
+ ConOutPrintf (_T("%-14s"), _T("<DIR>"));
dircount++;
}
else
}
/* print long filename */
- ConOutPrintf (" %s\n", file.cFileName);
+ ConOutPrintf (_T(" %s\n"), file.cFileName);
}
if (IncLine (pLine, dwFlags))
if ((dwFlags & DIR_BARE) == 0)
{
- ConOutPrintf ("\n");
+ ConOutPrintf (_T("\n"));
if (IncLine (pLine, dwFlags) != 0)
return 1;
- ConOutPrintf ("\n");
+ ConOutPrintf (_T("\n"));
if (IncLine (pLine, dwFlags) != 0)
return 1;
}
/* default to current directory */
if (!param)
- param = ".";
+ param = _T(".");
/* parse the directory info */
if (DirParsePathspec (param, szPath, szFilespec))