• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef WIN32_LEAN_AND_MEAN
2 #define WIN32_LEAN_AND_MEAN
3 #endif
4 #undef  __CRT__NO_INLINE
5 #define __CRT__NO_INLINE
6 #include <winsock2.h>
7 #include <wspiapi.h>
8 
9 WINBOOL WINAPI
WspiapiParseV4Address(const char * pszAddress,PDWORD pdwAddress)10 WspiapiParseV4Address (const char *pszAddress, PDWORD pdwAddress)
11 {
12   DWORD dwAddress = 0;
13   const char *h = NULL;
14   int cnt;
15 
16   for (cnt = 0,h = pszAddress; *h != 0; h++)
17     if (h[0] == '.')
18 	cnt++;
19   if (cnt != 3)
20     return FALSE;
21   dwAddress = inet_addr (pszAddress);
22   if (dwAddress == INADDR_NONE)
23     return FALSE;
24   *pdwAddress = dwAddress;
25   return TRUE;
26 }
27