Failure to Assess File Permissions Via SMB on Windows

Recently had a user report that our app was refusing to load audio files from their SMB network drive, and complaining about “bad permissions.” When I reproduced the issue locally, it appears that any file on an SMB drive will return false for File::hasReadAccess and File::hasWriteAccess. Upon removing the permissions check in our code, the file was able to be read without a problem (specifically, a FileInputStream opens without error). I’m also able to manipulate and delete these files in File Explorer.

I dug into the source and all I could suss out is that the AccessCheck() call being performed is setting AccessStatus to FALSE. I tried to do more reading into this to see if there are any caveats to access-checking when using shared network drives, but my familiarity with the Windows APIs is pretty poor. The closest thing I’ve found is this StackOverflow post.

I have a solution that should patch the issue for our user, but I still wanted to report this because I think this might be a bug (or I’m missing some rather obvious step for interfacing with shared network files).