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
bfd7b9bc
Commit
bfd7b9bc
authored
Jun 20, 2022
by
Paul Gofman
Committed by
Alexandre Julliard
Jun 21, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iphlpapi: Sort by adapter index first in GetIpNetTable().
Signed-off-by:
Paul Gofman
<
pgofman@codeweavers.com
>
parent
fae847ad
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
iphlpapi_main.c
dlls/iphlpapi/iphlpapi_main.c
+3
-0
iphlpapi.c
dlls/iphlpapi/tests/iphlpapi.c
+14
-1
No files found.
dlls/iphlpapi/iphlpapi_main.c
View file @
bfd7b9bc
...
...
@@ -2282,6 +2282,9 @@ err:
static
int
ipnetrow_cmp
(
const
void
*
a
,
const
void
*
b
)
{
const
MIB_IPNETROW
*
rowA
=
a
,
*
rowB
=
b
;
if
(
rowA
->
dwIndex
!=
rowB
->
dwIndex
)
return
DWORD_cmp
(
rowA
->
dwIndex
,
rowB
->
dwIndex
);
return
DWORD_cmp
(
RtlUlongByteSwap
(
rowA
->
dwAddr
),
RtlUlongByteSwap
(
rowB
->
dwAddr
));
}
...
...
dlls/iphlpapi/tests/iphlpapi.c
View file @
bfd7b9bc
...
...
@@ -371,6 +371,7 @@ static void testGetIpNetTable(void)
{
DWORD
apiReturn
;
ULONG
dwSize
=
0
;
unsigned
int
i
;
apiReturn
=
GetIpNetTable
(
NULL
,
NULL
,
FALSE
);
if
(
apiReturn
==
ERROR_NOT_SUPPORTED
)
{
...
...
@@ -390,11 +391,23 @@ static void testGetIpNetTable(void)
PMIB_IPNETTABLE
buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
dwSize
);
memset
(
buf
,
0xcc
,
dwSize
);
apiReturn
=
GetIpNetTable
(
buf
,
&
dwSize
,
FALS
E
);
apiReturn
=
GetIpNetTable
(
buf
,
&
dwSize
,
TRU
E
);
ok
((
apiReturn
==
NO_ERROR
&&
buf
->
dwNumEntries
)
||
(
apiReturn
==
ERROR_NO_DATA
&&
!
buf
->
dwNumEntries
),
"got apiReturn %lu, dwSize %lu, buf->dwNumEntries %lu.
\n
"
,
apiReturn
,
dwSize
,
buf
->
dwNumEntries
);
if
(
apiReturn
==
NO_ERROR
)
{
for
(
i
=
0
;
i
<
buf
->
dwNumEntries
-
1
;
++
i
)
{
ok
(
buf
->
table
[
i
].
dwIndex
<=
buf
->
table
[
i
+
1
].
dwIndex
,
"Entries are not sorted by index, i %u.
\n
"
,
i
);
if
(
buf
->
table
[
i
].
dwIndex
==
buf
->
table
[
i
+
1
].
dwIndex
)
ok
(
ntohl
(
buf
->
table
[
i
].
dwAddr
)
<=
ntohl
(
buf
->
table
[
i
+
1
].
dwAddr
),
"Entries are not sorted by address, i %u.
\n
"
,
i
);
}
}
if
(
apiReturn
==
NO_ERROR
&&
winetest_debug
>
1
)
{
DWORD
i
,
j
;
...
...
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