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
bc68b30d
Commit
bc68b30d
authored
Mar 15, 2015
by
Erich E. Hoover
Committed by
Alexandre Julliard
Apr 24, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
krnl386: Invalid console handles should translate into real handles when creating a new process.
parent
3d9693fa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
10 deletions
+15
-10
file.c
dlls/krnl386.exe16/file.c
+15
-10
No files found.
dlls/krnl386.exe16/file.c
View file @
bc68b30d
...
...
@@ -53,21 +53,26 @@ static HANDLE dos_handles[DOS_TABLE_SIZE];
*/
static
void
FILE_InitProcessDosHandles
(
void
)
{
HANDLE
hStdInput
,
hStdOutput
,
hStdError
,
hNull
;
static
BOOL
init_done
/* = FALSE */
;
HANDLE
cp
=
GetCurrentProcess
();
if
(
init_done
)
return
;
init_done
=
TRUE
;
DuplicateHandle
(
cp
,
GetStdHandle
(
STD_INPUT_HANDLE
),
cp
,
&
dos_handles
[
0
],
0
,
TRUE
,
DUPLICATE_SAME_ACCESS
);
DuplicateHandle
(
cp
,
GetStdHandle
(
STD_OUTPUT_HANDLE
),
cp
,
&
dos_handles
[
1
],
0
,
TRUE
,
DUPLICATE_SAME_ACCESS
);
DuplicateHandle
(
cp
,
GetStdHandle
(
STD_ERROR_HANDLE
),
cp
,
&
dos_handles
[
2
],
0
,
TRUE
,
DUPLICATE_SAME_ACCESS
);
DuplicateHandle
(
cp
,
GetStdHandle
(
STD_ERROR_HANDLE
),
cp
,
&
dos_handles
[
3
],
0
,
TRUE
,
DUPLICATE_SAME_ACCESS
);
DuplicateHandle
(
cp
,
GetStdHandle
(
STD_ERROR_HANDLE
),
cp
,
&
dos_handles
[
4
],
0
,
TRUE
,
DUPLICATE_SAME_ACCESS
);
hStdInput
=
GetStdHandle
(
STD_INPUT_HANDLE
);
hStdOutput
=
GetStdHandle
(
STD_OUTPUT_HANDLE
);
hStdError
=
GetStdHandle
(
STD_ERROR_HANDLE
);
hNull
=
CreateFileA
(
"NUL"
,
GENERIC_READ
|
GENERIC_WRITE
,
0
,
NULL
,
OPEN_EXISTING
,
0
,
0
);
/* Invalid console handles need to translate to real DOS handles in a new process */
if
(
!
hStdInput
)
hStdInput
=
hNull
;
if
(
!
hStdOutput
)
hStdOutput
=
hNull
;
if
(
!
hStdError
)
hStdError
=
hNull
;
DuplicateHandle
(
cp
,
hStdInput
,
cp
,
&
dos_handles
[
0
],
0
,
TRUE
,
DUPLICATE_SAME_ACCESS
);
DuplicateHandle
(
cp
,
hStdOutput
,
cp
,
&
dos_handles
[
1
],
0
,
TRUE
,
DUPLICATE_SAME_ACCESS
);
DuplicateHandle
(
cp
,
hStdError
,
cp
,
&
dos_handles
[
2
],
0
,
TRUE
,
DUPLICATE_SAME_ACCESS
);
DuplicateHandle
(
cp
,
hStdError
,
cp
,
&
dos_handles
[
3
],
0
,
TRUE
,
DUPLICATE_SAME_ACCESS
);
DuplicateHandle
(
cp
,
hStdError
,
cp
,
&
dos_handles
[
4
],
0
,
TRUE
,
DUPLICATE_SAME_ACCESS
);
CloseHandle
(
hNull
);
}
/***********************************************************************
...
...
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