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 @@
@ stub GetBestRouteFromStack
#@ stub GetCurrentThreadCompartmentId
@ stdcall GetExtendedTcpTable( ptr ptr long long long long )
#@ stub GetExtendedUdpTable
@ stdcall GetExtendedUdpTable( ptr ptr long long long long )
@ stdcall GetFriendlyIfIndex( long )
#@ stub GetIcmpStatisticsEx
@ stdcall GetIcmpStatistics( ptr )
...
...
dlls/iphlpapi/iphlpapi_main.c
View file @
18ba68ea
...
...
@@ -1917,31 +1917,46 @@ DWORD WINAPI GetExtendedTcpTable(PVOID pTcpTable, PDWORD pdwSize, BOOL bOrder,
*/
DWORD
WINAPI
GetUdpTable
(
PMIB_UDPTABLE
pUdpTable
,
PDWORD
pdwSize
,
BOOL
bOrder
)
{
DWORD
ret
;
PMIB_UDPTABLE
table
;
return
GetExtendedUdpTable
(
pUdpTable
,
pdwSize
,
bOrder
,
AF_INET
,
UDP_TABLE_BASIC
,
0
);
}
/******************************************************************
* 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
;
ret
=
AllocateAndGetUdpTableFromStack
(
&
table
,
bOrder
,
GetProcessHeap
(),
0
);
if
(
!
ret
)
{
DWORD
size
=
FIELD_OFFSET
(
MIB_UDPTABLE
,
table
[
table
->
dwNumEntries
]
);
if
(
!
pUdpTable
||
*
pdwSize
<
size
)
{
if
(
ulAf
!=
AF_INET
||
(
TableClass
!=
UDP_TABLE_BASIC
&&
TableClass
!=
UDP_TABLE_OWNER_PID
))
{
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
;
ret
=
ERROR_INSUFFICIENT_BUFFER
;
}
else
{
else
{
*
pdwSize
=
size
;
memcpy
(
pUdpTable
,
table
,
size
);
}
HeapFree
(
GetProcessHeap
(),
0
,
table
);
}
TRACE
(
"returning %d
\n
"
,
ret
);
return
ret
;
}
/******************************************************************
* 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
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_udp_table
(
UDP_TABLE_CLASS
,
void
**
,
BOOL
,
HANDLE
,
DWORD
,
DWORD
*
)
DECLSPEC_HIDDEN
;
#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
static
DWORD
(
WINAPI
*
pNotifyAddrChange
)(
PHANDLE
,
LPOVERLAPPED
);
static
BOOL
(
WINAPI
*
pCancelIPChangeNotify
)(
LPOVERLAPPED
);
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
void
loadIPHlpApi
(
void
)
...
...
@@ -102,6 +103,7 @@ static void loadIPHlpApi(void)
pNotifyAddrChange
=
(
void
*
)
GetProcAddress
(
hLibrary
,
"NotifyAddrChange"
);
pCancelIPChangeNotify
=
(
void
*
)
GetProcAddress
(
hLibrary
,
"CancelIPChangeNotify"
);
pGetExtendedTcpTable
=
(
void
*
)
GetProcAddress
(
hLibrary
,
"GetExtendedTcpTable"
);
pGetExtendedUdpTable
=
(
void
*
)
GetProcAddress
(
hLibrary
,
"GetExtendedUdpTable"
);
pSetTcpEntry
=
(
void
*
)
GetProcAddress
(
hLibrary
,
"SetTcpEntry"
);
}
}
...
...
@@ -1203,6 +1205,39 @@ static void test_GetExtendedTcpTable(void)
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
)
{
...
...
@@ -1221,6 +1256,7 @@ START_TEST(iphlpapi)
testWin2KFunctions
();
test_GetAdaptersAddresses
();
test_GetExtendedTcpTable
();
test_GetExtendedUdpTable
();
freeIPHlpApi
();
}
}
include/iphlpapi.h
View file @
18ba68ea
...
...
@@ -29,6 +29,9 @@ extern "C" {
DWORD
WINAPI
GetExtendedTcpTable
(
PVOID
pTcpTable
,
PDWORD
pdwSize
,
BOOL
bOrder
,
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
GetIfEntry
(
PMIB_IFROW
pIfRow
);
...
...
include/iprtrmib.h
View file @
18ba68ea
...
...
@@ -38,4 +38,11 @@ typedef enum _TCP_TABLE_CLASS
TCP_TABLE_OWNER_MODULE_ALL
}
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__ */
include/udpmib.h
View file @
18ba68ea
...
...
@@ -39,6 +39,7 @@ typedef struct _MIB_UDPROW_OWNER_PID
{
DWORD
dwLocalAddr
;
DWORD
dwLocalPort
;
DWORD
dwOwningPid
;
}
MIB_UDPROW_OWNER_PID
,
*
PMIB_UDPROW_OWNER_PID
;
typedef
struct
_MIB_UDPTABLE_OWNER_PID
...
...
@@ -47,7 +48,6 @@ typedef struct _MIB_UDPTABLE_OWNER_PID
MIB_UDPROW_OWNER_PID
table
[
1
];
}
MIB_UDPTABLE_OWNER_PID
,
*
PMIB_UDPTABLE_OWNER_PID
;
/* UDP statistics */
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