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?