-Bug Fixes

This commit is contained in:
lsreevatsa 2006-03-08 13:12:56 +00:00
parent b84d53afb8
commit 6f6109b488

View File

@ -151,6 +151,9 @@ public class HostElement
[DllImport("libad_ff.so.1.1.1")] [DllImport("libad_ff.so.1.1.1")]
public static extern int FPM_FirefoxProfileInit(string profileName); public static extern int FPM_FirefoxProfileInit(string profileName);
[DllImport("libad_ff.so.1.1.1")]
public static extern int FPM_IsStoreAvailable();
[DllImport("libad_ff.so.1.1.1")] [DllImport("libad_ff.so.1.1.1")]
public static extern int FPM_FirefoxProfileExit(string profileName); public static extern int FPM_FirefoxProfileExit(string profileName);
@ -169,6 +172,10 @@ public class HostElement
//int FPM_AddHost(char *profileName, struct Host *host, int doUpdate) //int FPM_AddHost(char *profileName, struct Host *host, int doUpdate)
//int FPM_ModifyHost(char *profileName, struct Host *host, int doUpdate) //int FPM_ModifyHost(char *profileName, struct Host *host, int doUpdate)
//int FPM_RemoveHost(char *profileName, char *hostname, int doUpdate) //int FPM_RemoveHost(char *profileName, char *hostname, int doUpdate)
public static int IsStoreAvailable()
{
return FPM_IsStoreAvailable();
}
//-------------------------------------------------------------- //--------------------------------------------------------------
@ -193,15 +200,18 @@ public class HostElement
profCount=FPM_GetProfileList(out profileListIntPtr,out profileFlagsIntPtr); profCount=FPM_GetProfileList(out profileListIntPtr,out profileFlagsIntPtr);
//Console.WriteLine("FireFox:No of Profiles found= "+profCount); //Console.WriteLine("FireFox:No of Profiles found= "+profCount);
for(int i=0; i< profCount; i++) //try
{ ///{
profileName=Marshal.PtrToStringAnsi(profileListIntPtr[i]); for(int i=0; i< profCount; i++)
profileFlag=(int)profileFlagsIntPtr[i]; {
//Console.WriteLine("FireFox:Iter="+i+"profileName="+profileName); //Console.WriteLine("Firefox.cs : Inside The for Loop");
//Console.WriteLine("FireFox:Iter="+i+"profileFlag="+profileFlag); profileName=Marshal.PtrToStringAnsi(profileListIntPtr[i]);
if(profileFlag==1) profileFlag=(int)profileFlagsIntPtr[i];
defaultProfileName=profileName; //Get the default profile name to init later //Console.WriteLine("FireFox:Iter="+i+"profileName="+profileName);
} //Console.WriteLine("FireFox:Iter="+i+"profileFlag="+profileFlag);
if(profileFlag==1)
defaultProfileName=profileName; //Get the default profile name to init later
}
return defaultProfileName; return defaultProfileName;
@ -237,10 +247,8 @@ public class HostElement
Host hostList; // = new Host(); - NOT NEEDED SINCE WE GET THIS FILLED FROM NATIVE WHEN Host hostList; // = new Host(); - NOT NEEDED SINCE WE GET THIS FILLED FROM NATIVE WHEN
// WE MARSHAL PTR TO STRUCTURE // WE MARSHAL PTR TO STRUCTURE
int methodStatusCode=-1; int methodStatusCode=-1;
String defaultProfileName = null;
//Console.WriteLine("FireFox:Initializing the Profile "+profileName); int initProfileStatus = -1;
//methodStatusCode=InitProfile(profileName);
//Console.WriteLine("FireFox:InitProfile returned "+methodStatusCode);
//if(methodStatusCode==1) //if(methodStatusCode==1)
{//If Init of the profile was sucessfull, get the sigon data to complete the aggregation {//If Init of the profile was sucessfull, get the sigon data to complete the aggregation
@ -252,32 +260,31 @@ public class HostElement
methodStatusCode = FPM_GetSignonData(profileName,out hostListIntPtr,LOAD_PROFILE_ALWAYSFROM_FILE); methodStatusCode = FPM_GetSignonData(profileName,out hostListIntPtr,LOAD_PROFILE_ALWAYSFROM_FILE);
if( 1 != methodStatusCode ) if( 1 != methodStatusCode )
{ {
//Console.WriteLine("FireFox:Getting Data for profile Failed with error "+methodStatusCode); Console.WriteLine("FireFox:Getting Data for profile Failed with error "+methodStatusCode);
hostList = null; hostList=null;
} return hostList;
}
} hostList = null;
hostList = (Host)Marshal.PtrToStructure(hostListIntPtr, typeof(Host));
//This can be Null only when nothing is aggregated.
if (((String)Marshal.PtrToStringAnsi(hostList.hostName)) == null )
{
//TBD: Log that there are no secrets to aggregate
//Console.WriteLine("FireFox:no secrets to aggregate");
hostList = null;
}
}
catch(Exception e) catch(Exception e)
{ {
Console.WriteLine("FireFox:Exception during invokation of FPM_GetSignonData"); //Console.WriteLine("FireFox:Exception during invokation of FPM_GetSignonData");
//Console.WriteLine(e.ToString()); //Console.WriteLine(e.ToString());
hostList = null; hostList = null;
} }
hostList = (Host)Marshal.PtrToStructure(hostListIntPtr, typeof(Host));
//This can be Null only when nothing is aggregated.
if (((String)Marshal.PtrToStringAnsi(hostList.hostName)) == null )
{
//TBD: Log that there are no secrets to aggregate
//Console.WriteLine("FireFox:no secrets to aggregate");
hostList = null;
}
//Uninitialize the profile //Uninitialize the profile
//Console.WriteLine("FireFox:UnInitializing the Profile "+profileName); //Console.WriteLine("FireFox:UnInitializing the Profile "+profileName);
//UninitProfile(profileName); //UninitProfile(profileName);
} }
return hostList; return hostList;
} }