mirror of
				https://github.com/chibicitiberiu/rainmeter-studio.git
				synced 2024-02-24 04:33:31 +00:00 
			
		
		
		
	FolderInfo: Fixed an issue that InfoType=FolderSize doesn't return a value larger than 4GB.
This commit is contained in:
		@@ -81,8 +81,8 @@ void FolderInfo::CalculateSize()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		do {
 | 
							do {
 | 
				
			||||||
			// special case for "." and ".."
 | 
								// special case for "." and ".."
 | 
				
			||||||
			if (_wcsicmp(findData.cFileName, L".") == 0 ||
 | 
								if (wcscmp(findData.cFileName, L".") == 0 ||
 | 
				
			||||||
				_wcsicmp(findData.cFileName, L"..") == 0) {
 | 
									wcscmp(findData.cFileName, L"..") == 0) {
 | 
				
			||||||
				continue;
 | 
									continue;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -33,7 +33,7 @@ extern "C"
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
	__declspec( dllexport ) UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id);
 | 
						__declspec( dllexport ) UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id);
 | 
				
			||||||
	__declspec( dllexport ) void Finalize(HMODULE instance, 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 ) UINT GetPluginVersion();
 | 
				
			||||||
	__declspec( dllexport ) LPCTSTR GetPluginAuthor();
 | 
						__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.
 | 
					  This function is called when new value should be measured.
 | 
				
			||||||
  The function returns the new value.
 | 
					  The function returns the new value.
 | 
				
			||||||
*/
 | 
					*/
 | 
				
			||||||
UINT Update(UINT id)
 | 
					double Update2(UINT id)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	MeasureInfo* measureInfo = sMeasures[id];
 | 
						MeasureInfo* measureInfo = sMeasures[id];
 | 
				
			||||||
	if (!measureInfo->Folder) {
 | 
						if (!measureInfo->Folder) {
 | 
				
			||||||
		return 0;
 | 
							return 0;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	int now = GetTickCount();
 | 
						DWORD now = GetTickCount();
 | 
				
			||||||
	if (now - measureInfo->Folder->GetLastUpdateTime() > UPDATE_TIME_MIN_MS) {
 | 
						if (now - measureInfo->Folder->GetLastUpdateTime() > UPDATE_TIME_MIN_MS) {
 | 
				
			||||||
		measureInfo->Folder->Update();
 | 
							measureInfo->Folder->Update();
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@@ -177,7 +177,7 @@ UINT Update(UINT id)
 | 
				
			|||||||
	switch (measureInfo->Type)
 | 
						switch (measureInfo->Type)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		case INFOTYPE_FOLDERSIZE:
 | 
							case INFOTYPE_FOLDERSIZE:
 | 
				
			||||||
			return (UINT)measureInfo->Folder->GetSize();
 | 
								return (double)measureInfo->Folder->GetSize();
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		case INFOTYPE_FILECOUNT:
 | 
							case INFOTYPE_FILECOUNT:
 | 
				
			||||||
			return measureInfo->Folder->GetFileCount();
 | 
								return measureInfo->Folder->GetFileCount();
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user