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
297b054e
Commit
297b054e
authored
Sep 22, 2010
by
Peter Oberndorfer
Committed by
Alexandre Julliard
Sep 23, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: VerifyConsoleIoHandle does not set last error value.
parent
f30b7089
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
3 deletions
+56
-3
console.c
dlls/kernel32/console.c
+1
-1
console.c
dlls/kernel32/tests/console.c
+53
-0
sync.c
dlls/kernel32/tests/sync.c
+2
-2
No files found.
dlls/kernel32/console.c
View file @
297b054e
...
...
@@ -441,7 +441,7 @@ BOOL WINAPI VerifyConsoleIoHandle(HANDLE handle)
SERVER_START_REQ
(
get_console_mode
)
{
req
->
handle
=
console_handle_unmap
(
handle
);
ret
=
!
wine_server_call
_err
(
req
);
ret
=
!
wine_server_call
(
req
);
}
SERVER_END_REQ
;
return
ret
;
...
...
dlls/kernel32/tests/console.c
View file @
297b054e
...
...
@@ -27,6 +27,7 @@ static BOOL (WINAPI *pGetConsoleInputExeNameA)(DWORD, LPSTR);
static
DWORD
(
WINAPI
*
pGetConsoleProcessList
)(
LPDWORD
,
DWORD
);
static
HANDLE
(
WINAPI
*
pOpenConsoleW
)(
LPCWSTR
,
DWORD
,
BOOL
,
DWORD
);
static
BOOL
(
WINAPI
*
pSetConsoleInputExeNameA
)(
LPCSTR
);
static
BOOL
(
WINAPI
*
pVerifyConsoleIoHandle
)(
HANDLE
handle
);
/* DEFAULT_ATTRIB is used for all initial filling of the console.
* all modifications are made with TEST_ATTRIB so that we could check
...
...
@@ -68,6 +69,7 @@ static void init_function_pointers(void)
KERNEL32_GET_PROC
(
GetConsoleProcessList
);
KERNEL32_GET_PROC
(
OpenConsoleW
);
KERNEL32_GET_PROC
(
SetConsoleInputExeNameA
);
KERNEL32_GET_PROC
(
VerifyConsoleIoHandle
);
#undef KERNEL32_GET_PROC
}
...
...
@@ -1083,6 +1085,56 @@ static void test_OpenConsoleW(void)
CloseHandle
(
ret
);
}
static
void
test_VerifyConsoleIoHandle
(
void
)
{
BOOL
ret
;
DWORD
error
;
HANDLE
handle
;
if
(
!
pVerifyConsoleIoHandle
)
{
win_skip
(
"VerifyConsoleIoHandle is not available
\n
"
);
return
;
}
/* invalid handle */
SetLastError
(
0xdeadbeef
);
ret
=
pVerifyConsoleIoHandle
((
HANDLE
)
0xdeadbee0
);
error
=
GetLastError
();
ok
(
!
ret
,
"expected VerifyConsoleIoHandle to fail
\n
"
);
ok
(
error
==
0xdeadbeef
,
"wrong GetLastError() %d
\n
"
,
error
);
/* invalid handle + 1 */
SetLastError
(
0xdeadbeef
);
ret
=
pVerifyConsoleIoHandle
((
HANDLE
)
0xdeadbee1
);
error
=
GetLastError
();
ok
(
!
ret
,
"expected VerifyConsoleIoHandle to fail
\n
"
);
ok
(
error
==
0xdeadbeef
,
"wrong GetLastError() %d
\n
"
,
error
);
/* invalid handle + 2 */
SetLastError
(
0xdeadbeef
);
ret
=
pVerifyConsoleIoHandle
((
HANDLE
)
0xdeadbee2
);
error
=
GetLastError
();
ok
(
!
ret
,
"expected VerifyConsoleIoHandle to fail
\n
"
);
ok
(
error
==
0xdeadbeef
,
"wrong GetLastError() %d
\n
"
,
error
);
/* invalid handle + 3 */
SetLastError
(
0xdeadbeef
);
ret
=
pVerifyConsoleIoHandle
((
HANDLE
)
0xdeadbee3
);
error
=
GetLastError
();
ok
(
!
ret
,
"expected VerifyConsoleIoHandle to fail
\n
"
);
ok
(
error
==
0xdeadbeef
,
"wrong GetLastError() %d
\n
"
,
error
);
handle
=
GetStdHandle
(
STD_INPUT_HANDLE
);
/* valid handle */
SetLastError
(
0xdeadbeef
);
ret
=
pVerifyConsoleIoHandle
(
handle
);
error
=
GetLastError
();
ok
(
ret
,
"expected VerifyConsoleIoHandle to succeed
\n
"
);
ok
(
error
==
0xdeadbeef
,
"wrong GetLastError() %d
\n
"
,
error
);
}
START_TEST
(
console
)
{
HANDLE
hConIn
,
hConOut
;
...
...
@@ -1134,4 +1186,5 @@ START_TEST(console)
test_GetConsoleProcessList
();
test_OpenConsoleW
();
test_VerifyConsoleIoHandle
();
}
dlls/kernel32/tests/sync.c
View file @
297b054e
...
...
@@ -1000,7 +1000,7 @@ static void test_WaitForSingleObject(void)
SetLastError
(
0xdeadbeef
);
ret
=
WaitForSingleObject
(
modify_handle
(
nonsignaled
,
3
),
0
);
ok
(
ret
==
WAIT_TIMEOUT
,
"expected WAIT_TIMEOUT, got %d
\n
"
,
ret
);
todo_wine
ok
(
GetLastError
()
==
0xdeadbeef
,
"expected 0xdeadbeef, got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
0xdeadbeef
,
"expected 0xdeadbeef, got %d
\n
"
,
GetLastError
());
/* valid handle with different values for lower 2 bits */
SetLastError
(
0xdeadbeef
);
...
...
@@ -1021,7 +1021,7 @@ static void test_WaitForSingleObject(void)
SetLastError
(
0xdeadbeef
);
ret
=
WaitForSingleObject
(
modify_handle
(
signaled
,
3
),
0
);
ok
(
ret
==
WAIT_OBJECT_0
,
"expected WAIT_OBJECT_0, got %d
\n
"
,
ret
);
todo_wine
ok
(
GetLastError
()
==
0xdeadbeef
,
"expected 0xdeadbeef, got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
0xdeadbeef
,
"expected 0xdeadbeef, got %d
\n
"
,
GetLastError
());
CloseHandle
(
signaled
);
CloseHandle
(
nonsignaled
);
...
...
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