if (szDefaultProfile) {  nsAutoString newProfileName; newProfileName.AssignWithConversion(szDefaultProfile); rv = profileService->CreateNewProfile(newProfileName.get(), nsnull, nsnull, PR_FALSE); if (NS_FAILED(rv)) return FALSE; rv = profileService->SetCurrentProfile(newProfileName.get()); if (NS_FAILED(rv)) return FALSE; return TRUE; }
BOOL ChooseNewProfile(BOOL bShowForMultipleProfilesOnly){    nsresult rv;    NS_WITH_SERVICE(nsIProfile, profileService, NS_PROFILE_CONTRACTID, &rv);    if (NS_FAILED(rv))    {        return FALSE;    }                                                                                     PRInt32 profileCount = 0;    rv = profileService->GetProfileCount(&profileCount);    if (profileCount == 0)    {        // TODO ask them if they wish to create a default profile        // NS_NAMED_LITERAL_STRING(newProfileName, "default");        // rv = profileService->CreateNewProfile(newProfileName, nsnull, nsnull, PR_FALSE);        // rv = profileService->SetCurrentProfile(newProfileName);        return TRUE;    }    else if (profileCount == 1 && bShowForMultipleProfilesOnly)    {        // TODO Select the one and only profile and return        return TRUE;    }    INT nResult;    nResult = DialogBox(ghInstanceResources, (LPCTSTR)IDD_CHOOSEPROFILE, NULL, (DLGPROC)ChooseProfileDlgProc);    return TRUE;}