nsIFileSpec* spec = NS_LocateFileOrDirectory( nsSpecialFileSpec::App_UserProfileDirectory50); if (!spec) return NS_ERROR_FAILURE;
nsIProfile* profileService = nsnull; nsresult rv = nsServiceManager::GetService( kProfileCID, nsIProfile::GetIID(), (nsISupports **)&profileService); if (NS_SUCCEEDED(rv)) { profileService->Startup(nsnull); int numProfiles = 0; profileService->GetProfileCount(&numProfiles); if (numProfiles < 1) { return NS_ERROR_FAILURE; } } else { return NS_ERROR_FAILURE; }   nsIFileSpec* spec = NS_LocateFileOrDirectory(nsSpecialFileSpec::App_UserProfileDirectory50); if (!spec) { return NS_ERROR_FAILURE; }
PUBLIC nsresult Wallet_ProfileDirectory(nsFileSpec& dirSpec) {  nsIFileSpec* spec = NS_LocateFileOrDirectory(  							nsSpecialFileSpec::App_UserProfileDirectory50);  if (!spec)  	return NS_ERROR_FAILURE;  return spec->GetFileSpec(&dirSpec);}