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
98f77c4f
Commit
98f77c4f
authored
May 11, 2017
by
Hans Leidekker
Committed by
Alexandre Julliard
May 11, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iphlpapi: Adapter names returned from GetAdaptersAddresses are GUID strings.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
564170cb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
5 deletions
+19
-5
iphlpapi_main.c
dlls/iphlpapi/iphlpapi_main.c
+5
-4
iphlpapi.c
dlls/iphlpapi/tests/iphlpapi.c
+14
-1
No files found.
dlls/iphlpapi/iphlpapi_main.c
View file @
98f77c4f
...
...
@@ -978,7 +978,7 @@ static ULONG adapterAddressesFromIndex(ULONG family, ULONG flags, IF_INDEX index
}
total_size
=
sizeof
(
IP_ADAPTER_ADDRESSES
);
total_size
+=
IF_NAMESIZE
;
total_size
+=
39
;
/* "{00000000-0000-0000-0000-000000000000}" */
total_size
+=
IF_NAMESIZE
*
sizeof
(
WCHAR
);
if
(
!
(
flags
&
GAA_FLAG_SKIP_FRIENDLY_NAME
))
total_size
+=
IF_NAMESIZE
*
sizeof
(
WCHAR
);
...
...
@@ -1009,10 +1009,11 @@ static ULONG adapterAddressesFromIndex(ULONG family, ULONG flags, IF_INDEX index
aa
->
u
.
s
.
Length
=
sizeof
(
IP_ADAPTER_ADDRESSES
);
aa
->
u
.
s
.
IfIndex
=
index
;
getInterfaceNameByIndex
(
index
,
name
);
memcpy
(
ptr
,
name
,
IF_NAMESIZE
);
sprintf
(
ptr
,
"{%08x-0000-0000-0000-000000000000}"
,
index
);
aa
->
AdapterName
=
ptr
;
ptr
+=
IF_NAMESIZE
;
ptr
+=
39
;
getInterfaceNameByIndex
(
index
,
name
);
if
(
!
(
flags
&
GAA_FLAG_SKIP_FRIENDLY_NAME
))
{
aa
->
FriendlyName
=
(
WCHAR
*
)
ptr
;
...
...
dlls/iphlpapi/tests/iphlpapi.c
View file @
98f77c4f
...
...
@@ -1414,8 +1414,10 @@ static void test_GetAdaptersAddresses(void)
for
(
aa
=
ptr
;
!
ret
&&
aa
;
aa
=
aa
->
Next
)
{
char
temp
[
128
];
char
temp
[
128
]
,
buf
[
39
]
;
IP_ADAPTER_PREFIX
*
prefix
;
DWORD
status
;
GUID
guid
;
ok
(
S
(
U
(
*
aa
)).
Length
==
sizeof
(
IP_ADAPTER_ADDRESSES_LH
)
||
S
(
U
(
*
aa
)).
Length
==
sizeof
(
IP_ADAPTER_ADDRESSES_XP
),
...
...
@@ -1524,6 +1526,17 @@ static void test_GetAdaptersAddresses(void)
trace
(
"Dhcpv6Iaid: %u
\n
"
,
aa
->
Dhcpv6Iaid
);
trace
(
"FirstDnsSuffix: %p
\n
"
,
aa
->
FirstDnsSuffix
);
trace
(
"
\n
"
);
if
(
pConvertInterfaceLuidToGuid
)
{
status
=
pConvertInterfaceLuidToGuid
(
&
aa
->
Luid
,
&
guid
);
ok
(
!
status
,
"got %u
\n
"
,
status
);
sprintf
(
buf
,
"{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}"
,
guid
.
Data1
,
guid
.
Data2
,
guid
.
Data3
,
guid
.
Data4
[
0
],
guid
.
Data4
[
1
],
guid
.
Data4
[
2
],
guid
.
Data4
[
3
],
guid
.
Data4
[
4
],
guid
.
Data4
[
5
],
guid
.
Data4
[
6
],
guid
.
Data4
[
7
]);
ok
(
!
strcasecmp
(
aa
->
AdapterName
,
buf
),
"expected '%s' got '%s'
\n
"
,
aa
->
AdapterName
,
buf
);
}
}
HeapFree
(
GetProcessHeap
(),
0
,
ptr
);
}
...
...
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