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
826a9615
Commit
826a9615
authored
Dec 01, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 01, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernelbase: Remove no longer needed console handle mapping.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2ecb8713
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
30 deletions
+3
-30
console.c
dlls/kernelbase/console.c
+3
-3
file.c
dlls/kernelbase/file.c
+0
-6
kernelbase.h
dlls/kernelbase/kernelbase.h
+0
-11
process.c
dlls/kernelbase/process.c
+0
-10
No files found.
dlls/kernelbase/console.c
View file @
826a9615
...
@@ -244,7 +244,7 @@ static BOOL init_console_std_handles( BOOL override_all )
...
@@ -244,7 +244,7 @@ static BOOL init_console_std_handles( BOOL override_all )
FILE_NON_DIRECTORY_FILE
|
FILE_SYNCHRONOUS_IO_NONALERT
,
NULL
,
0
);
FILE_NON_DIRECTORY_FILE
|
FILE_SYNCHRONOUS_IO_NONALERT
,
NULL
,
0
);
if
(
!
set_ntstatus
(
status
))
return
FALSE
;
if
(
!
set_ntstatus
(
status
))
return
FALSE
;
console_flags
|=
CONSOLE_INPUT_HANDLE
;
console_flags
|=
CONSOLE_INPUT_HANDLE
;
SetStdHandle
(
STD_INPUT_HANDLE
,
console_handle_map
(
handle
)
);
SetStdHandle
(
STD_INPUT_HANDLE
,
handle
);
}
}
if
(
!
override_all
)
if
(
!
override_all
)
...
@@ -263,7 +263,7 @@ static BOOL init_console_std_handles( BOOL override_all )
...
@@ -263,7 +263,7 @@ static BOOL init_console_std_handles( BOOL override_all )
if
(
!
std_out
)
if
(
!
std_out
)
{
{
console_flags
|=
CONSOLE_OUTPUT_HANDLE
;
console_flags
|=
CONSOLE_OUTPUT_HANDLE
;
SetStdHandle
(
STD_OUTPUT_HANDLE
,
console_handle_map
(
handle
)
);
SetStdHandle
(
STD_OUTPUT_HANDLE
,
handle
);
}
}
if
(
!
std_err
)
if
(
!
std_err
)
...
@@ -272,7 +272,7 @@ static BOOL init_console_std_handles( BOOL override_all )
...
@@ -272,7 +272,7 @@ static BOOL init_console_std_handles( BOOL override_all )
&
handle
,
0
,
TRUE
,
DUPLICATE_SAME_ACCESS
))
&
handle
,
0
,
TRUE
,
DUPLICATE_SAME_ACCESS
))
return
FALSE
;
return
FALSE
;
console_flags
|=
CONSOLE_ERROR_HANDLE
;
console_flags
|=
CONSOLE_ERROR_HANDLE
;
SetStdHandle
(
STD_ERROR_HANDLE
,
console_handle_map
(
handle
)
);
SetStdHandle
(
STD_ERROR_HANDLE
,
handle
);
}
}
return
TRUE
;
return
TRUE
;
...
...
dlls/kernelbase/file.c
View file @
826a9615
...
@@ -854,12 +854,6 @@ HANDLE WINAPI DECLSPEC_HOTPATCH CreateFileW( LPCWSTR filename, DWORD access, DWO
...
@@ -854,12 +854,6 @@ HANDLE WINAPI DECLSPEC_HOTPATCH CreateFileW( LPCWSTR filename, DWORD access, DWO
}
}
else
else
{
{
if
(
dosdev
&&
((
LOWORD
(
dosdev
)
==
3
*
sizeof
(
WCHAR
)
&&
!
wcsnicmp
(
filename
+
HIWORD
(
dosdev
)
/
sizeof
(
WCHAR
),
L"CON"
,
3
))
||
(
LOWORD
(
dosdev
)
==
6
*
sizeof
(
WCHAR
)
&&
!
wcsnicmp
(
filename
+
HIWORD
(
dosdev
)
/
sizeof
(
WCHAR
),
L"CONIN$"
,
6
))
||
(
LOWORD
(
dosdev
)
==
7
*
sizeof
(
WCHAR
)
&&
!
wcsnicmp
(
filename
+
HIWORD
(
dosdev
)
/
sizeof
(
WCHAR
),
L"CONOUT$"
,
7
))))
ret
=
console_handle_map
(
ret
);
if
((
creation
==
CREATE_ALWAYS
&&
io
.
Information
==
FILE_OVERWRITTEN
)
||
if
((
creation
==
CREATE_ALWAYS
&&
io
.
Information
==
FILE_OVERWRITTEN
)
||
(
creation
==
OPEN_ALWAYS
&&
io
.
Information
==
FILE_OPENED
))
(
creation
==
OPEN_ALWAYS
&&
io
.
Information
==
FILE_OPENED
))
SetLastError
(
ERROR_ALREADY_EXISTS
);
SetLastError
(
ERROR_ALREADY_EXISTS
);
...
...
dlls/kernelbase/kernelbase.h
View file @
826a9615
...
@@ -43,17 +43,6 @@ extern const WCHAR system_dir[] DECLSPEC_HIDDEN;
...
@@ -43,17 +43,6 @@ extern const WCHAR system_dir[] DECLSPEC_HIDDEN;
static
const
BOOL
is_win64
=
(
sizeof
(
void
*
)
>
sizeof
(
int
));
static
const
BOOL
is_win64
=
(
sizeof
(
void
*
)
>
sizeof
(
int
));
extern
BOOL
is_wow64
DECLSPEC_HIDDEN
;
extern
BOOL
is_wow64
DECLSPEC_HIDDEN
;
static
inline
BOOL
is_console_handle
(
HANDLE
h
)
{
return
h
!=
INVALID_HANDLE_VALUE
&&
((
UINT_PTR
)
h
&
3
)
==
3
;
}
/* map between ntdll handle and kernel32 console handle */
static
inline
HANDLE
console_handle_map
(
HANDLE
h
)
{
return
h
!=
INVALID_HANDLE_VALUE
?
(
HANDLE
)((
UINT_PTR
)
h
^
3
)
:
INVALID_HANDLE_VALUE
;
}
static
inline
BOOL
set_ntstatus
(
NTSTATUS
status
)
static
inline
BOOL
set_ntstatus
(
NTSTATUS
status
)
{
{
if
(
status
)
SetLastError
(
RtlNtStatusToDosError
(
status
));
if
(
status
)
SetLastError
(
RtlNtStatusToDosError
(
status
));
...
...
dlls/kernelbase/process.c
View file @
826a9615
...
@@ -396,7 +396,6 @@ BOOL WINAPI DECLSPEC_HOTPATCH CloseHandle( HANDLE handle )
...
@@ -396,7 +396,6 @@ BOOL WINAPI DECLSPEC_HOTPATCH CloseHandle( HANDLE handle )
else
if
(
handle
==
(
HANDLE
)
STD_ERROR_HANDLE
)
else
if
(
handle
==
(
HANDLE
)
STD_ERROR_HANDLE
)
handle
=
InterlockedExchangePointer
(
&
NtCurrentTeb
()
->
Peb
->
ProcessParameters
->
hStdError
,
0
);
handle
=
InterlockedExchangePointer
(
&
NtCurrentTeb
()
->
Peb
->
ProcessParameters
->
hStdError
,
0
);
if
(
is_console_handle
(
handle
))
handle
=
console_handle_map
(
handle
);
return
set_ntstatus
(
NtClose
(
handle
));
return
set_ntstatus
(
NtClose
(
handle
));
}
}
...
@@ -658,15 +657,6 @@ BOOL WINAPI DECLSPEC_HOTPATCH DuplicateHandle( HANDLE source_process, HANDLE sou
...
@@ -658,15 +657,6 @@ BOOL WINAPI DECLSPEC_HOTPATCH DuplicateHandle( HANDLE source_process, HANDLE sou
HANDLE
dest_process
,
HANDLE
*
dest
,
HANDLE
dest_process
,
HANDLE
*
dest
,
DWORD
access
,
BOOL
inherit
,
DWORD
options
)
DWORD
access
,
BOOL
inherit
,
DWORD
options
)
{
{
if
(
is_console_handle
(
source
))
{
source
=
console_handle_map
(
source
);
if
(
!
set_ntstatus
(
NtDuplicateObject
(
source_process
,
source
,
dest_process
,
dest
,
access
,
inherit
?
OBJ_INHERIT
:
0
,
options
)))
return
FALSE
;
*
dest
=
console_handle_map
(
*
dest
);
return
TRUE
;
}
return
set_ntstatus
(
NtDuplicateObject
(
source_process
,
source
,
dest_process
,
dest
,
return
set_ntstatus
(
NtDuplicateObject
(
source_process
,
source
,
dest_process
,
dest
,
access
,
inherit
?
OBJ_INHERIT
:
0
,
options
));
access
,
inherit
?
OBJ_INHERIT
:
0
,
options
));
}
}
...
...
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