I have the C:\Users\username\AppData\Roaming\Bitcoin folder as a soft link to a separate internal drive. This apparently caused an issue when trying to access another wallet. NTFS has created a hidden folder called System Volume Information on the root of the drive where the data directory is. When I try to open another wallet inside of Bitcoin-QT, it freezes up. The error I get in the log is ListWalletDir: Access is denied C:\Users\Linrono\AppData\Roaming\Bitcoin\System Volume Information. This shows up in the logs over and over until I force close Bitcoin-QT. It took up my entire 10MB log file at one point. I also tested this using bitcoind.exe and the same thing happens when running bitcoin-cli.exe getwalletdir. An easy fix for me would be to just create a folder in the volume and move my soft link to point there. I just wanted to bring this to your attention.

**Expected behavior**

I thought I would get a list of wallets I have created in the directory with the createwallet command.

**Actual behavior**

This caused a freeze that required the program to be force closed.

**To reproduce**

Just store the Bitcoin Data Directory in the root of a Windows Volume, and then try to find local wallets. This has happened to me every time I go to File and then mouse over Open Wallet or use the listwalletdir bitcoin-cli command.

**System information**

I am using Bitcoin Core v.20.1 from the BitcoinCore.org website.

Windows 10, Ryzen 5, Hard Drive

I believe this issue is related to the NTFS system folder on the root of volumes.

ListWalletDir: Access is denied C:\Users\Linrono\AppData\Roaming\Bitcoin\System Volume Information
{
    if (!fs::exists(path)) return false;
    
    boost::system::error_code ec;
    auto size = fs::file_size(path, ec);
    if (ec) LogPrintf("%s: %s %s\n", __func__, ec.message(), path.string());
    if (size < 512) return false;
    fsbridge::ifstream file(path, std::ios::binary);
    if (!file.is_open()) return false;
    
    char magic[16];
    file.read(magic, 16);
    
    file.seekg(68, std::ios::beg);
    char app_id[4];
    file.read(app_id, 4);
    file.close();
    
    std::string magic_str(magic, 16);
    if (magic_str != std::string("SQLite format 3", 16)) {
        return false;
    }
    
    return memcmp(Params().MessageStart(), app_id, 4) == 0;
}