From d01ef968e0201da758744af81f95a5eb0034fcc8 Mon Sep 17 00:00:00 2001 From: Manohar Date: Mon, 6 Mar 2006 09:14:26 +0000 Subject: [PATCH] --- c_adlib/ad_ff/FireFox.cs | 41 ++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/c_adlib/ad_ff/FireFox.cs b/c_adlib/ad_ff/FireFox.cs index 7e3ff6ed..876bb54b 100644 --- a/c_adlib/ad_ff/FireFox.cs +++ b/c_adlib/ad_ff/FireFox.cs @@ -35,14 +35,23 @@ public class Host public IntPtr hostName; public IntPtr hostElement; public IntPtr next; - public Host() - { + /*public Host() + //NOT NEEDED SINCE WE GET THIS FILLED FROM NATIVE WHEN + //WE MARSHAL PTR TO STRUCTURE + { hostName = Marshal.AllocHGlobal(128); } ~Host() - { - Marshal.FreeHGlobal(hostName); - } + { + try + { + Marshal.FreeHGlobal(hostName); + } + catch (Exception e) + { + Console.WriteLine("FireFox:Marshal FreeHGlobal Exception for Host:"); + } + }*/ }; @@ -53,16 +62,23 @@ public class HostElement public IntPtr value; public int isPassword; public IntPtr next; - public HostElement() + /*public HostElement() { name = Marshal.AllocHGlobal(128); value = Marshal.AllocHGlobal(128); } ~HostElement() { - Marshal.FreeHGlobal(name); - Marshal.FreeHGlobal(value); - } + try + { + Marshal.FreeHGlobal(name); + Marshal.FreeHGlobal(value); + } + catch (Exception e) + { + Console.WriteLine("FireFox:Marshal FreeHGlobal Exception for HostElement:"); + } + }*/ }; @@ -218,7 +234,8 @@ public class HostElement //-------------------------------------------------------------- public static Host GetProfileData(string profileName) { - Host hostList = new Host(); + Host hostList; // = new Host(); - NOT NEEDED SINCE WE GET THIS FILLED FROM NATIVE WHEN + // WE MARSHAL PTR TO STRUCTURE int methodStatusCode=-1; //Console.WriteLine("FireFox:Initializing the Profile "+profileName); @@ -294,10 +311,10 @@ public class HostElement //Console.WriteLine("FireFox:UninitProfile for "+profileName); methodStatusCode=-1; methodStatusCode = FPM_FirefoxProfileExit(profileName); - if( 1 != methodStatusCode ) + /*if( 1 != methodStatusCode ) { Console.WriteLine("FireFox:UninitProfile Failed with error "+methodStatusCode); - } + } */ return methodStatusCode; }