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
ebf5b23c
Commit
ebf5b23c
authored
May 25, 2017
by
André Hentschel
Committed by
Alexandre Julliard
May 30, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iphlpapi: Add partial implementation of GetIfTable2Ex.
Signed-off-by:
André Hentschel
<
nerv@dawncrow.de
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
52afd729
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
5 deletions
+57
-5
iphlpapi.spec
dlls/iphlpapi/iphlpapi.spec
+1
-1
iphlpapi_main.c
dlls/iphlpapi/iphlpapi_main.c
+17
-4
iphlpapi.c
dlls/iphlpapi/tests/iphlpapi.c
+33
-0
netioapi.h
include/netioapi.h
+6
-0
No files found.
dlls/iphlpapi/iphlpapi.spec
View file @
ebf5b23c
...
...
@@ -92,7 +92,7 @@
#@ stub GetIfStackTable
@ stdcall GetIfTable( ptr ptr long )
@ stdcall GetIfTable2( ptr )
#@ stub GetIfTable2Ex
@ stdcall GetIfTable2Ex( long ptr )
@ stub GetIfTableFromStack
@ stub GetIgmpList
@ stdcall GetInterfaceInfo( ptr ptr )
...
...
dlls/iphlpapi/iphlpapi_main.c
View file @
ebf5b23c
...
...
@@ -1852,17 +1852,21 @@ DWORD WINAPI GetIfTable(PMIB_IFTABLE pIfTable, PULONG pdwSize, BOOL bOrder)
}
/******************************************************************
* GetIfTable2 (IPHLPAPI.@)
* GetIfTable2
Ex
(IPHLPAPI.@)
*/
DWORD
WINAPI
GetIfTable2
(
MIB_IF_TABLE2
**
table
)
DWORD
WINAPI
GetIfTable2
Ex
(
MIB_IF_TABLE_LEVEL
level
,
MIB_IF_TABLE2
**
table
)
{
DWORD
i
,
nb_interfaces
,
size
=
sizeof
(
MIB_IF_TABLE2
);
InterfaceIndexTable
*
index_table
;
MIB_IF_TABLE2
*
ret
;
TRACE
(
"
table %p
\n
"
,
table
);
TRACE
(
"
level %u, table %p
\n
"
,
level
,
table
);
if
(
!
table
)
return
ERROR_INVALID_PARAMETER
;
if
(
!
table
||
level
>
MibIfTableRaw
)
return
ERROR_INVALID_PARAMETER
;
if
(
level
!=
MibIfTableNormal
)
FIXME
(
"level %u not fully supported
\n
"
,
level
);
if
((
nb_interfaces
=
get_interface_indices
(
FALSE
,
NULL
))
>
1
)
size
+=
(
nb_interfaces
-
1
)
*
sizeof
(
MIB_IF_ROW2
);
...
...
@@ -1890,6 +1894,15 @@ DWORD WINAPI GetIfTable2( MIB_IF_TABLE2 **table )
}
/******************************************************************
* GetIfTable2 (IPHLPAPI.@)
*/
DWORD
WINAPI
GetIfTable2
(
MIB_IF_TABLE2
**
table
)
{
TRACE
(
"table %p
\n
"
,
table
);
return
GetIfTable2Ex
(
MibIfTableNormal
,
table
);
}
/******************************************************************
* GetInterfaceInfo (IPHLPAPI.@)
*
* Get a list of network interface adapters.
...
...
dlls/iphlpapi/tests/iphlpapi.c
View file @
ebf5b23c
...
...
@@ -58,6 +58,7 @@ static DWORD (WINAPI *pGetIfEntry2)(PMIB_IF_ROW2);
static
DWORD
(
WINAPI
*
pGetFriendlyIfIndex
)(
DWORD
);
static
DWORD
(
WINAPI
*
pGetIfTable
)(
PMIB_IFTABLE
,
PULONG
,
BOOL
);
static
DWORD
(
WINAPI
*
pGetIfTable2
)(
PMIB_IF_TABLE2
*
);
static
DWORD
(
WINAPI
*
pGetIfTable2Ex
)(
MIB_IF_TABLE_LEVEL
,
PMIB_IF_TABLE2
*
);
static
DWORD
(
WINAPI
*
pGetIpForwardTable
)(
PMIB_IPFORWARDTABLE
,
PULONG
,
BOOL
);
static
DWORD
(
WINAPI
*
pGetIpNetTable
)(
PMIB_IPNETTABLE
,
PULONG
,
BOOL
);
static
DWORD
(
WINAPI
*
pGetInterfaceInfo
)(
PIP_INTERFACE_INFO
,
PULONG
);
...
...
@@ -110,6 +111,7 @@ static void loadIPHlpApi(void)
pGetFriendlyIfIndex
=
(
void
*
)
GetProcAddress
(
hLibrary
,
"GetFriendlyIfIndex"
);
pGetIfTable
=
(
void
*
)
GetProcAddress
(
hLibrary
,
"GetIfTable"
);
pGetIfTable2
=
(
void
*
)
GetProcAddress
(
hLibrary
,
"GetIfTable2"
);
pGetIfTable2Ex
=
(
void
*
)
GetProcAddress
(
hLibrary
,
"GetIfTable2Ex"
);
pGetIpForwardTable
=
(
void
*
)
GetProcAddress
(
hLibrary
,
"GetIpForwardTable"
);
pGetIpNetTable
=
(
void
*
)
GetProcAddress
(
hLibrary
,
"GetIpNetTable"
);
pGetInterfaceInfo
=
(
void
*
)
GetProcAddress
(
hLibrary
,
"GetInterfaceInfo"
);
...
...
@@ -2023,6 +2025,36 @@ static void test_GetIfTable2(void)
pFreeMibTable
(
table
);
}
static
void
test_GetIfTable2Ex
(
void
)
{
DWORD
ret
;
MIB_IF_TABLE2
*
table
;
if
(
!
pGetIfTable2Ex
)
{
win_skip
(
"GetIfTable2Ex not available
\n
"
);
return
;
}
table
=
NULL
;
ret
=
pGetIfTable2Ex
(
MibIfTableNormal
,
&
table
);
ok
(
ret
==
NO_ERROR
,
"got %u
\n
"
,
ret
);
ok
(
table
!=
NULL
,
"table not set
\n
"
);
pFreeMibTable
(
table
);
table
=
NULL
;
ret
=
pGetIfTable2Ex
(
MibIfTableRaw
,
&
table
);
ok
(
ret
==
NO_ERROR
,
"got %u
\n
"
,
ret
);
ok
(
table
!=
NULL
,
"table not set
\n
"
);
pFreeMibTable
(
table
);
table
=
NULL
;
ret
=
pGetIfTable2Ex
(
2
,
&
table
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"got %u
\n
"
,
ret
);
ok
(
!
table
,
"table should not be set
\n
"
);
pFreeMibTable
(
table
);
}
static
void
test_GetUnicastIpAddressEntry
(
void
)
{
IP_ADAPTER_ADDRESSES
*
aa
,
*
ptr
;
...
...
@@ -2208,6 +2240,7 @@ START_TEST(iphlpapi)
test_interface_identifier_conversion
();
test_GetIfEntry2
();
test_GetIfTable2
();
test_GetIfTable2Ex
();
test_GetUnicastIpAddressEntry
();
test_GetUnicastIpAddressTable
();
freeIPHlpApi
();
...
...
include/netioapi.h
View file @
ebf5b23c
...
...
@@ -21,6 +21,12 @@
#include <ntddndis.h>
typedef
enum
_MIB_IF_TABLE_LEVEL
{
MibIfTableNormal
,
MibIfTableRaw
}
MIB_IF_TABLE_LEVEL
,
*
PMIB_IF_TABLE_LEVEL
;
typedef
enum
_MIB_NOTIFICATION_TYPE
{
MibParameterNotification
,
...
...
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