Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
486e3b32
Commit
486e3b32
authored
Apr 09, 2006
by
Hans Leidekker
Committed by
Alexandre Julliard
Apr 10, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dnsapi: Implement DnsNameCompare_{A,W}.
parent
6b1dded3
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
135 additions
and
3 deletions
+135
-3
Makefile.in
dlls/dnsapi/Makefile.in
+2
-1
dnsapi.h
dlls/dnsapi/dnsapi.h
+42
-0
dnsapi.spec
dlls/dnsapi/dnsapi.spec
+2
-2
name.c
dlls/dnsapi/name.c
+89
-0
No files found.
dlls/dnsapi/Makefile.in
View file @
486e3b32
...
@@ -8,7 +8,8 @@ IMPORTS = kernel32
...
@@ -8,7 +8,8 @@ IMPORTS = kernel32
EXTRALIBS
=
$(LIBUNICODE)
EXTRALIBS
=
$(LIBUNICODE)
C_SRCS
=
\
C_SRCS
=
\
main.c
main.c
\
name.c
@MAKE_DLL_RULES@
@MAKE_DLL_RULES@
...
...
dlls/dnsapi/dnsapi.h
0 → 100644
View file @
486e3b32
/*
* DNS support
*
* Copyright 2006 Hans Leidekker
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
static
inline
void
*
dns_alloc
(
SIZE_T
size
)
{
return
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
}
static
inline
void
dns_free
(
LPVOID
mem
)
{
HeapFree
(
GetProcessHeap
(),
0
,
mem
);
}
static
inline
LPWSTR
dns_strdup_aw
(
LPCSTR
str
)
{
LPWSTR
ret
=
NULL
;
if
(
str
)
{
DWORD
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
NULL
,
0
);
if
((
ret
=
dns_alloc
(
len
*
sizeof
(
WCHAR
)
)))
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
ret
,
len
);
}
return
ret
;
}
dlls/dnsapi/dnsapi.spec
View file @
486e3b32
...
@@ -68,11 +68,11 @@
...
@@ -68,11 +68,11 @@
@ stub DnsModifyRecordsInSet_A
@ stub DnsModifyRecordsInSet_A
@ stub DnsModifyRecordsInSet_UTF8
@ stub DnsModifyRecordsInSet_UTF8
@ stub DnsModifyRecordsInSet_W
@ stub DnsModifyRecordsInSet_W
@ st
ub DnsNameCompare_A
@ st
dcall DnsNameCompare_A(str str)
@ stub DnsNameCompareEx_A
@ stub DnsNameCompareEx_A
@ stub DnsNameCompareEx_UTF8
@ stub DnsNameCompareEx_UTF8
@ stub DnsNameCompareEx_W
@ stub DnsNameCompareEx_W
@ st
ub DnsNameCompare_W
@ st
dcall DnsNameCompare_W(wstr wstr)
@ stub DnsNameCopy
@ stub DnsNameCopy
@ stub DnsNameCopyAllocate
@ stub DnsNameCopyAllocate
@ stub DnsNotifyResolver
@ stub DnsNotifyResolver
...
...
dlls/dnsapi/name.c
0 → 100644
View file @
486e3b32
/*
* DNS support
*
* Copyright (C) 2006 Matthew Kehrer
* Copyright (C) 2006 Hans Leidekker
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "wine/debug.h"
#include "wine/unicode.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "winnls.h"
#include "windns.h"
#include "dnsapi.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dnsapi
);
/******************************************************************************
* DnsNameCompare_A [DNSAPI.@]
*
*/
BOOL
WINAPI
DnsNameCompare_A
(
LPSTR
name1
,
LPSTR
name2
)
{
BOOL
ret
;
LPWSTR
name1W
,
name2W
;
TRACE
(
"(%s,%s)
\n
"
,
debugstr_a
(
name1
),
debugstr_a
(
name2
)
);
name1W
=
dns_strdup_aw
(
name1
);
name2W
=
dns_strdup_aw
(
name2
);
ret
=
DnsNameCompare_W
(
name1W
,
name2W
);
dns_free
(
name1W
);
dns_free
(
name2W
);
return
ret
;
}
/******************************************************************************
* DnsNameCompare_W [DNSAPI.@]
*
*/
BOOL
WINAPI
DnsNameCompare_W
(
LPWSTR
name1
,
LPWSTR
name2
)
{
WCHAR
*
p
,
*
q
;
TRACE
(
"(%s,%s)
\n
"
,
debugstr_w
(
name1
),
debugstr_w
(
name2
)
);
if
(
!
name1
&&
!
name2
)
return
TRUE
;
if
(
!
name1
||
!
name2
)
return
FALSE
;
p
=
name1
+
lstrlenW
(
name1
)
-
1
;
q
=
name2
+
lstrlenW
(
name2
)
-
1
;
while
(
*
p
==
'.'
&&
p
>=
name1
)
p
--
;
while
(
*
q
==
'.'
&&
q
>=
name2
)
q
--
;
if
(
p
-
name1
!=
q
-
name2
)
return
FALSE
;
while
(
name1
<=
p
)
{
if
(
toupperW
(
*
name1
)
!=
toupperW
(
*
name2
))
return
FALSE
;
name1
++
;
name2
++
;
}
return
TRUE
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment