aboutsummaryrefslogtreecommitdiff
path: root/src/vpn
diff options
context:
space:
mode:
authorChristian Fuchs <christian.fuchs@cfuchs.net>2012-12-05 10:14:28 +0000
committerChristian Fuchs <christian.fuchs@cfuchs.net>2012-12-05 10:14:28 +0000
commit749162f7d1b659f6d0178e242bbd9ad59340e14f (patch)
treedf8d99e43b336544587b922ada70df45d1693298 /src/vpn
parent5338516676948bc2300d970c0f013deedeee5157 (diff)
downloadgnunet-749162f7d1b659f6d0178e242bbd9ad59340e14f.tar.gz
gnunet-749162f7d1b659f6d0178e242bbd9ad59340e14f.zip
added teardown functionality for deconstructing the interface created by
the win32 vpn-helper.
Diffstat (limited to 'src/vpn')
-rw-r--r--src/vpn/gnunet-helper-vpn-windows.c42
1 files changed, 34 insertions, 8 deletions
diff --git a/src/vpn/gnunet-helper-vpn-windows.c b/src/vpn/gnunet-helper-vpn-windows.c
index b805811f6..93bf290c8 100644
--- a/src/vpn/gnunet-helper-vpn-windows.c
+++ b/src/vpn/gnunet-helper-vpn-windows.c
@@ -210,7 +210,7 @@ setup_interface ()
210 * 210 *
211 * TODO: Finde a more sane way to do this! 211 * TODO: Finde a more sane way to do this!
212 */ 212 */
213 213
214 InfFilePath = calloc (MAX_PATH, sizeof (TCHAR)); 214 InfFilePath = calloc (MAX_PATH, sizeof (TCHAR));
215 if (InfFilePath == NULL) 215 if (InfFilePath == NULL)
216 { 216 {
@@ -263,7 +263,7 @@ setup_interface ()
263 { 263 {
264 goto cleanup3; 264 goto cleanup3;
265 } 265 }
266 266
267 /* Deploy all the information collected into the registry */ 267 /* Deploy all the information collected into the registry */
268 if (!SetupDiSetDeviceRegistryProperty (DeviceInfo, 268 if (!SetupDiSetDeviceRegistryProperty (DeviceInfo,
269 &DeviceNode, 269 &DeviceNode,
@@ -274,15 +274,13 @@ setup_interface ()
274 goto cleanup3; 274 goto cleanup3;
275 } 275 }
276 /* Install our new class(=device) into the system */ 276 /* Install our new class(=device) into the system */
277 if (!SetupDiCallClassInstaller (DIF_REGISTERDEVICE, 277 if (SetupDiCallClassInstaller (DIF_REGISTERDEVICE,
278 DeviceInfo, 278 DeviceInfo,
279 &DeviceNode)) 279 &DeviceNode))
280 { 280 {
281 goto cleanup3; 281 return TRUE;
282 } 282 }
283 283
284 return TRUE;
285
286 //disabled for debug-reasons... 284 //disabled for debug-reasons...
287cleanup3: 285cleanup3:
288 //GNUNET_free(DeviceInfo); 286 //GNUNET_free(DeviceInfo);
@@ -297,6 +295,34 @@ cleanup1:
297 295
298} 296}
299 297
298static boolean
299remove_interface ()
300{
301 SP_REMOVEDEVICE_PARAMS remove;
302
303 remove.ClassInstallHeader.cbSize = sizeof (SP_CLASSINSTALL_HEADER);
304 remove.HwProfile = 0;
305 remove.Scope = DI_REMOVEDEVICE_GLOBAL;
306 remove.ClassInstallHeader.InstallFunction = DIF_REMOVE;
307
308
309 if (SetupDiSetClassInstallParams (DeviceInfo,
310 (PSP_DEVINFO_DATA) &DeviceNode,
311 &remove.ClassInstallHeader,
312 sizeof (remove)))
313 {
314 if (SetupDiCallClassInstaller (DIF_REMOVE,
315 DeviceInfo,
316 (PSP_DEVINFO_DATA) &DeviceNode))
317 {
318 return TRUE;
319 }
320 }
321
322 return FALSE;
323
324}
325
300/** 326/**
301 * Start forwarding to and from the tunnel. 327 * Start forwarding to and from the tunnel.
302 * 328 *