aboutsummaryrefslogtreecommitdiff
path: root/src/gns/w32nsp-uninstall.c
blob: bb8db668b08da0285fe2d7d89955c154eeb88bb6 (plain)
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
#define INITGUID
#include <windows.h>
#include <nspapi.h>
#include <ws2spi.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)
  {
    WSACleanup ();
    return 0;
  }
  fprintf (stderr, "WSCUnInstallNameSpace() failed: %lu\n", GetLastError ());
  WSACleanup ();
  return 1;
}