Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
5386b7e4
Commit
5386b7e4
authored
Nov 11, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 11, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Allow non-console handles in CloseConsoleHandle.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1335768f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
16 deletions
+1
-16
console.c
dlls/kernel32/console.c
+1
-6
kernel_private.h
dlls/kernel32/kernel_private.h
+0
-8
console.c
dlls/kernel32/tests/console.c
+0
-2
No files found.
dlls/kernel32/console.c
View file @
5386b7e4
...
...
@@ -125,12 +125,7 @@ HANDLE WINAPI DuplicateConsoleHandle(HANDLE handle, DWORD access, BOOL inherit,
*/
BOOL
WINAPI
CloseConsoleHandle
(
HANDLE
handle
)
{
if
(
!
is_console_handle
(
handle
))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
return
CloseHandle
(
wine_server_ptr_handle
(
console_handle_unmap
(
handle
)));
return
CloseHandle
(
handle
);
}
/******************************************************************
...
...
dlls/kernel32/kernel_private.h
View file @
5386b7e4
...
...
@@ -21,8 +21,6 @@
#ifndef __WINE_KERNEL_PRIVATE_H
#define __WINE_KERNEL_PRIVATE_H
#include "wine/server.h"
NTSTATUS
WINAPI
BaseGetNamedObjectDirectory
(
HANDLE
*
dir
);
BOOL
CONSOLE_Init
(
RTL_USER_PROCESS_PARAMETERS
*
params
)
DECLSPEC_HIDDEN
;
...
...
@@ -37,12 +35,6 @@ static inline HANDLE console_handle_map(HANDLE h)
return
h
!=
INVALID_HANDLE_VALUE
?
(
HANDLE
)((
UINT_PTR
)
h
^
3
)
:
INVALID_HANDLE_VALUE
;
}
/* map a kernel32 console handle onto a real wineserver handle */
static
inline
obj_handle_t
console_handle_unmap
(
HANDLE
h
)
{
return
wine_server_obj_handle
(
h
!=
INVALID_HANDLE_VALUE
?
(
HANDLE
)((
UINT_PTR
)
h
^
3
)
:
INVALID_HANDLE_VALUE
);
}
static
inline
BOOL
set_ntstatus
(
NTSTATUS
status
)
{
if
(
status
)
SetLastError
(
RtlNtStatusToDosError
(
status
));
...
...
dlls/kernel32/tests/console.c
View file @
5386b7e4
...
...
@@ -1523,10 +1523,8 @@ static void test_DuplicateConsoleHandle(void)
ok
(
ret
,
"SetEvent failed: %u
\n
"
,
GetLastError
());
ret
=
CloseConsoleHandle
(
handle
);
todo_wine
ok
(
ret
,
"CloseConsoleHandle failed: %u
\n
"
,
GetLastError
());
ret
=
CloseConsoleHandle
(
event
);
todo_wine
ok
(
ret
,
"CloseConsoleHandle failed: %u
\n
"
,
GetLastError
());
handle
=
DuplicateConsoleHandle
((
HANDLE
)
0xdeadbeef
,
0
,
FALSE
,
DUPLICATE_SAME_ACCESS
);
...
...
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