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
bfc8832c
Commit
bfc8832c
authored
Dec 27, 2010
by
Timo Teräs
Committed by
Alexandre Julliard
Dec 27, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iphlpapi: Fix GetAdaptersAddresses return values.
parent
8dceb076
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
8 deletions
+18
-8
iphlpapi_main.c
dlls/iphlpapi/iphlpapi_main.c
+4
-1
iphlpapi.c
dlls/iphlpapi/tests/iphlpapi.c
+14
-7
No files found.
dlls/iphlpapi/iphlpapi_main.c
View file @
bfc8832c
...
...
@@ -1115,10 +1115,13 @@ ULONG WINAPI GetAdaptersAddresses(ULONG family, ULONG flags, PVOID reserved,
{
if
(
aa
->
IfType
!=
IF_TYPE_SOFTWARE_LOOPBACK
&&
aa
->
OperStatus
==
IfOperStatusUp
)
aa
->
DnsSuffix
=
dnsSuffix
;
else
aa
->
DnsSuffix
=
(
WCHAR
*
)((
BYTE
*
)
dnsSuffix
+
dns_suffix_size
-
2
);
}
ret
=
ERROR_SUCCESS
;
}
if
(
*
buflen
<
total_size
)
ret
=
ERROR_BUFFER_OVERFLOW
;
else
ret
=
ERROR_BUFFER_OVERFLOW
;
*
buflen
=
total_size
;
TRACE
(
"num adapters %u
\n
"
,
table
->
numIndexes
);
...
...
dlls/iphlpapi/tests/iphlpapi.c
View file @
bfc8832c
...
...
@@ -819,7 +819,7 @@ static void testWin2KFunctions(void)
static
void
test_GetAdaptersAddresses
(
void
)
{
ULONG
ret
,
size
;
IP_ADAPTER_ADDRESSES
*
aa
;
IP_ADAPTER_ADDRESSES
*
aa
,
*
ptr
;
IP_ADAPTER_UNICAST_ADDRESS
*
ua
;
if
(
!
gGetAdaptersAddresses
)
...
...
@@ -831,17 +831,25 @@ static void test_GetAdaptersAddresses(void)
ret
=
gGetAdaptersAddresses
(
AF_UNSPEC
,
0
,
NULL
,
NULL
,
NULL
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER got %u
\n
"
,
ret
);
size
=
0
;
/* size should be ignored and overwritten if buffer is NULL */
size
=
0x7fffffff
;
ret
=
gGetAdaptersAddresses
(
AF_UNSPEC
,
0
,
NULL
,
NULL
,
&
size
);
ok
(
ret
==
ERROR_BUFFER_OVERFLOW
,
"expected ERROR_BUFFER_OVERFLOW, got %u
\n
"
,
ret
);
if
(
ret
!=
ERROR_BUFFER_OVERFLOW
)
return
;
aa
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
ret
=
gGetAdaptersAddresses
(
AF_UNSPEC
,
0
,
NULL
,
aa
,
&
size
);
ptr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
ret
=
gGetAdaptersAddresses
(
AF_UNSPEC
,
0
,
NULL
,
ptr
,
&
size
);
ok
(
!
ret
,
"expected ERROR_SUCCESS got %u
\n
"
,
ret
);
while
(
!
ret
&&
winetest_debug
>
1
&&
aa
)
for
(
aa
=
ptr
;
!
ret
&&
aa
;
aa
=
aa
->
Next
)
{
ok
(
aa
->
DnsSuffix
!=
NULL
,
"DnsSuffix is not a valid pointer
\n
"
);
ok
(
aa
->
Description
!=
NULL
,
"Description is not a valid pointer
\n
"
);
ok
(
aa
->
FriendlyName
!=
NULL
,
"FriendlyName is not a valid pointer
\n
"
);
if
(
winetest_debug
<=
1
)
continue
;
trace
(
"Length: %u
\n
"
,
S
(
U
(
*
aa
)).
Length
);
trace
(
"IfIndex: %u
\n
"
,
S
(
U
(
*
aa
)).
IfIndex
);
trace
(
"Next: %p
\n
"
,
aa
->
Next
);
...
...
@@ -877,9 +885,8 @@ static void test_GetAdaptersAddresses(void)
trace
(
"IfType: %u
\n
"
,
aa
->
IfType
);
trace
(
"OperStatus: %u
\n
"
,
aa
->
OperStatus
);
trace
(
"
\n
"
);
aa
=
aa
->
Next
;
}
HeapFree
(
GetProcessHeap
(),
0
,
aa
);
HeapFree
(
GetProcessHeap
(),
0
,
ptr
);
}
START_TEST
(
iphlpapi
)
...
...
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