mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
RecycleManager.dll: Fixed disk error message in some cases
This commit is contained in:
parent
ff5fde4479
commit
fdcf133d86
@ -300,6 +300,8 @@ PLUGIN_EXPORT void ExecuteBang(void* data, LPCWSTR args)
|
|||||||
|
|
||||||
DWORD WINAPI QueryRecycleBinThreadProc(void* pParam)
|
DWORD WINAPI QueryRecycleBinThreadProc(void* pParam)
|
||||||
{
|
{
|
||||||
|
// NOTE: Do not use CRT function (since thread was created by CreateThread())!
|
||||||
|
|
||||||
SHQUERYRBINFO rbi = {0};
|
SHQUERYRBINFO rbi = {0};
|
||||||
rbi.cbSize = sizeof(SHQUERYRBINFO);
|
rbi.cbSize = sizeof(SHQUERYRBINFO);
|
||||||
SHQueryRecycleBin(NULL, &rbi);
|
SHQueryRecycleBin(NULL, &rbi);
|
||||||
@ -383,8 +385,16 @@ CRawString GetRecycleBinDirectory(WCHAR drive, bool& isFAT)
|
|||||||
WCHAR search[] = L"\0:\\";
|
WCHAR search[] = L"\0:\\";
|
||||||
search[0] = drive;
|
search[0] = drive;
|
||||||
|
|
||||||
|
// Prevent the system from displaying message box.
|
||||||
|
UINT oldMode = SetErrorMode(0);
|
||||||
|
SetErrorMode(oldMode | SEM_FAILCRITICALERRORS);
|
||||||
|
|
||||||
WCHAR filesystem[16];
|
WCHAR filesystem[16];
|
||||||
if (!GetVolumeInformation(search, NULL, 0, NULL, NULL, NULL, filesystem, _countof(filesystem)))
|
BOOL volumeResult = GetVolumeInformation(search, NULL, 0, NULL, NULL, NULL, filesystem, _countof(filesystem)));
|
||||||
|
|
||||||
|
SetErrorMode(oldMode);
|
||||||
|
|
||||||
|
if (!volumeResult)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user