+ return TRUE;
+}
+
+
+static VOID
+AddUserProfile(
+ _In_ HWND hwndListView,
+ _In_ PWSTR pszProfileSid,
+ _In_ PSID pProfileSid,
+ _In_ BOOL bMyProfile,
+ _In_ HKEY hProfileKey)
+{
+ WCHAR szTempProfilePath[MAX_PATH], szProfilePath[MAX_PATH];
+ WCHAR szNameBuffer[256];
+ PPROFILEDATA pProfileData = NULL;
+ DWORD dwProfileData, dwSize, dwType, dwState = 0;
+ DWORD dwProfilePathLength;
+ PWSTR ptr;
+ INT nId, iItem;
+ LV_ITEM lvi;
+ WIN32_FIND_DATA FindData;
+ HANDLE hFile;
+ SYSTEMTIME SystemTime;
+ DWORD dwError;
+
+ /* Get the profile path */
+ dwSize = MAX_PATH * sizeof(WCHAR);
+ dwError = RegQueryValueExW(hProfileKey,
+ L"ProfileImagePath",
+ NULL,
+ &dwType,
+ (LPBYTE)szTempProfilePath,
+ &dwSize);
+ if (dwError != ERROR_SUCCESS)
+ return;
+
+ /* Expand it */
+ ExpandEnvironmentStringsW(szTempProfilePath,
+ szProfilePath,
+ MAX_PATH);
+
+ /* Check if the profile path exists */
+ hFile = FindFirstFileW(szProfilePath, &FindData);
+ if (hFile == INVALID_HANDLE_VALUE)
+ return;
+
+ FindClose(hFile);
+
+ /* Get the length of the profile path */
+ dwProfilePathLength = wcslen(szProfilePath);
+
+ /* Check for the ntuser.dat file */
+ wcscat(szProfilePath, L"\\ntuser.dat");
+ hFile = FindFirstFileW(szProfilePath, &FindData);
+ if (hFile == INVALID_HANDLE_VALUE)
+ return;
+
+ FindClose(hFile);
+ szProfilePath[dwProfilePathLength] = UNICODE_NULL;
+
+ /* Get the profile name */
+ if (!GetProfileName(pProfileSid, ARRAYSIZE(szNameBuffer), szNameBuffer))
+ return;
+