summaryrefslogtreecommitdiff
path: root/src/gns/w32nsp-uninstall.c
blob: f5031f341b87a6b1acc1ad2217990d9b4d8fdfce (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <ws2spi.h>
#include <windows.h>
#include <nspapi.h>
#include <initguid.h>
#include "gnunet_w32nsp_lib.h"
#include <stdio.h>

int
main(int argc, char **argv)
{
  int ret;
  GUID id = GNUNET_NAMESPACE_PROVIDER_DNS;
  WSADATA wsd;

  if (WSAStartup(MAKEWORD(2, 2), &wsd) != 0)
    {
      fprintf(stderr, "WSAStartup () failed: %lu\n", GetLastError());
      return 5;
    }

  ret = WSCUnInstallNameSpace(&id);
  if (ret == NO_ERROR)
    {
      fprintf(stderr, "Uninstalled GNUnet DNS provider\n");
      WSACleanup();
      return 0;
    }
  fprintf(stderr, "WSCUnInstallNameSpace () failed: %lu\n", GetLastError());
  WSACleanup();
  return 1;
}