static NS_DEFINE_IID( kNetSupportDialogCID, NS_NETSUPPORTDIALOG_CID); static NS_DEFINE_IID(kINetSupportDialogIID,   NS_INETSUPPORTDIALOGSERVICE_IID); result = nsServiceManager::GetService(kNetSupportDialogCID, kINetSupportDialogIID, (nsISupports**)&dialog); if ( !NS_SUCCEEDED( result ) )
nsresult rv;  NS_WITH_SERVICE(nsINetSupportDialogService, dialog, kNetSupportDialogCID, &rv);  if (NS_FAILED(rv))
nsresult nsDefaultProtocolHelper::HandleNotification(nsIBlockingNotification *aCaller,                                                     nsIURL *aUrl,                                                     PRInt32 aCode,                                                     void *aExtraInfo){  /* XXX this definition must match the one in network/protocol/http/mkhttp.c      this will go away as netlib cleanup continues */  typedef struct _NET_AuthClosure {    char * msg;    char * user;    char * pass;    void * _private;  } NET_AuthClosure;  NET_AuthClosure * auth_closure = (NET_AuthClosure *) aExtraInfo;  nsAutoString aText(auth_closure->msg);  nsAutoString aUser;  nsAutoString aPass(auth_closure->pass);  // create a dialog	PRBool bResult = PR_FALSE;	nsString password, user;	nsINetSupportDialogService* dialog = NULL; 	PRInt32 result;    /* this is so ugly, but ProgID->CLSID mapping seems to be broken -alecf */    static NS_DEFINE_IID( kNetSupportDialogCID, NS_NETSUPPORTDIALOG_CID);    static NS_DEFINE_IID(kINetSupportDialogIID,   NS_INETSUPPORTDIALOGSERVICE_IID);    result = nsServiceManager::GetService(kNetSupportDialogCID,                                    kINetSupportDialogIID,                                    (nsISupports**)&dialog);  	if ( !NS_SUCCEEDED( result ) ) 		return NS_ERROR_FAILURE;   if ( dialog )   	dialog->PromptUserAndPassword( aText, aUser, aPass, &result );                      if ( result == 1 )  	bResult =  NS_NOTIFY_SUCCEEDED;  else  	bResult = NS_ERROR_FAILURE;      nsServiceManager::ReleaseService(kNetSupportDialogCID, dialog);  auth_closure->user = aUser.ToNewCString();  auth_closure->pass = aPass.ToNewCString();  aCaller->Resume(aUrl, (void *) auth_closure);  return bResult;  // delete aUser;  // delete aPass;  // delete aText;  // dialog->Release();  return NS_NOTIFY_BLOCKED;}