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
18ba68ea
Commit
18ba68ea
authored
Sep 07, 2012
by
Hans Leidekker
Committed by
Alexandre Julliard
Sep 07, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iphlpapi: Implement GetExtendedUdpTable.
parent
bde51568
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
75 additions
and
13 deletions
+75
-13
iphlpapi.spec
dlls/iphlpapi/iphlpapi.spec
+1
-1
iphlpapi_main.c
dlls/iphlpapi/iphlpapi_main.c
+26
-11
ipstats.c
dlls/iphlpapi/ipstats.c
+0
-0
ipstats.h
dlls/iphlpapi/ipstats.h
+1
-0
iphlpapi.c
dlls/iphlpapi/tests/iphlpapi.c
+36
-0
iphlpapi.h
include/iphlpapi.h
+3
-0
iprtrmib.h
include/iprtrmib.h
+7
-0
udpmib.h
include/udpmib.h
+1
-1
No files found.
dlls/iphlpapi/iphlpapi.spec
View file @
18ba68ea
...
@@ -81,7 +81,7 @@
...
@@ -81,7 +81,7 @@
@ stub GetBestRouteFromStack
@ stub GetBestRouteFromStack
#@ stub GetCurrentThreadCompartmentId
#@ stub GetCurrentThreadCompartmentId
@ stdcall GetExtendedTcpTable( ptr ptr long long long long )
@ stdcall GetExtendedTcpTable( ptr ptr long long long long )
#@ stub GetExtendedUdpTable
@ stdcall GetExtendedUdpTable( ptr ptr long long long long )
@ stdcall GetFriendlyIfIndex( long )
@ stdcall GetFriendlyIfIndex( long )
#@ stub GetIcmpStatisticsEx
#@ stub GetIcmpStatisticsEx
@ stdcall GetIcmpStatistics( ptr )
@ stdcall GetIcmpStatistics( ptr )
...
...
dlls/iphlpapi/iphlpapi_main.c
View file @
18ba68ea
...
@@ -1917,31 +1917,46 @@ DWORD WINAPI GetExtendedTcpTable(PVOID pTcpTable, PDWORD pdwSize, BOOL bOrder,
...
@@ -1917,31 +1917,46 @@ DWORD WINAPI GetExtendedTcpTable(PVOID pTcpTable, PDWORD pdwSize, BOOL bOrder,
*/
*/
DWORD
WINAPI
GetUdpTable
(
PMIB_UDPTABLE
pUdpTable
,
PDWORD
pdwSize
,
BOOL
bOrder
)
DWORD
WINAPI
GetUdpTable
(
PMIB_UDPTABLE
pUdpTable
,
PDWORD
pdwSize
,
BOOL
bOrder
)
{
{
DWORD
ret
;
return
GetExtendedUdpTable
(
pUdpTable
,
pdwSize
,
bOrder
,
AF_INET
,
UDP_TABLE_BASIC
,
0
);
PMIB_UDPTABLE
table
;
}
/******************************************************************
* GetExtendedUdpTable (IPHLPAPI.@)
*/
DWORD
WINAPI
GetExtendedUdpTable
(
PVOID
pUdpTable
,
PDWORD
pdwSize
,
BOOL
bOrder
,
ULONG
ulAf
,
UDP_TABLE_CLASS
TableClass
,
ULONG
Reserved
)
{
DWORD
ret
,
size
;
void
*
table
;
TRACE
(
"pUdpTable %p, pdwSize %p, bOrder %d
\n
"
,
pUdpTable
,
pdwSize
,
bOrder
);
TRACE
(
"pUdpTable %p, pdwSize %p, bOrder %d, ulAf %u, TableClass %u, Reserved %u
\n
"
,
pUdpTable
,
pdwSize
,
bOrder
,
ulAf
,
TableClass
,
Reserved
);
if
(
!
pdwSize
)
return
ERROR_INVALID_PARAMETER
;
if
(
!
pdwSize
)
return
ERROR_INVALID_PARAMETER
;
ret
=
AllocateAndGetUdpTableFromStack
(
&
table
,
bOrder
,
GetProcessHeap
(),
0
);
if
(
ulAf
!=
AF_INET
||
if
(
!
ret
)
{
(
TableClass
!=
UDP_TABLE_BASIC
&&
TableClass
!=
UDP_TABLE_OWNER_PID
))
DWORD
size
=
FIELD_OFFSET
(
MIB_UDPTABLE
,
table
[
table
->
dwNumEntries
]
);
{
if
(
!
pUdpTable
||
*
pdwSize
<
size
)
{
FIXME
(
"ulAf = %u, TableClass = %u not supported
\n
"
,
ulAf
,
TableClass
);
return
ERROR_NOT_SUPPORTED
;
}
if
((
ret
=
build_udp_table
(
TableClass
,
&
table
,
bOrder
,
GetProcessHeap
(),
0
,
&
size
)))
return
ret
;
if
(
!
pUdpTable
||
*
pdwSize
<
size
)
{
*
pdwSize
=
size
;
*
pdwSize
=
size
;
ret
=
ERROR_INSUFFICIENT_BUFFER
;
ret
=
ERROR_INSUFFICIENT_BUFFER
;
}
}
else
{
else
{
*
pdwSize
=
size
;
*
pdwSize
=
size
;
memcpy
(
pUdpTable
,
table
,
size
);
memcpy
(
pUdpTable
,
table
,
size
);
}
}
HeapFree
(
GetProcessHeap
(),
0
,
table
);
HeapFree
(
GetProcessHeap
(),
0
,
table
);
}
TRACE
(
"returning %d
\n
"
,
ret
);
return
ret
;
return
ret
;
}
}
/******************************************************************
/******************************************************************
* GetUniDirectionalAdapterInfo (IPHLPAPI.@)
* GetUniDirectionalAdapterInfo (IPHLPAPI.@)
*
*
...
...
dlls/iphlpapi/ipstats.c
View file @
18ba68ea
This diff is collapsed.
Click to expand it.
dlls/iphlpapi/ipstats.h
View file @
18ba68ea
...
@@ -38,5 +38,6 @@ DWORD WINAPI AllocateAndGetIpNetTableFromStack(PMIB_IPNETTABLE *ppIpNetTable, BO
...
@@ -38,5 +38,6 @@ DWORD WINAPI AllocateAndGetIpNetTableFromStack(PMIB_IPNETTABLE *ppIpNetTable, BO
DWORD
WINAPI
AllocateAndGetIpForwardTableFromStack
(
PMIB_IPFORWARDTABLE
*
ppIpForwardTable
,
BOOL
bOrder
,
HANDLE
heap
,
DWORD
flags
)
DECLSPEC_HIDDEN
;
DWORD
WINAPI
AllocateAndGetIpForwardTableFromStack
(
PMIB_IPFORWARDTABLE
*
ppIpForwardTable
,
BOOL
bOrder
,
HANDLE
heap
,
DWORD
flags
)
DECLSPEC_HIDDEN
;
DWORD
build_tcp_table
(
TCP_TABLE_CLASS
,
void
**
,
BOOL
,
HANDLE
,
DWORD
,
DWORD
*
)
DECLSPEC_HIDDEN
;
DWORD
build_tcp_table
(
TCP_TABLE_CLASS
,
void
**
,
BOOL
,
HANDLE
,
DWORD
,
DWORD
*
)
DECLSPEC_HIDDEN
;
DWORD
build_udp_table
(
UDP_TABLE_CLASS
,
void
**
,
BOOL
,
HANDLE
,
DWORD
,
DWORD
*
)
DECLSPEC_HIDDEN
;
#endif
/* ndef WINE_IPSTATS_H_ */
#endif
/* ndef WINE_IPSTATS_H_ */
dlls/iphlpapi/tests/iphlpapi.c
View file @
18ba68ea
...
@@ -71,6 +71,7 @@ static DWORD (WINAPI *pGetAdaptersAddresses)(ULONG,ULONG,PVOID,PIP_ADAPTER_ADDRE
...
@@ -71,6 +71,7 @@ static DWORD (WINAPI *pGetAdaptersAddresses)(ULONG,ULONG,PVOID,PIP_ADAPTER_ADDRE
static
DWORD
(
WINAPI
*
pNotifyAddrChange
)(
PHANDLE
,
LPOVERLAPPED
);
static
DWORD
(
WINAPI
*
pNotifyAddrChange
)(
PHANDLE
,
LPOVERLAPPED
);
static
BOOL
(
WINAPI
*
pCancelIPChangeNotify
)(
LPOVERLAPPED
);
static
BOOL
(
WINAPI
*
pCancelIPChangeNotify
)(
LPOVERLAPPED
);
static
DWORD
(
WINAPI
*
pGetExtendedTcpTable
)(
PVOID
,
PDWORD
,
BOOL
,
ULONG
,
TCP_TABLE_CLASS
,
ULONG
);
static
DWORD
(
WINAPI
*
pGetExtendedTcpTable
)(
PVOID
,
PDWORD
,
BOOL
,
ULONG
,
TCP_TABLE_CLASS
,
ULONG
);
static
DWORD
(
WINAPI
*
pGetExtendedUdpTable
)(
PVOID
,
PDWORD
,
BOOL
,
ULONG
,
UDP_TABLE_CLASS
,
ULONG
);
static
DWORD
(
WINAPI
*
pSetTcpEntry
)(
PMIB_TCPROW
);
static
DWORD
(
WINAPI
*
pSetTcpEntry
)(
PMIB_TCPROW
);
static
void
loadIPHlpApi
(
void
)
static
void
loadIPHlpApi
(
void
)
...
@@ -102,6 +103,7 @@ static void loadIPHlpApi(void)
...
@@ -102,6 +103,7 @@ static void loadIPHlpApi(void)
pNotifyAddrChange
=
(
void
*
)
GetProcAddress
(
hLibrary
,
"NotifyAddrChange"
);
pNotifyAddrChange
=
(
void
*
)
GetProcAddress
(
hLibrary
,
"NotifyAddrChange"
);
pCancelIPChangeNotify
=
(
void
*
)
GetProcAddress
(
hLibrary
,
"CancelIPChangeNotify"
);
pCancelIPChangeNotify
=
(
void
*
)
GetProcAddress
(
hLibrary
,
"CancelIPChangeNotify"
);
pGetExtendedTcpTable
=
(
void
*
)
GetProcAddress
(
hLibrary
,
"GetExtendedTcpTable"
);
pGetExtendedTcpTable
=
(
void
*
)
GetProcAddress
(
hLibrary
,
"GetExtendedTcpTable"
);
pGetExtendedUdpTable
=
(
void
*
)
GetProcAddress
(
hLibrary
,
"GetExtendedUdpTable"
);
pSetTcpEntry
=
(
void
*
)
GetProcAddress
(
hLibrary
,
"SetTcpEntry"
);
pSetTcpEntry
=
(
void
*
)
GetProcAddress
(
hLibrary
,
"SetTcpEntry"
);
}
}
}
}
...
@@ -1203,6 +1205,39 @@ static void test_GetExtendedTcpTable(void)
...
@@ -1203,6 +1205,39 @@ static void test_GetExtendedTcpTable(void)
HeapFree
(
GetProcessHeap
(),
0
,
table_pid
);
HeapFree
(
GetProcessHeap
(),
0
,
table_pid
);
}
}
static
void
test_GetExtendedUdpTable
(
void
)
{
DWORD
ret
,
size
;
MIB_UDPTABLE
*
table
;
MIB_UDPTABLE_OWNER_PID
*
table_pid
;
if
(
!
pGetExtendedUdpTable
)
{
win_skip
(
"GetExtendedUdpTable not available
\n
"
);
return
;
}
ret
=
pGetExtendedUdpTable
(
NULL
,
NULL
,
TRUE
,
AF_INET
,
UDP_TABLE_BASIC
,
0
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"got %u
\n
"
,
ret
);
size
=
0
;
ret
=
pGetExtendedUdpTable
(
NULL
,
&
size
,
TRUE
,
AF_INET
,
UDP_TABLE_BASIC
,
0
);
ok
(
ret
==
ERROR_INSUFFICIENT_BUFFER
,
"got %u
\n
"
,
ret
);
table
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
ret
=
pGetExtendedUdpTable
(
table
,
&
size
,
TRUE
,
AF_INET
,
UDP_TABLE_BASIC
,
0
);
ok
(
ret
==
ERROR_SUCCESS
,
"got %u
\n
"
,
ret
);
HeapFree
(
GetProcessHeap
(),
0
,
table
);
size
=
0
;
ret
=
pGetExtendedUdpTable
(
NULL
,
&
size
,
TRUE
,
AF_INET
,
UDP_TABLE_OWNER_PID
,
0
);
ok
(
ret
==
ERROR_INSUFFICIENT_BUFFER
,
"got %u
\n
"
,
ret
);
table_pid
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
ret
=
pGetExtendedUdpTable
(
table_pid
,
&
size
,
TRUE
,
AF_INET
,
UDP_TABLE_OWNER_PID
,
0
);
ok
(
ret
==
ERROR_SUCCESS
,
"got %u
\n
"
,
ret
);
HeapFree
(
GetProcessHeap
(),
0
,
table_pid
);
}
START_TEST
(
iphlpapi
)
START_TEST
(
iphlpapi
)
{
{
...
@@ -1221,6 +1256,7 @@ START_TEST(iphlpapi)
...
@@ -1221,6 +1256,7 @@ START_TEST(iphlpapi)
testWin2KFunctions
();
testWin2KFunctions
();
test_GetAdaptersAddresses
();
test_GetAdaptersAddresses
();
test_GetExtendedTcpTable
();
test_GetExtendedTcpTable
();
test_GetExtendedUdpTable
();
freeIPHlpApi
();
freeIPHlpApi
();
}
}
}
}
include/iphlpapi.h
View file @
18ba68ea
...
@@ -29,6 +29,9 @@ extern "C" {
...
@@ -29,6 +29,9 @@ extern "C" {
DWORD
WINAPI
GetExtendedTcpTable
(
PVOID
pTcpTable
,
PDWORD
pdwSize
,
BOOL
bOrder
,
DWORD
WINAPI
GetExtendedTcpTable
(
PVOID
pTcpTable
,
PDWORD
pdwSize
,
BOOL
bOrder
,
ULONG
ulAf
,
TCP_TABLE_CLASS
TableClass
,
ULONG
Reserved
);
ULONG
ulAf
,
TCP_TABLE_CLASS
TableClass
,
ULONG
Reserved
);
DWORD
WINAPI
GetExtendedUdpTable
(
PVOID
pUdpTable
,
PDWORD
pdwSize
,
BOOL
bOrder
,
ULONG
ulAf
,
UDP_TABLE_CLASS
TableClass
,
ULONG
Reserved
);
DWORD
WINAPI
GetNumberOfInterfaces
(
PDWORD
pdwNumIf
);
DWORD
WINAPI
GetNumberOfInterfaces
(
PDWORD
pdwNumIf
);
DWORD
WINAPI
GetIfEntry
(
PMIB_IFROW
pIfRow
);
DWORD
WINAPI
GetIfEntry
(
PMIB_IFROW
pIfRow
);
...
...
include/iprtrmib.h
View file @
18ba68ea
...
@@ -38,4 +38,11 @@ typedef enum _TCP_TABLE_CLASS
...
@@ -38,4 +38,11 @@ typedef enum _TCP_TABLE_CLASS
TCP_TABLE_OWNER_MODULE_ALL
TCP_TABLE_OWNER_MODULE_ALL
}
TCP_TABLE_CLASS
,
*
PTCP_TABLE_CLASS
;
}
TCP_TABLE_CLASS
,
*
PTCP_TABLE_CLASS
;
typedef
enum
_UDP_TABLE_CLASS
{
UDP_TABLE_BASIC
,
UDP_TABLE_OWNER_PID
,
UDP_TABLE_OWNER_MODULE
}
UDP_TABLE_CLASS
,
*
PUDP_TABLE_CLASS
;
#endif
/* WINE_IPRTRMIB_H__ */
#endif
/* WINE_IPRTRMIB_H__ */
include/udpmib.h
View file @
18ba68ea
...
@@ -39,6 +39,7 @@ typedef struct _MIB_UDPROW_OWNER_PID
...
@@ -39,6 +39,7 @@ typedef struct _MIB_UDPROW_OWNER_PID
{
{
DWORD
dwLocalAddr
;
DWORD
dwLocalAddr
;
DWORD
dwLocalPort
;
DWORD
dwLocalPort
;
DWORD
dwOwningPid
;
}
MIB_UDPROW_OWNER_PID
,
*
PMIB_UDPROW_OWNER_PID
;
}
MIB_UDPROW_OWNER_PID
,
*
PMIB_UDPROW_OWNER_PID
;
typedef
struct
_MIB_UDPTABLE_OWNER_PID
typedef
struct
_MIB_UDPTABLE_OWNER_PID
...
@@ -47,7 +48,6 @@ typedef struct _MIB_UDPTABLE_OWNER_PID
...
@@ -47,7 +48,6 @@ typedef struct _MIB_UDPTABLE_OWNER_PID
MIB_UDPROW_OWNER_PID
table
[
1
];
MIB_UDPROW_OWNER_PID
table
[
1
];
}
MIB_UDPTABLE_OWNER_PID
,
*
PMIB_UDPTABLE_OWNER_PID
;
}
MIB_UDPTABLE_OWNER_PID
,
*
PMIB_UDPTABLE_OWNER_PID
;
/* UDP statistics */
/* UDP statistics */
typedef
struct
_MIB_UDPSTATS
typedef
struct
_MIB_UDPSTATS
...
...
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