title: How to check whether the target of a directory symbolic link exists?
body: <p>I'm developing a Windows application that targets Windows XP.</p>
  
  <p>My app needs to resolve symbolic links to files and folders. To check whether the target exists, I can use <code>CreateFile</code> for symbolic links to files. But after I searched Google and MSDN for a whole day, I found that if I need to get the handle of a directory, I need to use the flag <code>FILE_FLAG_BACKUP_SEMANTICS</code>. This requires my application to request higher privileges. I know many users are not happy with this behavior, so I need to find another way to check whether the target of a directory symbolic link exists.</p>
  
  <p>I have also read <a href="https://docs.microsoft.com/en-us/windows/desktop/fileio/symbolic-link-effects-on-file-systems-functions" rel="nofollow noreferrer">Symbolic Link Effects on File Systems Functions</a>. The other functions I can use to test for the existence of a file or directory all check the symbolic link itself, not its target. I have tried some functions like <code>_access_s</code>. They also only check the symbolic link itself.</p>
  
  <p>So my question is whether there is any way to check whether the target of a directory symbolic link exists without requiring higher privileges.</p>