rv = dialogs->SetPassword(ctx, tokenName.get(), &canceled);
{ nsPSMUITracker tracker; if (tracker.isUIForbidden()) { rv = NS_ERROR_NOT_AVAILABLE; } else { rv = dialogs->SetPassword(ctx, tokenName.get(), &canceled); } }
setPassword(PK11SlotInfo *slot, nsIInterfaceRequestor *ctx){  nsresult rv = NS_OK;    if (PK11_NeedUserInit(slot)) {    nsITokenPasswordDialogs *dialogs;    PRBool canceled;    NS_ConvertUTF8toUCS2 tokenName(PK11_GetTokenName(slot));    rv = getNSSDialogs((void**)&dialogs,                       NS_GET_IID(nsITokenPasswordDialogs),                       NS_TOKENPASSWORDSDIALOG_CONTRACTID);    if (NS_FAILED(rv)) goto loser;    rv = dialogs->SetPassword(ctx,                              tokenName.get(),                              &canceled);    NS_RELEASE(dialogs);    if (NS_FAILED(rv)) goto loser;    if (canceled) { rv = NS_ERROR_NOT_AVAILABLE; goto loser; }  } loser:  return rv;}