<div dir="ltr">The problem is that it requires TOKEN_IMPERSONATE, which will require you to provide login credentials.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Aug 1, 2014 at 10:33 AM, Aaron Ballman <span dir="ltr"><<a href="mailto:aaron@aaronballman.com" target="_blank">aaron@aaronballman.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Thu, Jul 31, 2014 at 8:42 PM, Zachary Turner <<a href="mailto:zturner@google.com">zturner@google.com</a>> wrote:<br>

> Hi rnk,<br>
><br>
> llvm::sys::path already provides a function home_directory() which returns the current user's home directory.<br>
><br>
> This patch extends this by implementing a function which returns the home directory of an arbitrary user.  This satisfies a use case in LLDB where we need to resolve paths of the form ~username/path, and since it is similar in nature to the existing home_directory() function, seems generally useful for llvm<br>

><br>
> <a href="http://reviews.llvm.org/D4749" target="_blank">http://reviews.llvm.org/D4749</a><br>
><br>
> Files:<br>
>   include/llvm/Support/Path.h<br>
>   lib/Support/Unix/Path.inc<br>
>   lib/Support/Windows/Path.inc<br>
<br>
</div></div>Instead of trawling the registry (which is fragile and subject to<br>
change), I would feel *way* more comfortable using the designated API<br>
for this sort of thing (SHGetKnownFolderPath). It accepts a token<br>
which you can use to impersonate a particular user.<br>
<br>
<a href="http://msdn.microsoft.com/en-us/library/windows/desktop/bb762188.aspx" target="_blank">http://msdn.microsoft.com/en-us/library/windows/desktop/bb762188.aspx</a><br>
<span class="HOEnZb"><font color="#888888"><br>
~Aaron<br>
</font></span></blockquote></div><br></div>