Bitcoin Core crashes when trying to open a wallet on Windows because your application logic is nonsensical. When Bitcoin Core was installed, I chose the root level of a dedicated volume (E:) for Bitcoin to store its data on. When I go to open a new wallet, it pegs one CPU core to 100%. Looking at the debug log, it is repeatedly trying to access E:\System Volume Information, and is getting an access denied message because this user doesnt have administrative rights, so it cant access this directory. Your application shouldnt be accessing this directory just to present an open file dialog, and it should be smart enough to throw an exception with an error message to the user and not get stuck in an infinite loop if it encounters problems with file permissions.
paths.emplace_back();
                } else {
                    
                    
                    
                    
                    paths.emplace_back(path);
                }
            }
        } catch (const std::exception& e) {
            LogPrintf("%s: Error scanning %s: %s\n", __func__, it->path().string(), e.what());
            it.no_push();
        }
    }
    return paths;
}
fs::path BDBDataFile(const fs::path& wallet_path)
{
    if (fs::is_regular_file(wallet_path)) {
        
        
        
        return wallet_path;
    } else {
        
        
        return wallet_path / "wallet.dat";
    }
}
fs::path SQLiteDataFile(const fs::path& path)