NS_WITH_SERVICE(nsIAppShellService, appshellservice, kAppShellServiceCID, &rv); if(NS_FAILED(rv)) {
NS_WITH_SERVICE(nsIPrompt, dialog, kNetSupportDialogCID, &rv); if (NS_FAILED(rv)) {
si_SelectDialog(const PRUnichar* szMessage, PRUnichar** pList, PRInt32* pCount) {  if (si_UserHasBeenSelected) {    /* a user was already selected for this form, use same one again */    *pCount = 0; /* last user selected is now at head of list */    return PR_TRUE;  }  nsresult rv;  NS_WITH_SERVICE(nsIAppShellService, appshellservice, kAppShellServiceCID, &rv);  if(NS_FAILED(rv)) {    return PR_FALSE;  }  nsCOMPtr<nsIXULWindow> xulWindow;  appshellservice->GetHiddenWindow(getter_AddRefs(xulWindow));  nsCOMPtr<nsIPrompt> prompter(do_QueryInterface(xulWindow));  PRInt32 selectedIndex;  PRBool rtnValue;  PRUnichar * title_string = Wallet_Localize("SelectUserTitleLine");  rv = prompter->Select( title_string, szMessage, *pCount, NS_CONST_CAST(const PRUnichar**, pList), &selectedIndex, &rtnValue );  Recycle(title_string);  *pCount = selectedIndex;  si_UserHasBeenSelected = PR_TRUE;  return rtnValue;  }