FolderInfo: Fixed an issue that InfoType=FolderSize doesn't return a value larger than 4GB.

This commit is contained in:
spx 2011-07-11 05:35:15 +00:00
parent a74ee23da3
commit c776cff348
2 changed files with 6 additions and 6 deletions

View File

@ -81,8 +81,8 @@ void FolderInfo::CalculateSize()
do {
// special case for "." and ".."
if (_wcsicmp(findData.cFileName, L".") == 0 ||
_wcsicmp(findData.cFileName, L"..") == 0) {
if (wcscmp(findData.cFileName, L".") == 0 ||
wcscmp(findData.cFileName, L"..") == 0) {
continue;
}

View File

@ -33,7 +33,7 @@ extern "C"
{
__declspec( dllexport ) UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id);
__declspec( dllexport ) void Finalize(HMODULE instance, UINT id);
__declspec( dllexport ) UINT Update(UINT id);
__declspec( dllexport ) double Update2(UINT id);
__declspec( dllexport ) UINT GetPluginVersion();
__declspec( dllexport ) LPCTSTR GetPluginAuthor();
}
@ -162,14 +162,14 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
This function is called when new value should be measured.
The function returns the new value.
*/
UINT Update(UINT id)
double Update2(UINT id)
{
MeasureInfo* measureInfo = sMeasures[id];
if (!measureInfo->Folder) {
return 0;
}
int now = GetTickCount();
DWORD now = GetTickCount();
if (now - measureInfo->Folder->GetLastUpdateTime() > UPDATE_TIME_MIN_MS) {
measureInfo->Folder->Update();
}
@ -177,7 +177,7 @@ UINT Update(UINT id)
switch (measureInfo->Type)
{
case INFOTYPE_FOLDERSIZE:
return (UINT)measureInfo->Folder->GetSize();
return (double)measureInfo->Folder->GetSize();
break;
case INFOTYPE_FILECOUNT:
return measureInfo->Folder->GetFileCount();