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
d2dbd9bd
Commit
d2dbd9bd
authored
Apr 16, 2012
by
Hans Leidekker
Committed by
Alexandre Julliard
Apr 16, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iphlpapi: Add tests for GetExtendedTcpTable.
parent
e78ac471
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
0 deletions
+39
-0
iphlpapi.c
dlls/iphlpapi/tests/iphlpapi.c
+39
-0
No files found.
dlls/iphlpapi/tests/iphlpapi.c
View file @
d2dbd9bd
...
...
@@ -66,6 +66,7 @@ typedef DWORD (WINAPI *GetPerAdapterInfoFunc)(ULONG,PIP_PER_ADAPTER_INFO,PULONG)
typedef
DWORD
(
WINAPI
*
GetAdaptersAddressesFunc
)(
ULONG
,
ULONG
,
PVOID
,
PIP_ADAPTER_ADDRESSES
,
PULONG
);
typedef
DWORD
(
WINAPI
*
NotifyAddrChangeFunc
)(
PHANDLE
,
LPOVERLAPPED
);
typedef
BOOL
(
WINAPI
*
CancelIPChangeNotifyFunc
)(
LPOVERLAPPED
);
typedef
DWORD
(
WINAPI
*
GetExtendedTcpTableFunc
)(
PVOID
,
PDWORD
,
BOOL
,
ULONG
,
TCP_TABLE_CLASS
,
ULONG
);
static
GetNumberOfInterfacesFunc
gGetNumberOfInterfaces
=
NULL
;
static
GetIpAddrTableFunc
gGetIpAddrTable
=
NULL
;
...
...
@@ -87,6 +88,7 @@ static GetPerAdapterInfoFunc gGetPerAdapterInfo = NULL;
static
GetAdaptersAddressesFunc
gGetAdaptersAddresses
=
NULL
;
static
NotifyAddrChangeFunc
gNotifyAddrChange
=
NULL
;
static
CancelIPChangeNotifyFunc
gCancelIPChangeNotify
=
NULL
;
static
GetExtendedTcpTableFunc
gGetExtendedTcpTable
=
NULL
;
static
void
loadIPHlpApi
(
void
)
{
...
...
@@ -130,6 +132,8 @@ static void loadIPHlpApi(void)
hLibrary
,
"NotifyAddrChange"
);
gCancelIPChangeNotify
=
(
CancelIPChangeNotifyFunc
)
GetProcAddress
(
hLibrary
,
"CancelIPChangeNotify"
);
gGetExtendedTcpTable
=
(
GetExtendedTcpTableFunc
)
GetProcAddress
(
hLibrary
,
"GetExtendedTcpTable"
);
}
}
...
...
@@ -154,6 +158,7 @@ static void freeIPHlpApi(void)
gGetUdpTable
=
NULL
;
gNotifyAddrChange
=
NULL
;
gCancelIPChangeNotify
=
NULL
;
gGetExtendedTcpTable
=
NULL
;
FreeLibrary
(
hLibrary
);
hLibrary
=
NULL
;
}
...
...
@@ -970,6 +975,39 @@ static void test_GetAdaptersAddresses(void)
HeapFree
(
GetProcessHeap
(),
0
,
ptr
);
}
static
void
test_GetExtendedTcpTable
(
void
)
{
DWORD
ret
,
size
;
MIB_TCPTABLE
*
table
;
MIB_TCPTABLE_OWNER_PID
*
table_pid
;
if
(
!
gGetExtendedTcpTable
)
{
win_skip
(
"GetExtendedTcpTable not available
\n
"
);
return
;
}
ret
=
gGetExtendedTcpTable
(
NULL
,
NULL
,
TRUE
,
AF_INET
,
TCP_TABLE_BASIC_ALL
,
0
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"got %u
\n
"
,
ret
);
size
=
0
;
ret
=
gGetExtendedTcpTable
(
NULL
,
&
size
,
TRUE
,
AF_INET
,
TCP_TABLE_BASIC_ALL
,
0
);
ok
(
ret
==
ERROR_INSUFFICIENT_BUFFER
,
"got %u
\n
"
,
ret
);
table
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
ret
=
gGetExtendedTcpTable
(
table
,
&
size
,
TRUE
,
AF_INET
,
TCP_TABLE_BASIC_ALL
,
0
);
ok
(
ret
==
ERROR_SUCCESS
,
"got %u
\n
"
,
ret
);
HeapFree
(
GetProcessHeap
(),
0
,
table
);
size
=
0
;
ret
=
gGetExtendedTcpTable
(
NULL
,
&
size
,
TRUE
,
AF_INET
,
TCP_TABLE_OWNER_PID_ALL
,
0
);
ok
(
ret
==
ERROR_INSUFFICIENT_BUFFER
,
"got %u
\n
"
,
ret
);
table_pid
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
ret
=
gGetExtendedTcpTable
(
table_pid
,
&
size
,
TRUE
,
AF_INET
,
TCP_TABLE_OWNER_PID_ALL
,
0
);
ok
(
ret
==
ERROR_SUCCESS
,
"got %u
\n
"
,
ret
);
HeapFree
(
GetProcessHeap
(),
0
,
table_pid
);
}
START_TEST
(
iphlpapi
)
{
...
...
@@ -987,6 +1025,7 @@ START_TEST(iphlpapi)
testWin2KFunctions
();
test_GetAdaptersAddresses
();
test_GetExtendedTcpTable
();
freeIPHlpApi
();
}
}
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