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
ad9ba6a0
Commit
ad9ba6a0
authored
Aug 18, 2015
by
Hans Leidekker
Committed by
Alexandre Julliard
Aug 18, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iphlpapi: Implement GetIfTable2.
parent
d5a1e47a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
1 deletion
+65
-1
iphlpapi.spec
dlls/iphlpapi/iphlpapi.spec
+1
-1
iphlpapi_main.c
dlls/iphlpapi/iphlpapi_main.c
+37
-0
iphlpapi.c
dlls/iphlpapi/tests/iphlpapi.c
+21
-0
netioapi.h
include/netioapi.h
+6
-0
No files found.
dlls/iphlpapi/iphlpapi.spec
View file @
ad9ba6a0
...
...
@@ -91,7 +91,7 @@
@ stub GetIfEntryFromStack
#@ stub GetIfStackTable
@ stdcall GetIfTable( ptr ptr long )
#@ stub GetIfTable2
@ stdcall GetIfTable2( ptr )
#@ stub GetIfTable2Ex
@ stub GetIfTableFromStack
@ stub GetIgmpList
...
...
dlls/iphlpapi/iphlpapi_main.c
View file @
ad9ba6a0
...
...
@@ -1828,6 +1828,43 @@ DWORD WINAPI GetIfTable(PMIB_IFTABLE pIfTable, PULONG pdwSize, BOOL bOrder)
return
ret
;
}
/******************************************************************
* GetIfTable2 (IPHLPAPI.@)
*/
DWORD
WINAPI
GetIfTable2
(
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
);
if
(
!
table
)
return
ERROR_INVALID_PARAMETER
;
if
((
nb_interfaces
=
get_interface_indices
(
FALSE
,
NULL
))
>
1
)
size
+=
(
nb_interfaces
-
1
)
*
sizeof
(
MIB_IF_ROW2
);
if
(
!
(
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
)))
return
ERROR_OUTOFMEMORY
;
get_interface_indices
(
FALSE
,
&
index_table
);
if
(
!
index_table
)
{
HeapFree
(
GetProcessHeap
(),
0
,
ret
);
return
ERROR_OUTOFMEMORY
;
}
ret
->
NumEntries
=
0
;
for
(
i
=
0
;
i
<
index_table
->
numIndexes
;
i
++
)
{
ret
->
Table
[
i
].
InterfaceIndex
=
index_table
->
indexes
[
i
];
GetIfEntry2
(
&
ret
->
Table
[
i
]
);
ret
->
NumEntries
++
;
}
HeapFree
(
GetProcessHeap
(),
0
,
index_table
);
*
table
=
ret
;
return
NO_ERROR
;
}
/******************************************************************
* GetInterfaceInfo (IPHLPAPI.@)
...
...
dlls/iphlpapi/tests/iphlpapi.c
View file @
ad9ba6a0
...
...
@@ -56,6 +56,7 @@ static DWORD (WINAPI *pGetIfEntry)(PMIB_IFROW);
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
*
pGetIpForwardTable
)(
PMIB_IPFORWARDTABLE
,
PULONG
,
BOOL
);
static
DWORD
(
WINAPI
*
pGetIpNetTable
)(
PMIB_IPNETTABLE
,
PULONG
,
BOOL
);
static
DWORD
(
WINAPI
*
pGetInterfaceInfo
)(
PIP_INTERFACE_INFO
,
PULONG
);
...
...
@@ -102,6 +103,7 @@ static void loadIPHlpApi(void)
pGetIfEntry2
=
(
void
*
)
GetProcAddress
(
hLibrary
,
"GetIfEntry2"
);
pGetFriendlyIfIndex
=
(
void
*
)
GetProcAddress
(
hLibrary
,
"GetFriendlyIfIndex"
);
pGetIfTable
=
(
void
*
)
GetProcAddress
(
hLibrary
,
"GetIfTable"
);
pGetIfTable2
=
(
void
*
)
GetProcAddress
(
hLibrary
,
"GetIfTable2"
);
pGetIpForwardTable
=
(
void
*
)
GetProcAddress
(
hLibrary
,
"GetIpForwardTable"
);
pGetIpNetTable
=
(
void
*
)
GetProcAddress
(
hLibrary
,
"GetIpNetTable"
);
pGetInterfaceInfo
=
(
void
*
)
GetProcAddress
(
hLibrary
,
"GetInterfaceInfo"
);
...
...
@@ -1868,6 +1870,24 @@ static void test_GetIfEntry2(void)
ok
(
row
.
InterfaceIndex
==
index
,
"got %u
\n
"
,
index
);
}
static
void
test_GetIfTable2
(
void
)
{
DWORD
ret
;
MIB_IF_TABLE2
*
table
;
if
(
!
pGetIfTable2
)
{
win_skip
(
"GetIfTable2 not available
\n
"
);
return
;
}
table
=
NULL
;
ret
=
pGetIfTable2
(
&
table
);
ok
(
ret
==
NO_ERROR
,
"got %u
\n
"
,
ret
);
ok
(
table
!=
NULL
,
"table not set
\n
"
);
pFreeMibTable
(
table
);
}
START_TEST
(
iphlpapi
)
{
...
...
@@ -1890,6 +1910,7 @@ START_TEST(iphlpapi)
test_CreateSortedAddressPairs
();
test_interface_identifier_conversion
();
test_GetIfEntry2
();
test_GetIfTable2
();
freeIPHlpApi
();
}
}
include/netioapi.h
View file @
ad9ba6a0
...
...
@@ -76,6 +76,12 @@ typedef struct _MIB_IF_ROW2
ULONG64
OutQLen
;
}
MIB_IF_ROW2
,
*
PMIB_IF_ROW2
;
typedef
struct
_MIB_IF_TABLE2
{
ULONG
NumEntries
;
MIB_IF_ROW2
Table
[
1
];
}
MIB_IF_TABLE2
,
*
PMIB_IF_TABLE2
;
DWORD
WINAPI
ConvertInterfaceGuidToLuid
(
const
GUID
*
,
NET_LUID
*
);
DWORD
WINAPI
ConvertInterfaceIndexToLuid
(
NET_IFINDEX
,
NET_LUID
*
);
DWORD
WINAPI
ConvertInterfaceLuidToGuid
(
const
NET_LUID
*
,
GUID
*
);
...
...
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