void GetInterfaceInfomationMyIpAddress()
{
     WORD versionRequested;
     int wsError;
     WSADATA winsockData;
     SOCKET s;
     DWORD bytesReturned;
     char* pAddrString;
     SOCKADDR_IN* pAddrInet;
     u_long SetFlags;
     INTERFACE_INFO localAddr[10];  // Assume there will be no more than 10 IP interfaces
     int numLocalAddr;

     versionRequested = MAKEWORD(2, 2);

     wsError = WSAStartup(versionRequested, &winsockData);
     if (wsError)
     {
          fprintf (stderr, "Startup failed\n");
                return;
     }

     if((s = WSASocket(AF_INET, SOCK_DGRAM, IPPROTO_UDP, NULL, 0, 0)) == INVALID_SOCKET)
     {
          fprintf (stderr, "Socket creation failed\n");
          WSACleanup();
               return;
        }

     // Enumerate all IP interfaces
     fprintf(stderr, "Scanning Interfaces . . .\n\n");
     wsError = WSAIoctl(s, SIO_GET_INTERFACE_LIST, NULL, 0, &localAddr,
                      sizeof(localAddr), &bytesReturned, NULL, NULL);
     if (wsError == SOCKET_ERROR)
     {
          fprintf(stderr, "WSAIoctl fails with error %d\n", GetLastError());
          closesocket(s);
          WSACleanup();
          return;
     }

     closesocket(s);

     // Display interface information
     numLocalAddr = (bytesReturned/sizeof(INTERFACE_INFO));
     for (int i=0; i<numLocalAddr; i++)
     {
          pAddrInet = (SOCKADDR_IN*)&localAddr[i].iiAddress;
          pAddrString = inet_ntoa(pAddrInet->sin_addr);
          if (pAddrString)
               printf("IP: %s  ", pAddrString);

          pAddrInet = (SOCKADDR_IN*)&localAddr[i].iiNetmask;
          pAddrString = inet_ntoa(pAddrInet->sin_addr);
          if (pAddrString)
               printf(" SubnetMask: %s ", pAddrString);

          pAddrInet = (SOCKADDR_IN*)&localAddr[i].iiBroadcastAddress;
          pAddrString = inet_ntoa(pAddrInet->sin_addr);
          if (pAddrString)
               printf(" Bcast Addr: %s\n", pAddrString);

          SetFlags = localAddr[i].iiFlags;
          if (SetFlags & IFF_UP)
               printf("This interface is up");
          if (SetFlags & IFF_BROADCAST)
               printf(", broadcasts are supported");
          if (SetFlags & IFF_MULTICAST)
               printf(", and so are multicasts");
          if (SetFlags & IFF_LOOPBACK)
               printf(". BTW, this is the loopback interface");
          if (SetFlags & IFF_POINTTOPOINT)
               printf(". BTW, this is a point-to-point link");
          printf("\n\n");
     }

     WSACleanup();
}