Exemplo n.º 1
0
Arquivo: Global.cs Projeto: MrJoe/lat
        public static GnomeKeyring.Result FindNetworkPassword(string user, out NetworkPasswordData[] result)
        {
            IntPtr result_handle;
            IntPtr user_as_native     = GLib.Marshaller.StringToPtrGStrdup(user);
            IntPtr domain_as_native   = GLib.Marshaller.StringToPtrGStrdup(null);
            IntPtr server_as_native   = GLib.Marshaller.StringToPtrGStrdup(null);
            IntPtr objekt_as_native   = GLib.Marshaller.StringToPtrGStrdup(null);
            IntPtr protocol_as_native = GLib.Marshaller.StringToPtrGStrdup(null);
            IntPtr authtype_as_native = GLib.Marshaller.StringToPtrGStrdup(null);
            int    raw_ret            = gnome_keyring_find_network_password_sync(user_as_native, domain_as_native, server_as_native, objekt_as_native, protocol_as_native, authtype_as_native, 0, out result_handle);

            GnomeKeyring.Result ret = (GnomeKeyring.Result)raw_ret;
            GLib.Marshaller.Free(user_as_native);
            GLib.Marshaller.Free(domain_as_native);
            GLib.Marshaller.Free(server_as_native);
            GLib.Marshaller.Free(objekt_as_native);
            GLib.Marshaller.Free(protocol_as_native);
            GLib.Marshaller.Free(authtype_as_native);

            GLib.List l = new GLib.List(result_handle, typeof(NetworkPasswordData));
            result = new NetworkPasswordData[l.Count];
            for (int i = 0; i < l.Count; i++)
            {
                result[i] = (NetworkPasswordData)l[i];
            }

            return(ret);
        }
Exemplo n.º 2
0
Arquivo: Global.cs Projeto: MrJoe/lat
		public static GnomeKeyring.Result FindNetworkPassword(string user, out NetworkPasswordData[] result) {
			IntPtr result_handle;
			IntPtr user_as_native = GLib.Marshaller.StringToPtrGStrdup (user);
			IntPtr domain_as_native = GLib.Marshaller.StringToPtrGStrdup (null);
			IntPtr server_as_native = GLib.Marshaller.StringToPtrGStrdup (null);
			IntPtr objekt_as_native = GLib.Marshaller.StringToPtrGStrdup (null);
			IntPtr protocol_as_native = GLib.Marshaller.StringToPtrGStrdup (null);
			IntPtr authtype_as_native = GLib.Marshaller.StringToPtrGStrdup (null);
			int raw_ret = gnome_keyring_find_network_password_sync(user_as_native, domain_as_native, server_as_native, objekt_as_native, protocol_as_native, authtype_as_native, 0, out result_handle);
			GnomeKeyring.Result ret = (GnomeKeyring.Result) raw_ret;
			GLib.Marshaller.Free (user_as_native);
			GLib.Marshaller.Free (domain_as_native);
			GLib.Marshaller.Free (server_as_native);
			GLib.Marshaller.Free (objekt_as_native);
			GLib.Marshaller.Free (protocol_as_native);
			GLib.Marshaller.Free (authtype_as_native);
		
			GLib.List l = new GLib.List(result_handle, typeof(NetworkPasswordData));
			result = new NetworkPasswordData[l.Count];
			for (int i = 0; i < l.Count; i++)
				result[i] = (NetworkPasswordData)l[i];
		
			return ret;
		}