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
e3fe1071
Commit
e3fe1071
authored
Jan 23, 2018
by
Hans Leidekker
Committed by
Alexandre Julliard
Jan 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iphlpapi: Implement if_indextoname.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9bafbe10
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
7 deletions
+36
-7
iphlpapi.spec
dlls/iphlpapi/iphlpapi.spec
+1
-1
iphlpapi_main.c
dlls/iphlpapi/iphlpapi_main.c
+10
-0
iphlpapi.c
dlls/iphlpapi/tests/iphlpapi.c
+23
-6
netioapi.h
include/netioapi.h
+2
-0
No files found.
dlls/iphlpapi/iphlpapi.spec
View file @
e3fe1071
...
...
@@ -159,7 +159,7 @@
@ stdcall IcmpSendEcho2Ex(ptr ptr ptr ptr long long ptr long ptr ptr long long)
@ stdcall IcmpSendEcho2(ptr ptr ptr ptr long ptr long ptr ptr long long)
@ stdcall IcmpSendEcho(ptr long ptr long ptr ptr long long)
#@ stub
if_indextoname
@ stdcall if_indextoname(long ptr) IPHLP_
if_indextoname
@ stdcall if_nametoindex(str) IPHLP_if_nametoindex
#@ stub InitializeIpForwardEntry
#@ stub InitializeIpInterfaceEntry
...
...
dlls/iphlpapi/iphlpapi_main.c
View file @
e3fe1071
...
...
@@ -3235,3 +3235,13 @@ IF_INDEX WINAPI IPHLP_if_nametoindex(const char *name)
return
0
;
}
/******************************************************************
* if_indextoname (IPHLPAPI.@)
*/
PCHAR
WINAPI
IPHLP_if_indextoname
(
NET_IFINDEX
index
,
PCHAR
name
)
{
TRACE
(
"(%u, %p)
\n
"
,
index
,
name
);
return
getInterfaceNameByIndex
(
index
,
name
);
}
dlls/iphlpapi/tests/iphlpapi.c
View file @
e3fe1071
...
...
@@ -97,6 +97,7 @@ static DWORD (WINAPI *pConvertInterfaceLuidToNameA)(const NET_LUID*,char*,SIZE_T
static
DWORD
(
WINAPI
*
pConvertInterfaceNameToLuidA
)(
const
char
*
,
NET_LUID
*
);
static
DWORD
(
WINAPI
*
pConvertInterfaceNameToLuidW
)(
const
WCHAR
*
,
NET_LUID
*
);
static
PCHAR
(
WINAPI
*
pif_indextoname
)(
NET_IFINDEX
,
PCHAR
);
static
NET_IFINDEX
(
WINAPI
*
pif_nametoindex
)(
const
char
*
);
static
void
loadIPHlpApi
(
void
)
...
...
@@ -148,6 +149,7 @@ static void loadIPHlpApi(void)
pConvertInterfaceLuidToNameW
=
(
void
*
)
GetProcAddress
(
hLibrary
,
"ConvertInterfaceLuidToNameW"
);
pConvertInterfaceNameToLuidA
=
(
void
*
)
GetProcAddress
(
hLibrary
,
"ConvertInterfaceNameToLuidA"
);
pConvertInterfaceNameToLuidW
=
(
void
*
)
GetProcAddress
(
hLibrary
,
"ConvertInterfaceNameToLuidW"
);
pif_indextoname
=
(
void
*
)
GetProcAddress
(
hLibrary
,
"if_indextoname"
);
pif_nametoindex
=
(
void
*
)
GetProcAddress
(
hLibrary
,
"if_nametoindex"
);
}
}
...
...
@@ -1786,7 +1788,7 @@ static void test_interface_identifier_conversion(void)
GUID
guid
;
SIZE_T
len
;
WCHAR
nameW
[
IF_MAX_STRING_SIZE
+
1
];
char
nameA
[
IF_MAX_STRING_SIZE
+
1
];
char
nameA
[
IF_MAX_STRING_SIZE
+
1
]
,
*
name
;
NET_IFINDEX
index
,
index2
;
if
(
!
pConvertInterfaceIndexToLuid
)
...
...
@@ -1947,9 +1949,12 @@ static void test_interface_identifier_conversion(void)
ok
(
luid
.
Info
.
NetLuidIndex
!=
0xdead
,
"index not set
\n
"
);
ok
(
luid
.
Info
.
IfType
==
IF_TYPE_ETHERNET_CSMACD
,
"got %u
\n
"
,
luid
.
Info
.
IfType
);
/* if_nametoindex */
if
(
pif_nametoindex
)
if
(
!
pif_nametoindex
||
!
pif_indextoname
)
{
skip
(
"if_nametoindex/if_indextoname not supported
\n
"
);
return
;
}
index2
=
pif_nametoindex
(
NULL
);
ok
(
!
index2
,
"Got unexpected index %u
\n
"
,
index2
);
index2
=
pif_nametoindex
(
nameA
);
...
...
@@ -1959,10 +1964,22 @@ static void test_interface_identifier_conversion(void)
ok
(
!
index2
,
"Got unexpected index %u
\n
"
,
index2
);
index2
=
pif_nametoindex
(
wine_dbgstr_guid
(
&
guid
)
);
ok
(
!
index2
,
"Got unexpected index %u for input %s
\n
"
,
index2
,
wine_dbgstr_guid
(
&
guid
)
);
}
else
name
=
pif_indextoname
(
0
,
NULL
);
ok
(
name
==
NULL
,
"got %s
\n
"
,
name
);
name
=
pif_indextoname
(
0
,
nameA
);
ok
(
name
==
NULL
,
"got %p
\n
"
,
name
);
name
=
pif_indextoname
(
~
0u
,
nameA
);
ok
(
name
==
NULL
,
"got %p
\n
"
,
name
);
nameA
[
0
]
=
0
;
name
=
pif_indextoname
(
1
,
nameA
);
if
(
name
!=
NULL
)
{
skip
(
"if_nametoindex not supported
\n
"
);
ok
(
name
[
0
],
"empty name
\n
"
);
ok
(
name
==
nameA
,
"got %p
\n
"
,
name
);
}
}
...
...
include/netioapi.h
View file @
e3fe1071
...
...
@@ -174,5 +174,7 @@ void WINAPI FreeMibTable(void*);
DWORD
WINAPI
GetIfEntry2
(
MIB_IF_ROW2
*
);
DWORD
WINAPI
GetIfTable2
(
MIB_IF_TABLE2
**
);
DWORD
WINAPI
GetUnicastIpAddressEntry
(
MIB_UNICASTIPADDRESS_ROW
*
);
PCHAR
WINAPI
if_indextoname
(
NET_IFINDEX
,
PCHAR
);
NET_IFINDEX
WINAPI
if_nametoindex
(
PCSTR
);
#endif
/* __WINE_NETIOAPI_H */
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