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
2b205a6d
Commit
2b205a6d
authored
Nov 10, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Add more console waiting tests.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
706e35f2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
1 deletion
+71
-1
console.c
dlls/kernel32/tests/console.c
+71
-1
No files found.
dlls/kernel32/tests/console.c
View file @
2b205a6d
...
...
@@ -19,11 +19,14 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "wine/test.h"
#include <ntstatus.h>
#define WIN32_NO_STATUS
#include <windows.h>
#include <winternl.h>
#include <stdio.h>
#include "wine/test.h"
static
void
(
WINAPI
*
pClosePseudoConsole
)(
HPCON
);
static
HRESULT
(
WINAPI
*
pCreatePseudoConsole
)(
COORD
,
HANDLE
,
HANDLE
,
DWORD
,
HPCON
*
);
static
BOOL
(
WINAPI
*
pGetConsoleInputExeNameA
)(
DWORD
,
LPSTR
);
...
...
@@ -988,6 +991,72 @@ static void testWaitForConsoleInput(HANDLE input_handle)
CloseHandle
(
complete_event
);
}
static
void
test_wait
(
HANDLE
input
,
HANDLE
orig_output
)
{
LARGE_INTEGER
zero
;
INPUT_RECORD
ir
;
HANDLE
output
;
DWORD
res
,
count
;
NTSTATUS
status
;
BOOL
ret
;
if
(
skip_nt
)
return
;
memset
(
&
ir
,
0
,
sizeof
(
ir
));
ir
.
EventType
=
MOUSE_EVENT
;
ir
.
Event
.
MouseEvent
.
dwEventFlags
=
MOUSE_MOVED
;
zero
.
QuadPart
=
0
;
output
=
CreateConsoleScreenBuffer
(
GENERIC_READ
|
GENERIC_WRITE
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
NULL
,
CONSOLE_TEXTMODE_BUFFER
,
NULL
);
ok
(
output
!=
INVALID_HANDLE_VALUE
,
"CreateConsoleScreenBuffer failed: %u
\n
"
,
GetLastError
());
ret
=
SetConsoleActiveScreenBuffer
(
output
);
ok
(
ret
,
"SetConsoleActiveScreenBuffer failed: %u
\n
"
,
GetLastError
());
FlushConsoleInputBuffer
(
input
);
res
=
WaitForSingleObject
(
input
,
0
);
ok
(
res
==
WAIT_TIMEOUT
,
"WaitForSingleObject returned %x
\n
"
,
res
);
res
=
WaitForSingleObject
(
output
,
0
);
todo_wine
ok
(
res
==
WAIT_TIMEOUT
,
"WaitForSingleObject returned %x
\n
"
,
res
);
res
=
WaitForSingleObject
(
orig_output
,
0
);
ok
(
res
==
WAIT_TIMEOUT
,
"WaitForSingleObject returned %x
\n
"
,
res
);
status
=
NtWaitForSingleObject
(
input
,
FALSE
,
&
zero
);
todo_wine
ok
(
status
==
STATUS_TIMEOUT
||
broken
(
status
==
STATUS_ACCESS_DENIED
/* win2k8 */
),
"NtWaitForSingleObject returned %x
\n
"
,
status
);
status
=
NtWaitForSingleObject
(
output
,
FALSE
,
&
zero
);
todo_wine
ok
(
status
==
STATUS_TIMEOUT
||
broken
(
status
==
STATUS_ACCESS_DENIED
/* win2k8 */
),
"NtWaitForSingleObject returned %x
\n
"
,
status
);
ret
=
WriteConsoleInputW
(
input
,
&
ir
,
1
,
&
count
);
ok
(
ret
,
"WriteConsoleInputW failed: %u
\n
"
,
GetLastError
());
res
=
WaitForSingleObject
(
input
,
0
);
ok
(
!
res
,
"WaitForSingleObject returned %x
\n
"
,
res
);
res
=
WaitForSingleObject
(
output
,
0
);
todo_wine
ok
(
!
res
,
"WaitForSingleObject returned %x
\n
"
,
res
);
res
=
WaitForSingleObject
(
orig_output
,
0
);
ok
(
!
res
,
"WaitForSingleObject returned %x
\n
"
,
res
);
status
=
NtWaitForSingleObject
(
input
,
FALSE
,
&
zero
);
todo_wine
ok
(
!
status
||
broken
(
status
==
STATUS_ACCESS_DENIED
/* win2k8 */
),
"NtWaitForSingleObject returned %x
\n
"
,
status
);
status
=
NtWaitForSingleObject
(
output
,
FALSE
,
&
zero
);
todo_wine
ok
(
!
status
||
broken
(
status
==
STATUS_ACCESS_DENIED
/* win2k8 */
),
"NtWaitForSingleObject returned %x
\n
"
,
status
);
ret
=
SetConsoleActiveScreenBuffer
(
orig_output
);
ok
(
ret
,
"SetConsoleActiveScreenBuffer failed: %u
\n
"
,
GetLastError
());
CloseHandle
(
output
);
}
static
void
test_GetSetConsoleInputExeName
(
void
)
{
BOOL
ret
;
...
...
@@ -4295,6 +4364,7 @@ START_TEST(console)
if
(
!
test_current
)
testScreenBuffer
(
hConOut
);
/* Test waiting for a console handle */
testWaitForConsoleInput
(
hConIn
);
test_wait
(
hConIn
,
hConOut
);
if
(
!
test_current
)
{
...
...
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