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
f565e4a3
Commit
f565e4a3
authored
Mar 01, 2013
by
Piotr Caban
Committed by
Alexandre Julliard
Mar 04, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Don't duplicate standard handles during initialization.
parent
ac9ca974
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
41 deletions
+9
-41
file.c
dlls/msvcrt/file.c
+9
-41
No files found.
dlls/msvcrt/file.c
View file @
f565e4a3
...
...
@@ -486,53 +486,21 @@ void msvcrt_init_io(void)
if
(
msvcrt_get_ioinfo
(
MSVCRT_fdstart
)
->
handle
==
INVALID_HANDLE_VALUE
)
break
;
}
if
(
!
MSVCRT___pioinfo
[
0
])
msvcrt_alloc_fd_from
(
INVALID_HANDLE_VALUE
,
0
,
3
);
fdinfo
=
msvcrt_get_ioinfo
(
0
);
fdinfo
=
msvcrt_get_ioinfo
(
MSVCRT_STDIN_FILENO
);
if
(
!
(
fdinfo
->
wxflag
&
WX_OPEN
)
||
fdinfo
->
handle
==
INVALID_HANDLE_VALUE
)
{
HANDLE
std
=
GetStdHandle
(
STD_INPUT_HANDLE
);
if
(
std
!=
INVALID_HANDLE_VALUE
&&
DuplicateHandle
(
GetCurrentProcess
(),
std
,
GetCurrentProcess
(),
&
fdinfo
->
handle
,
0
,
TRUE
,
DUPLICATE_SAME_ACCESS
))
fdinfo
->
wxflag
=
WX_OPEN
|
WX_TEXT
;
fdinfo
->
lookahead
[
0
]
=
'\n'
;
fdinfo
->
lookahead
[
1
]
=
'\n'
;
fdinfo
->
lookahead
[
2
]
=
'\n'
;
fdinfo
->
exflag
=
0
;
}
msvcrt_alloc_fd_from
(
GetStdHandle
(
STD_INPUT_HANDLE
),
WX_OPEN
|
WX_TEXT
,
MSVCRT_STDIN_FILENO
);
fdinfo
=
msvcrt_get_ioinfo
(
1
);
fdinfo
=
msvcrt_get_ioinfo
(
MSVCRT_STDOUT_FILENO
);
if
(
!
(
fdinfo
->
wxflag
&
WX_OPEN
)
||
fdinfo
->
handle
==
INVALID_HANDLE_VALUE
)
{
HANDLE
std
=
GetStdHandle
(
STD_OUTPUT_HANDLE
);
if
(
std
!=
INVALID_HANDLE_VALUE
&&
DuplicateHandle
(
GetCurrentProcess
(),
std
,
GetCurrentProcess
(),
&
fdinfo
->
handle
,
0
,
TRUE
,
DUPLICATE_SAME_ACCESS
))
fdinfo
->
wxflag
=
WX_OPEN
|
WX_TEXT
;
fdinfo
->
lookahead
[
0
]
=
'\n'
;
fdinfo
->
lookahead
[
1
]
=
'\n'
;
fdinfo
->
lookahead
[
2
]
=
'\n'
;
fdinfo
->
exflag
=
0
;
}
msvcrt_alloc_fd_from
(
GetStdHandle
(
STD_OUTPUT_HANDLE
),
WX_OPEN
|
WX_TEXT
,
MSVCRT_STDOUT_FILENO
);
fdinfo
=
msvcrt_get_ioinfo
(
2
);
fdinfo
=
msvcrt_get_ioinfo
(
MSVCRT_STDERR_FILENO
);
if
(
!
(
fdinfo
->
wxflag
&
WX_OPEN
)
||
fdinfo
->
handle
==
INVALID_HANDLE_VALUE
)
{
HANDLE
std
=
GetStdHandle
(
STD_ERROR_HANDLE
);
if
(
std
!=
INVALID_HANDLE_VALUE
&&
DuplicateHandle
(
GetCurrentProcess
(),
std
,
GetCurrentProcess
(),
&
fdinfo
->
handle
,
0
,
TRUE
,
DUPLICATE_SAME_ACCESS
))
fdinfo
->
wxflag
=
WX_OPEN
|
WX_TEXT
;
fdinfo
->
lookahead
[
0
]
=
'\n'
;
fdinfo
->
lookahead
[
1
]
=
'\n'
;
fdinfo
->
lookahead
[
2
]
=
'\n'
;
fdinfo
->
exflag
=
0
;
}
msvcrt_alloc_fd_from
(
GetStdHandle
(
STD_ERROR_HANDLE
),
WX_OPEN
|
WX_TEXT
,
MSVCRT_STDERR_FILENO
);
TRACE
(
":handles (%p)(%p)(%p)
\n
"
,
msvcrt_get_ioinfo
(
0
)
->
handle
,
msvcrt_get_ioinfo
(
1
)
->
handle
,
msvcrt_get_ioinfo
(
2
)
->
handle
);
TRACE
(
":handles (%p)(%p)(%p)
\n
"
,
msvcrt_get_ioinfo
(
MSVCRT_STDIN_FILENO
)
->
handle
,
msvcrt_get_ioinfo
(
MSVCRT_STDOUT_FILENO
)
->
handle
,
msvcrt_get_ioinfo
(
MSVCRT_STDERR_FILENO
)
->
handle
);
memset
(
MSVCRT__iob
,
0
,
3
*
sizeof
(
MSVCRT_FILE
));
for
(
i
=
0
;
i
<
3
;
i
++
)
...
...
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