mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-03 22:03:01 +01:00
Bugfix: Check return value of SHGetSpecialFolderPath in MyGetSpecialFolderPath
Upstream commit: 21ae37d (partial)
This commit is contained in:
@@ -643,13 +643,17 @@ string MyGetSpecialFolderPath(int nFolder, bool fCreate)
|
||||
{
|
||||
PSHGETSPECIALFOLDERPATHA pSHGetSpecialFolderPath =
|
||||
(PSHGETSPECIALFOLDERPATHA)GetProcAddress(hShell32, "SHGetSpecialFolderPathA");
|
||||
bool fSuccess = false;
|
||||
if (pSHGetSpecialFolderPath)
|
||||
fSuccess =
|
||||
(*pSHGetSpecialFolderPath)(NULL, pszPath, nFolder, fCreate);
|
||||
FreeModule(hShell32);
|
||||
if (fSuccess)
|
||||
return pszPath;
|
||||
}
|
||||
|
||||
// Backup option
|
||||
if (pszPath[0] == '\0')
|
||||
pszPath[0] = '\0';
|
||||
{
|
||||
if (nFolder == CSIDL_STARTUP)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user