gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r25249 - gnunet/src/vpn


From: gnunet
Subject: [GNUnet-SVN] r25249 - gnunet/src/vpn
Date: Wed, 5 Dec 2012 11:14:28 +0100

Author: cfuchs
Date: 2012-12-05 11:14:28 +0100 (Wed, 05 Dec 2012)
New Revision: 25249

Modified:
   gnunet/src/vpn/gnunet-helper-vpn-windows.c
Log:
added teardown functionality for deconstructing the interface created by 
the win32 vpn-helper.



Modified: gnunet/src/vpn/gnunet-helper-vpn-windows.c
===================================================================
--- gnunet/src/vpn/gnunet-helper-vpn-windows.c  2012-12-04 21:43:57 UTC (rev 
25248)
+++ gnunet/src/vpn/gnunet-helper-vpn-windows.c  2012-12-05 10:14:28 UTC (rev 
25249)
@@ -210,7 +210,7 @@
    * 
    * TODO: Finde a more sane way to do this!
    */
-  
+
   InfFilePath = calloc (MAX_PATH, sizeof (TCHAR));
   if (InfFilePath == NULL)
     {
@@ -263,7 +263,7 @@
     {
       goto cleanup3;
     }
-  
+
   /* Deploy all the information collected into the registry */
   if (!SetupDiSetDeviceRegistryProperty (DeviceInfo,
                                          &DeviceNode,
@@ -274,15 +274,13 @@
       goto cleanup3;
     }
   /* Install our new class(=device) into the system */
-  if (!SetupDiCallClassInstaller (DIF_REGISTERDEVICE,
-                                  DeviceInfo,
-                                  &DeviceNode))
+  if (SetupDiCallClassInstaller (DIF_REGISTERDEVICE,
+                                 DeviceInfo,
+                                 &DeviceNode))
     {
-      goto cleanup3;
+      return TRUE;
     }
 
-  return TRUE;
-
   //disabled for debug-reasons...
 cleanup3:
   //GNUNET_free(DeviceInfo);
@@ -297,6 +295,34 @@
 
 }
 
+static boolean
+remove_interface ()
+{
+  SP_REMOVEDEVICE_PARAMS remove;
+
+  remove.ClassInstallHeader.cbSize = sizeof (SP_CLASSINSTALL_HEADER);
+  remove.HwProfile = 0;
+  remove.Scope = DI_REMOVEDEVICE_GLOBAL;
+  remove.ClassInstallHeader.InstallFunction = DIF_REMOVE;
+  
+
+  if (SetupDiSetClassInstallParams (DeviceInfo,
+                                    (PSP_DEVINFO_DATA) &DeviceNode,
+                                    &remove.ClassInstallHeader,
+                                    sizeof (remove)))
+    {
+      if (SetupDiCallClassInstaller (DIF_REMOVE, 
+                                     DeviceInfo, 
+                                     (PSP_DEVINFO_DATA) &DeviceNode))
+        {
+          return TRUE;
+        }
+    }
+
+  return FALSE;
+
+}
+
 /**
  * Start forwarding to and from the tunnel.
  *




reply via email to

[Prev in Thread] Current Thread [Next in Thread]