Commit 5ad5be89 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

dnsapi: Build with msvcrt.

parent 5f44c461
......@@ -3,6 +3,8 @@ IMPORTLIB = dnsapi
IMPORTS = netapi32
EXTRALIBS = $(RESOLV_LIBS)
EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \
libresolv.c \
main.c \
......
......@@ -27,7 +27,6 @@
#include "windns.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "dnsapi.h"
WINE_DEFAULT_DEBUG_CHANNEL(dnsapi);
......@@ -67,23 +66,13 @@ BOOL WINAPI DnsNameCompare_W( PCWSTR name1, PCWSTR name2 )
if (!name1 && !name2) return TRUE;
if (!name1 || !name2) return FALSE;
p = name1 + lstrlenW( name1 ) - 1;
q = name2 + lstrlenW( name2 ) - 1;
p = name1 + lstrlenW( name1 );
q = name2 + lstrlenW( name2 );
while (*p == '.' && p >= name1) p--;
while (*q == '.' && q >= name2) q--;
while (p > name1 && p[-1] == '.') p--;
while (q > name2 && q[-1] == '.') q--;
if (p - name1 != q - name2) return FALSE;
while (name1 <= p)
{
if (toupperW( *name1 ) != toupperW( *name2 ))
return FALSE;
name1++;
name2++;
}
return TRUE;
return CompareStringOrdinal( name1, p - name1, name2, q - name2, TRUE ) == CSTR_EQUAL;
}
/******************************************************************************
......@@ -141,9 +130,7 @@ DNS_STATUS WINAPI DnsValidateName_W( PCWSTR name, DNS_NAME_FORMAT format )
{
PCWSTR p;
unsigned int i, j, state = 0;
static const WCHAR invalid[] = {
'{','|','}','~','[','\\',']','^','\'',':',';','<','=','>',
'?','@','!','\"','#','$','%','^','`','(',')','+','/',',',0 };
static const WCHAR invalid[] = L"{|}~[\\]^':;<=>?@!\"#$%&`()+/,";
TRACE( "(%s, %d)\n", debugstr_w(name), format );
......@@ -162,7 +149,7 @@ DNS_STATUS WINAPI DnsValidateName_W( PCWSTR name, DNS_NAME_FORMAT format )
if (j > 62) state |= HAS_LONG_LABEL;
if (strchrW( invalid, *p )) state |= HAS_INVALID;
if (wcschr( invalid, *p )) state |= HAS_INVALID;
else if ((unsigned)*p > 127) state |= HAS_EXTENDED;
else if (*p == ' ') state |= HAS_SPACE;
else if (*p == '_') state |= HAS_UNDERSCORE;
......
......@@ -25,7 +25,6 @@
#include "windns.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "dnsapi.h"
WINE_DEFAULT_DEBUG_CHANNEL(dnsapi);
......@@ -450,8 +449,8 @@ PDNS_RECORD WINAPI DnsRecordCopyEx( PDNS_RECORD src, DNS_CHARSET in, DNS_CHARSET
dst->wDataLength = sizeof(dst->Data.MINFO);
if (out == DnsCharSetUnicode) dst->wDataLength +=
(strlenW( dst->Data.MINFO.pNameMailbox ) + 1) * sizeof(WCHAR) +
(strlenW( dst->Data.MINFO.pNameErrorsMailbox ) + 1) * sizeof(WCHAR);
(wcslen( dst->Data.MINFO.pNameMailbox ) + 1) * sizeof(WCHAR) +
(wcslen( dst->Data.MINFO.pNameErrorsMailbox ) + 1) * sizeof(WCHAR);
break;
}
case DNS_TYPE_AFSDB:
......@@ -463,7 +462,7 @@ PDNS_RECORD WINAPI DnsRecordCopyEx( PDNS_RECORD src, DNS_CHARSET in, DNS_CHARSET
dst->wDataLength = sizeof(dst->Data.MX);
if (out == DnsCharSetUnicode) dst->wDataLength +=
(strlenW( dst->Data.MX.pNameExchange ) + 1) * sizeof(WCHAR);
(wcslen( dst->Data.MX.pNameExchange ) + 1) * sizeof(WCHAR);
break;
}
case DNS_TYPE_NXT:
......@@ -473,7 +472,7 @@ PDNS_RECORD WINAPI DnsRecordCopyEx( PDNS_RECORD src, DNS_CHARSET in, DNS_CHARSET
dst->wDataLength = sizeof(dst->Data.NXT);
if (out == DnsCharSetUnicode) dst->wDataLength +=
(strlenW( dst->Data.NXT.pNameNext ) + 1) * sizeof(WCHAR);
(wcslen( dst->Data.NXT.pNameNext ) + 1) * sizeof(WCHAR);
break;
}
case DNS_TYPE_CNAME:
......@@ -490,7 +489,7 @@ PDNS_RECORD WINAPI DnsRecordCopyEx( PDNS_RECORD src, DNS_CHARSET in, DNS_CHARSET
dst->wDataLength = sizeof(dst->Data.PTR);
if (out == DnsCharSetUnicode) dst->wDataLength +=
(strlenW( dst->Data.PTR.pNameHost ) + 1) * sizeof(WCHAR);
(wcslen( dst->Data.PTR.pNameHost ) + 1) * sizeof(WCHAR);
break;
}
case DNS_TYPE_SIG:
......@@ -500,7 +499,7 @@ PDNS_RECORD WINAPI DnsRecordCopyEx( PDNS_RECORD src, DNS_CHARSET in, DNS_CHARSET
dst->wDataLength = sizeof(dst->Data.SIG);
if (out == DnsCharSetUnicode) dst->wDataLength +=
(strlenW( dst->Data.SIG.pNameSigner ) + 1) * sizeof(WCHAR);
(wcslen( dst->Data.SIG.pNameSigner ) + 1) * sizeof(WCHAR);
break;
}
case DNS_TYPE_SOA:
......@@ -517,8 +516,8 @@ PDNS_RECORD WINAPI DnsRecordCopyEx( PDNS_RECORD src, DNS_CHARSET in, DNS_CHARSET
dst->wDataLength = sizeof(dst->Data.SOA);
if (out == DnsCharSetUnicode) dst->wDataLength +=
(strlenW( dst->Data.SOA.pNamePrimaryServer ) + 1) * sizeof(WCHAR) +
(strlenW( dst->Data.SOA.pNameAdministrator ) + 1) * sizeof(WCHAR);
(wcslen( dst->Data.SOA.pNamePrimaryServer ) + 1) * sizeof(WCHAR) +
(wcslen( dst->Data.SOA.pNameAdministrator ) + 1) * sizeof(WCHAR);
break;
}
case DNS_TYPE_SRV:
......@@ -528,7 +527,7 @@ PDNS_RECORD WINAPI DnsRecordCopyEx( PDNS_RECORD src, DNS_CHARSET in, DNS_CHARSET
dst->wDataLength = sizeof(dst->Data.SRV);
if (out == DnsCharSetUnicode) dst->wDataLength +=
(strlenW( dst->Data.SRV.pNameTarget ) + 1) * sizeof(WCHAR);
(wcslen( dst->Data.SRV.pNameTarget ) + 1) * sizeof(WCHAR);
break;
}
default:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment