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
82a2ec13
Commit
82a2ec13
authored
Feb 08, 2011
by
Janne Hakonen
Committed by
Alexandre Julliard
Feb 15, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iphlpapi: Changed return value of NotifyAddrChange() stub and added test cases.
parent
9a1fb638
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
86 additions
and
4 deletions
+86
-4
iphlpapi_main.c
dlls/iphlpapi/iphlpapi_main.c
+2
-1
iphlpapi.c
dlls/iphlpapi/tests/iphlpapi.c
+84
-3
No files found.
dlls/iphlpapi/iphlpapi_main.c
View file @
82a2ec13
...
@@ -2032,7 +2032,8 @@ DWORD WINAPI IpRenewAddress(PIP_ADAPTER_INDEX_MAP AdapterInfo)
...
@@ -2032,7 +2032,8 @@ DWORD WINAPI IpRenewAddress(PIP_ADAPTER_INDEX_MAP AdapterInfo)
DWORD
WINAPI
NotifyAddrChange
(
PHANDLE
Handle
,
LPOVERLAPPED
overlapped
)
DWORD
WINAPI
NotifyAddrChange
(
PHANDLE
Handle
,
LPOVERLAPPED
overlapped
)
{
{
FIXME
(
"(Handle %p, overlapped %p): stub
\n
"
,
Handle
,
overlapped
);
FIXME
(
"(Handle %p, overlapped %p): stub
\n
"
,
Handle
,
overlapped
);
return
ERROR_NOT_SUPPORTED
;
if
(
Handle
)
*
Handle
=
INVALID_HANDLE_VALUE
;
return
ERROR_IO_PENDING
;
}
}
...
...
dlls/iphlpapi/tests/iphlpapi.c
View file @
82a2ec13
...
@@ -64,6 +64,8 @@ typedef DWORD (WINAPI *GetTcpTableFunc)(PMIB_TCPTABLE,PDWORD,BOOL);
...
@@ -64,6 +64,8 @@ typedef DWORD (WINAPI *GetTcpTableFunc)(PMIB_TCPTABLE,PDWORD,BOOL);
typedef
DWORD
(
WINAPI
*
GetUdpTableFunc
)(
PMIB_UDPTABLE
,
PDWORD
,
BOOL
);
typedef
DWORD
(
WINAPI
*
GetUdpTableFunc
)(
PMIB_UDPTABLE
,
PDWORD
,
BOOL
);
typedef
DWORD
(
WINAPI
*
GetPerAdapterInfoFunc
)(
ULONG
,
PIP_PER_ADAPTER_INFO
,
PULONG
);
typedef
DWORD
(
WINAPI
*
GetPerAdapterInfoFunc
)(
ULONG
,
PIP_PER_ADAPTER_INFO
,
PULONG
);
typedef
DWORD
(
WINAPI
*
GetAdaptersAddressesFunc
)(
ULONG
,
ULONG
,
PVOID
,
PIP_ADAPTER_ADDRESSES
,
PULONG
);
typedef
DWORD
(
WINAPI
*
GetAdaptersAddressesFunc
)(
ULONG
,
ULONG
,
PVOID
,
PIP_ADAPTER_ADDRESSES
,
PULONG
);
typedef
DWORD
(
WINAPI
*
NotifyAddrChangeFunc
)(
PHANDLE
,
LPOVERLAPPED
);
typedef
BOOL
(
WINAPI
*
CancelIPChangeNotifyFunc
)(
LPOVERLAPPED
);
static
GetNumberOfInterfacesFunc
gGetNumberOfInterfaces
=
NULL
;
static
GetNumberOfInterfacesFunc
gGetNumberOfInterfaces
=
NULL
;
static
GetIpAddrTableFunc
gGetIpAddrTable
=
NULL
;
static
GetIpAddrTableFunc
gGetIpAddrTable
=
NULL
;
...
@@ -83,6 +85,8 @@ static GetTcpTableFunc gGetTcpTable = NULL;
...
@@ -83,6 +85,8 @@ static GetTcpTableFunc gGetTcpTable = NULL;
static
GetUdpTableFunc
gGetUdpTable
=
NULL
;
static
GetUdpTableFunc
gGetUdpTable
=
NULL
;
static
GetPerAdapterInfoFunc
gGetPerAdapterInfo
=
NULL
;
static
GetPerAdapterInfoFunc
gGetPerAdapterInfo
=
NULL
;
static
GetAdaptersAddressesFunc
gGetAdaptersAddresses
=
NULL
;
static
GetAdaptersAddressesFunc
gGetAdaptersAddresses
=
NULL
;
static
NotifyAddrChangeFunc
gNotifyAddrChange
=
NULL
;
static
CancelIPChangeNotifyFunc
gCancelIPChangeNotify
=
NULL
;
static
void
loadIPHlpApi
(
void
)
static
void
loadIPHlpApi
(
void
)
{
{
...
@@ -122,6 +126,10 @@ static void loadIPHlpApi(void)
...
@@ -122,6 +126,10 @@ static void loadIPHlpApi(void)
hLibrary
,
"GetUdpTable"
);
hLibrary
,
"GetUdpTable"
);
gGetPerAdapterInfo
=
(
GetPerAdapterInfoFunc
)
GetProcAddress
(
hLibrary
,
"GetPerAdapterInfo"
);
gGetPerAdapterInfo
=
(
GetPerAdapterInfoFunc
)
GetProcAddress
(
hLibrary
,
"GetPerAdapterInfo"
);
gGetAdaptersAddresses
=
(
GetAdaptersAddressesFunc
)
GetProcAddress
(
hLibrary
,
"GetAdaptersAddresses"
);
gGetAdaptersAddresses
=
(
GetAdaptersAddressesFunc
)
GetProcAddress
(
hLibrary
,
"GetAdaptersAddresses"
);
gNotifyAddrChange
=
(
NotifyAddrChangeFunc
)
GetProcAddress
(
hLibrary
,
"NotifyAddrChange"
);
gCancelIPChangeNotify
=
(
CancelIPChangeNotifyFunc
)
GetProcAddress
(
hLibrary
,
"CancelIPChangeNotify"
);
}
}
}
}
...
@@ -144,6 +152,8 @@ static void freeIPHlpApi(void)
...
@@ -144,6 +152,8 @@ static void freeIPHlpApi(void)
gGetUdpStatistics
=
NULL
;
gGetUdpStatistics
=
NULL
;
gGetTcpTable
=
NULL
;
gGetTcpTable
=
NULL
;
gGetUdpTable
=
NULL
;
gGetUdpTable
=
NULL
;
gNotifyAddrChange
=
NULL
;
gCancelIPChangeNotify
=
NULL
;
FreeLibrary
(
hLibrary
);
FreeLibrary
(
hLibrary
);
hLibrary
=
NULL
;
hLibrary
=
NULL
;
}
}
...
@@ -796,24 +806,95 @@ static void testGetPerAdapterInfo(void)
...
@@ -796,24 +806,95 @@ static void testGetPerAdapterInfo(void)
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
}
}
static
void
testNotifyAddrChange
(
void
)
{
DWORD
ret
,
bytes
;
OVERLAPPED
overlapped
;
HANDLE
handle
;
BOOL
success
;
if
(
!
gNotifyAddrChange
)
{
win_skip
(
"NotifyAddrChange not present
\n
"
);
return
;
}
if
(
!
gCancelIPChangeNotify
)
{
win_skip
(
"CancelIPChangeNotify not present
\n
"
);
return
;
}
handle
=
NULL
;
ZeroMemory
(
&
overlapped
,
sizeof
(
overlapped
));
ret
=
gNotifyAddrChange
(
&
handle
,
&
overlapped
);
if
(
ret
==
ERROR_NOT_SUPPORTED
)
{
win_skip
(
"NotifyAddrChange is not supported
\n
"
);
return
;
}
ok
(
ret
==
ERROR_IO_PENDING
,
"NotifyAddrChange returned %d, expected ERROR_IO_PENDING
\n
"
,
ret
);
ret
=
GetLastError
();
todo_wine
ok
(
ret
==
ERROR_IO_PENDING
,
"GetLastError returned %d, excepted ERROR_IO_PENDING
\n
"
,
ret
);
success
=
gCancelIPChangeNotify
(
&
overlapped
);
todo_wine
ok
(
success
==
TRUE
,
"CancelIPChangeNotify returned FALSE, expected TRUE
\n
"
);
ZeroMemory
(
&
overlapped
,
sizeof
(
overlapped
));
success
=
gCancelIPChangeNotify
(
&
overlapped
);
ok
(
success
==
FALSE
,
"CancelIPChangeNotify returned TRUE, expected FALSE
\n
"
);
handle
=
NULL
;
ZeroMemory
(
&
overlapped
,
sizeof
(
overlapped
));
overlapped
.
hEvent
=
CreateEvent
(
NULL
,
FALSE
,
FALSE
,
NULL
);
ret
=
gNotifyAddrChange
(
&
handle
,
&
overlapped
);
ok
(
ret
==
ERROR_IO_PENDING
,
"NotifyAddrChange returned %d, expected ERROR_IO_PENDING
\n
"
,
ret
);
todo_wine
ok
(
handle
!=
INVALID_HANDLE_VALUE
,
"NotifyAddrChange returned invalid file handle
\n
"
);
success
=
GetOverlappedResult
(
handle
,
&
overlapped
,
&
bytes
,
FALSE
);
todo_wine
ok
(
success
==
FALSE
,
"GetOverlappedResult returned TRUE, excepted FALSE
\n
"
);
ret
=
GetLastError
();
todo_wine
ok
(
ret
==
ERROR_IO_INCOMPLETE
,
"GetLastError returned %d, excepted ERROR_IO_INCOMPLETE
\n
"
,
ret
);
success
=
gCancelIPChangeNotify
(
&
overlapped
);
todo_wine
ok
(
success
==
TRUE
,
"CancelIPChangeNotify returned FALSE, expected TRUE
\n
"
);
if
(
winetest_interactive
)
{
handle
=
NULL
;
ZeroMemory
(
&
overlapped
,
sizeof
(
overlapped
));
overlapped
.
hEvent
=
CreateEvent
(
NULL
,
FALSE
,
FALSE
,
NULL
);
trace
(
"Testing asyncronous ipv4 address change notification. Please "
"change ipv4 address of one of your network interfaces
\n
"
);
ret
=
gNotifyAddrChange
(
&
handle
,
&
overlapped
);
ok
(
ret
==
ERROR_IO_PENDING
,
"NotifyAddrChange returned %d, expected NO_ERROR
\n
"
,
ret
);
success
=
GetOverlappedResult
(
handle
,
&
overlapped
,
&
bytes
,
TRUE
);
ok
(
success
==
TRUE
,
"GetOverlappedResult returned FALSE, excepted TRUE
\n
"
);
}
/* test syncronous functionality */
if
(
winetest_interactive
)
{
trace
(
"Testing syncronous ipv4 address change notification. Please "
"change ipv4 address of one of your network interfaces
\n
"
);
ret
=
gNotifyAddrChange
(
NULL
,
NULL
);
todo_wine
ok
(
ret
==
NO_ERROR
,
"NotifyAddrChange returned %d, expected NO_ERROR
\n
"
,
ret
);
}
}
/*
/*
still-to-be-tested 2K-onward functions:
still-to-be-tested 2K-onward functions:
AddIPAddress
AddIPAddress
CancelIPChangeNotify
CreateProxyArpEntry
CreateProxyArpEntry
DeleteIPAddress
DeleteIPAddress
DeleteProxyArpEntry
DeleteProxyArpEntry
EnableRouter
EnableRouter
FlushIpNetTable
FlushIpNetTable
GetAdapterIndex
GetAdapterIndex
NotifyAddrChange
NotifyRouteChange + CancelIPChangeNotify
NotifyRouteChange
SendARP
SendARP
UnenableRouter
UnenableRouter
*/
*/
static
void
testWin2KFunctions
(
void
)
static
void
testWin2KFunctions
(
void
)
{
{
testGetPerAdapterInfo
();
testGetPerAdapterInfo
();
testNotifyAddrChange
();
}
}
static
void
test_GetAdaptersAddresses
(
void
)
static
void
test_GetAdaptersAddresses
(
void
)
...
...
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