Abstractions.WindowsApi.pInvokes.GetUserProfileDir C# (CSharp) Method

GetUserProfileDir() public static method

returns userprofile based on GetUserProfileDirectory only if the ProfileList regkey is not of SID.bak (Abstractions.User.FixProfileList) empty string means error
public static GetUserProfileDir ( IntPtr hToken ) : string
hToken IntPtr
return string
        public static string GetUserProfileDir(IntPtr hToken)
        {
            string ret = "";
            StringBuilder path = new StringBuilder(260);
            uint path_size = Convert.ToUInt32(path.Capacity);

            if (SafeNativeMethods.GetUserProfileDirectory(hToken, path, ref path_size))
            {
                ret = path.ToString();
            }
            else
            {
                LibraryLogging.Error("GetUserProfileDirectory error:{0}", LastError());
            }

            return ret;
        }