Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
0c0d1903
Commit
0c0d1903
authored
Sep 13, 2006
by
Hans Leidekker
Committed by
Alexandre Julliard
Sep 14, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dnsapi: Implement and test DnsRecordSetDetach.
parent
9de2c506
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
1 deletion
+48
-1
dnsapi.spec
dlls/dnsapi/dnsapi.spec
+1
-1
record.c
dlls/dnsapi/record.c
+22
-0
record.c
dlls/dnsapi/tests/record.c
+25
-0
No files found.
dlls/dnsapi/dnsapi.spec
View file @
0c0d1903
...
@@ -88,7 +88,7 @@
...
@@ -88,7 +88,7 @@
@ stdcall DnsRecordListFree(ptr long)
@ stdcall DnsRecordListFree(ptr long)
@ stdcall DnsRecordSetCompare(ptr ptr ptr ptr)
@ stdcall DnsRecordSetCompare(ptr ptr ptr ptr)
@ stdcall DnsRecordSetCopyEx(ptr long long)
@ stdcall DnsRecordSetCopyEx(ptr long long)
@ st
ub DnsRecordSetDetach
@ st
dcall DnsRecordSetDetach(ptr)
@ stub DnsRecordStringForType
@ stub DnsRecordStringForType
@ stub DnsRecordStringForWritableType
@ stub DnsRecordStringForWritableType
@ stub DnsRecordTypeForName
@ stub DnsRecordTypeForName
...
...
dlls/dnsapi/record.c
View file @
0c0d1903
...
@@ -748,3 +748,25 @@ PDNS_RECORD WINAPI DnsRecordSetCopyEx( PDNS_RECORD src_set, DNS_CHARSET in, DNS_
...
@@ -748,3 +748,25 @@ PDNS_RECORD WINAPI DnsRecordSetCopyEx( PDNS_RECORD src_set, DNS_CHARSET in, DNS_
DNS_RRSET_TERMINATE
(
dst_set
);
DNS_RRSET_TERMINATE
(
dst_set
);
return
dst_set
.
pFirstRR
;
return
dst_set
.
pFirstRR
;
}
}
/******************************************************************************
* DnsRecordSetDetach [DNSAPI.@]
*
*/
PDNS_RECORD
WINAPI
DnsRecordSetDetach
(
PDNS_RECORD
set
)
{
DNS_RECORD
*
r
,
*
s
;
TRACE
(
"(%p)
\n
"
,
set
);
for
(
r
=
set
;
(
set
=
r
);
r
=
set
->
pNext
)
{
if
(
r
->
pNext
&&
!
r
->
pNext
->
pNext
)
{
s
=
r
->
pNext
;
r
->
pNext
=
NULL
;
return
s
;
}
}
return
NULL
;
}
dlls/dnsapi/tests/record.c
View file @
0c0d1903
...
@@ -32,6 +32,7 @@ static HMODULE dnsapi;
...
@@ -32,6 +32,7 @@ static HMODULE dnsapi;
static
BOOL
(
WINAPI
*
pDnsRecordCompare
)(
PDNS_RECORD
,
PDNS_RECORD
);
static
BOOL
(
WINAPI
*
pDnsRecordCompare
)(
PDNS_RECORD
,
PDNS_RECORD
);
static
BOOL
(
WINAPI
*
pDnsRecordSetCompare
)(
PDNS_RECORD
,
PDNS_RECORD
,
PDNS_RECORD
*
,
PDNS_RECORD
*
);
static
BOOL
(
WINAPI
*
pDnsRecordSetCompare
)(
PDNS_RECORD
,
PDNS_RECORD
,
PDNS_RECORD
*
,
PDNS_RECORD
*
);
static
DNS_RECORD
*
(
WINAPI
*
pDnsRecordSetDetach
)(
PDNS_RECORD
);
#define GETFUNCPTR(func) p##func = (void *)GetProcAddress( dnsapi, #func ); \
#define GETFUNCPTR(func) p##func = (void *)GetProcAddress( dnsapi, #func ); \
if (!p##func) return FALSE;
if (!p##func) return FALSE;
...
@@ -40,6 +41,7 @@ static BOOL init_function_ptrs( void )
...
@@ -40,6 +41,7 @@ static BOOL init_function_ptrs( void )
{
{
GETFUNCPTR
(
DnsRecordCompare
)
GETFUNCPTR
(
DnsRecordCompare
)
GETFUNCPTR
(
DnsRecordSetCompare
)
GETFUNCPTR
(
DnsRecordSetCompare
)
GETFUNCPTR
(
DnsRecordSetDetach
)
return
TRUE
;
return
TRUE
;
}
}
...
@@ -48,6 +50,7 @@ static char name2[] = "LOCALHOST";
...
@@ -48,6 +50,7 @@ static char name2[] = "LOCALHOST";
static
DNS_RECORDA
r1
=
{
NULL
,
name1
,
DNS_TYPE_A
,
sizeof
(
DNS_A_DATA
),
{
0
},
1200
,
0
,
{
{
0xffffffff
}
}
};
static
DNS_RECORDA
r1
=
{
NULL
,
name1
,
DNS_TYPE_A
,
sizeof
(
DNS_A_DATA
),
{
0
},
1200
,
0
,
{
{
0xffffffff
}
}
};
static
DNS_RECORDA
r2
=
{
NULL
,
name1
,
DNS_TYPE_A
,
sizeof
(
DNS_A_DATA
),
{
0
},
1200
,
0
,
{
{
0xffffffff
}
}
};
static
DNS_RECORDA
r2
=
{
NULL
,
name1
,
DNS_TYPE_A
,
sizeof
(
DNS_A_DATA
),
{
0
},
1200
,
0
,
{
{
0xffffffff
}
}
};
static
DNS_RECORDA
r3
=
{
NULL
,
name1
,
DNS_TYPE_A
,
sizeof
(
DNS_A_DATA
),
{
0
},
1200
,
0
,
{
{
0xffffffff
}
}
};
static
void
test_DnsRecordCompare
(
void
)
static
void
test_DnsRecordCompare
(
void
)
{
{
...
@@ -123,6 +126,27 @@ static void test_DnsRecordSetCompare( void )
...
@@ -123,6 +126,27 @@ static void test_DnsRecordSetCompare( void )
ok
(
pDnsRecordSetCompare
(
rr1
.
pFirstRR
,
rr2
.
pFirstRR
,
&
diff1
,
&
diff2
)
==
FALSE
,
"succeeded unexpectedly
\n
"
);
ok
(
pDnsRecordSetCompare
(
rr1
.
pFirstRR
,
rr2
.
pFirstRR
,
&
diff1
,
&
diff2
)
==
FALSE
,
"succeeded unexpectedly
\n
"
);
}
}
static
void
test_DnsRecordSetDetach
(
void
)
{
DNS_RRSET
rr
;
DNS_RECORDA
*
r
,
*
s
;
DNS_RRSET_INIT
(
rr
);
DNS_RRSET_ADD
(
rr
,
&
r1
);
DNS_RRSET_ADD
(
rr
,
&
r2
);
DNS_RRSET_ADD
(
rr
,
&
r3
);
DNS_RRSET_TERMINATE
(
rr
);
ok
(
!
pDnsRecordSetDetach
(
NULL
),
"succeeded unexpectedly
\n
"
);
r
=
rr
.
pFirstRR
;
s
=
pDnsRecordSetDetach
(
r
);
ok
(
s
==
&
r3
,
"failed unexpectedly: got %p, expected %p
\n
"
,
s
,
&
r3
);
ok
(
r
==
&
r1
,
"failed unexpectedly: got %p, expected %p
\n
"
,
r
,
&
r1
);
ok
(
!
r2
.
pNext
,
"failed unexpectedly
\n
"
);
}
START_TEST
(
record
)
START_TEST
(
record
)
{
{
dnsapi
=
LoadLibraryA
(
"dnsapi.dll"
);
dnsapi
=
LoadLibraryA
(
"dnsapi.dll"
);
...
@@ -136,6 +160,7 @@ START_TEST(record)
...
@@ -136,6 +160,7 @@ START_TEST(record)
test_DnsRecordCompare
();
test_DnsRecordCompare
();
test_DnsRecordSetCompare
();
test_DnsRecordSetCompare
();
test_DnsRecordSetDetach
();
FreeLibrary
(
dnsapi
);
FreeLibrary
(
dnsapi
);
}
}
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