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
64c68195
Commit
64c68195
authored
Jul 25, 2023
by
Paul Gofman
Committed by
Alexandre Julliard
Jul 31, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nsi/tests: Add test for change notifications.
parent
e06093cb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
0 deletions
+64
-0
nsi.c
dlls/nsi/tests/nsi.c
+64
-0
No files found.
dlls/nsi/tests/nsi.c
View file @
64c68195
...
...
@@ -18,6 +18,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "winsock2.h"
#include "winternl.h"
#include "ws2ipdef.h"
...
...
@@ -1023,6 +1025,66 @@ static void test_udp_tables( int family )
winetest_pop_context
();
}
void
test_change_notifications
(
void
)
{
struct
nsi_request_change_notification_ex
params
;
HANDLE
handle
,
handle2
;
OVERLAPPED
ovr
,
ovr2
;
DWORD
bytes
;
DWORD
ret
;
BOOL
bret
;
memset
(
&
ovr
,
0
,
sizeof
(
ovr
)
);
ovr
.
hEvent
=
CreateEventW
(
NULL
,
FALSE
,
FALSE
,
NULL
);
handle
=
(
HANDLE
)
0xdeadbeef
;
ret
=
NsiRequestChangeNotification
(
0
,
&
NPI_MS_NDIS_MODULEID
,
NSI_NDIS_IFINFO_TABLE
,
&
ovr
,
&
handle
);
todo_wine
ok
(
ret
==
ERROR_IO_PENDING
,
"got %lu.
\n
"
,
ret
);
memset
(
&
params
,
0
,
sizeof
(
params
)
);
handle2
=
(
HANDLE
)
0xdeadbeef
;
memset
(
&
ovr2
,
0
,
sizeof
(
ovr2
)
);
params
.
module
=
&
NPI_MS_NDIS_MODULEID
;
params
.
table
=
NSI_NDIS_IFINFO_TABLE
;
params
.
ovr
=
&
ovr2
;
params
.
handle
=
&
handle2
;
ret
=
NsiRequestChangeNotificationEx
(
&
params
);
todo_wine
ok
(
ret
==
ERROR_IO_PENDING
,
"got %lu.
\n
"
,
ret
);
ok
(
handle2
==
handle
,
"got %p, %p.
\n
"
,
handle
,
handle2
);
bret
=
GetOverlappedResult
(
handle
,
&
ovr
,
&
bytes
,
FALSE
);
todo_wine
ok
(
!
bret
&&
GetLastError
()
==
ERROR_IO_INCOMPLETE
,
"got bret %d, err %lu.
\n
"
,
bret
,
GetLastError
()
);
ret
=
NsiCancelChangeNotification
(
NULL
);
todo_wine
ok
(
ret
==
ERROR_NOT_FOUND
,
"got %lu.
\n
"
,
ret
);
ret
=
NsiCancelChangeNotification
(
&
ovr
);
todo_wine
ok
(
!
ret
,
"got %lu.
\n
"
,
ret
);
bytes
=
0xdeadbeef
;
bret
=
GetOverlappedResult
(
handle
,
&
ovr
,
&
bytes
,
FALSE
);
todo_wine
ok
(
!
bret
&&
GetLastError
()
==
ERROR_OPERATION_ABORTED
,
"got bret %d, err %lu.
\n
"
,
bret
,
GetLastError
()
);
todo_wine
ok
(
ovr
.
Internal
==
(
ULONG
)
STATUS_CANCELLED
,
"got %Ix.
\n
"
,
ovr
.
Internal
);
ok
(
!
bytes
,
"got %lu.
\n
"
,
bytes
);
bret
=
GetOverlappedResult
(
handle2
,
&
ovr2
,
&
bytes
,
FALSE
);
todo_wine
ok
(
!
bret
&&
GetLastError
()
==
ERROR_IO_INCOMPLETE
,
"got bret %d, err %lu.
\n
"
,
bret
,
GetLastError
()
);
ret
=
NsiCancelChangeNotification
(
&
ovr2
);
todo_wine
ok
(
!
ret
,
"got %lu.
\n
"
,
ret
);
bret
=
GetOverlappedResult
(
handle
,
&
ovr
,
&
bytes
,
FALSE
);
todo_wine
ok
(
!
bret
&&
GetLastError
()
==
ERROR_OPERATION_ABORTED
,
"got bret %d, err %lu.
\n
"
,
bret
,
GetLastError
()
);
ret
=
NsiRequestChangeNotification
(
0
,
&
NPI_MS_NDIS_MODULEID
,
NSI_NDIS_INDEX_LUID_TABLE
,
&
ovr
,
&
handle
);
todo_wine
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"got %lu.
\n
"
,
ret
);
ret
=
NsiRequestChangeNotification
(
0
,
&
NPI_MS_IPV4_MODULEID
,
NSI_IP_FORWARD_TABLE
,
&
ovr
,
&
handle
);
todo_wine
ok
(
ret
==
ERROR_IO_PENDING
,
"got %lu.
\n
"
,
ret
);
ret
=
NsiCancelChangeNotification
(
&
ovr
);
todo_wine
ok
(
!
ret
,
"got %lu.
\n
"
,
ret
);
bret
=
GetOverlappedResult
(
handle
,
&
ovr
,
&
bytes
,
FALSE
);
todo_wine
ok
(
!
bret
&&
GetLastError
()
==
ERROR_OPERATION_ABORTED
,
"got bret %d, err %lu.
\n
"
,
bret
,
GetLastError
()
);
}
START_TEST
(
nsi
)
{
test_nsi_api
();
...
...
@@ -1056,4 +1118,6 @@ START_TEST( nsi )
test_udp_stats
(
AF_INET6
);
test_udp_tables
(
AF_INET
);
test_udp_tables
(
AF_INET6
);
test_change_notifications
();
}
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