[Dnsapi.dll] Implement Dnsapi.dll
Mike McCormack
mike at codeweavers.com
Mon Feb 27 20:29:21 CST 2006
MattK wrote:
> This is a patch to implement Dnsapi.dll. It contains "bare bones".
Please submit a seperate patch for the windns.h header file.
> @@ -1193,6 +1193,7 @@ AC_CHECK_FUNCS(\
> strcasecmp \
> strerror \
> strncasecmp \
> + strsep \
Adding strsep here doesn't guarantee that it will exist. You need to
check usage with #ifdef HAVE_STRSEP, or just assume it's always there
and remove the configure check (prefered). Looks like that code is
using tab indent too, so if this was needed, you should use the same to
keep it consistent.
> RCS file: /home/wine/wine/dlls/Makefile.in,v
This is automatically generated. No patch is needed.
> +DNS_STATUS WINAPI DnsValidateName_A(LPCSTR pszName, DNS_NAME_FORMAT);
Hmmm. The Windows Platform SDK doesn't define this function as WINAPI.
> +# Generated from /mnt/windows/windows/system32/dnsapi.dll by winedump
This comment is unnecessary.
> +107 stdcall DnsValidateName_A(str long)
Maybe cdecl instead, if the Platform SDK header is right?
> +EXTRALIBS = -lc
Pretty sure libc is linked by default, so you don't need to add it.
> + /* The Platform SDK documentation for this says that it ignores all periods. */
> + /* So there's gonna be no periods! */
> +
> + if(dots1 && dots2)
> + {
> + strsep(&name1,dots1);
> + strsep(&name2,dots2);
> + pName1 = name1;
> + pName2 = name2;
> + }
This ignores the first period and everything after it. It also modifies
the input (ie. the program's copy of the string).
> + equal = strcmp(pName1,pName2);
Probably better to use lstrcmpA to use the Wine codepage.
> + if(equal == 0)
> + {
> + return TRUE;
> + }
> +
> + if(equal > 0 || equal < 0)
> + {
> + return FALSE;
> + }
> +}
How about "return !equal;" ?
It would be nice if you could write a test case for DnsNameCompare_A.
If you do, please submit it seperately from the rest of the patch.
Thanks for the patch!
Mike
More information about the wine-devel
mailing list