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
39208d4d
Commit
39208d4d
authored
Mar 31, 2010
by
Andrew Nguyen
Committed by
Alexandre Julliard
Apr 01, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Don't set last error on success in OpenConsoleW.
parent
b7bf2abd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
console.c
dlls/kernel32/console.c
+0
-1
console.c
dlls/kernel32/tests/console.c
+19
-0
No files found.
dlls/kernel32/console.c
View file @
39208d4d
...
...
@@ -307,7 +307,6 @@ HANDLE WINAPI OpenConsoleW(LPCWSTR name, DWORD access, BOOL inherit, DWORD creat
req
->
access
=
access
;
req
->
attributes
=
inherit
?
OBJ_INHERIT
:
0
;
req
->
share
=
FILE_SHARE_READ
|
FILE_SHARE_WRITE
;
SetLastError
(
0
);
wine_server_call_err
(
req
);
ret
=
wine_server_ptr_handle
(
reply
->
handle
);
}
...
...
dlls/kernel32/tests/console.c
View file @
39208d4d
...
...
@@ -1062,6 +1062,25 @@ static void test_OpenConsoleW(void)
"Expected GetLastError() to return %u for index %d, got %u
\n
"
,
invalid_table
[
index
].
gle
,
index
,
GetLastError
());
}
/* OpenConsoleW should not touch the last error on success. */
SetLastError
(
0xdeadbeef
);
ret
=
pOpenConsoleW
(
coninW
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
OPEN_EXISTING
);
ok
(
ret
!=
INVALID_HANDLE_VALUE
,
"Expected OpenConsoleW to return a valid handle
\n
"
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected the last error to be untouched, got %u
\n
"
,
GetLastError
());
if
(
ret
!=
INVALID_HANDLE_VALUE
)
CloseHandle
(
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
pOpenConsoleW
(
conoutW
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
OPEN_EXISTING
);
ok
(
ret
!=
INVALID_HANDLE_VALUE
,
"Expected OpenConsoleW to return a valid handle
\n
"
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected the last error to be untouched, got %u
\n
"
,
GetLastError
());
if
(
ret
!=
INVALID_HANDLE_VALUE
)
CloseHandle
(
ret
);
}
START_TEST
(
console
)
...
...
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