1

I need to figure out if a given (UNC) path actually points/ends/is the given path (directory).

Example: "\?\UNC\machine1\shared1". GetFinalPathNameByHandle will result in "\?\UNC\machine1\shared1".

However, if there's a symlink "sym" inside shared1 and the given path is "\?\UNC\machine1\shared1\sym", having "sym" be created with mklink and pointing to "\machine2\shared2", the result given by GetFinalPathNameByHandle is "\?\UNC\machine2\shared2".

Now, we have a QNAP NAS, with "home" folders enabled - meaning that each domain user, when navigating to "\nas\home", will end up in its own directory. GetFinalPathNameByHandle for "\?\UNC\nas\home" results in "\?\UNC\nas\home", while I would need to get my hands on the actual directory name, like "\?\UNC\nas\homes\user_name". I do not need to read/write - I just need to know that "\?\UNC\nas\home" is really not "\?\UNC\nas\home".

This idea then propagates to any similar scenarios when "\machine\folder" ends up somewhere else (per user). Say I do not even need to know where does it really end, just that there's some kind of reparsing happening...

Any ideas?

  • "*I just need to know that "\?\UNC\nas\home" is really not "\?\UNC\nas\home"*" - sounds like something the NAS handles internally and doesn't expose to the filesystem. If you navigate to `"\?\UNC\nas\home"` in Windows Explorer, do you see it actually navigate to `"\?\UNC\nas\homes\user_name"`, or does it continue to show `"\?\UNC\nas\home"`? – Remy Lebeau Jan 26 '21 at 17:16
  • It continues to show the entered path (does not expand). Yes, I would say handles internally. – Žarko Gajić Jan 26 '21 at 17:23
  • Well, then there is likely nothing you can do to get what you are looking for, since the info you want is not being exposed to Windows, it is being hidden inside the NAS's implementation. – Remy Lebeau Jan 26 '21 at 17:43
  • Ah :( Then this calls for a new question "how to detect '\\nas\' is (qnap) NAS and how to know "home" folder is enabled" :) – Žarko Gajić Jan 26 '21 at 18:04

0 Answers0