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
8a529d60
Commit
8a529d60
authored
May 10, 2011
by
Eric Pouech
Committed by
Alexandre Julliard
May 11, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: In CreateFile, when trying to open the CON special DOS file, force…
kernel32: In CreateFile, when trying to open the CON special DOS file, force OPEN_EXISTING as creation flag.
parent
fa8d5d16
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
20 deletions
+2
-20
file.c
dlls/kernel32/file.c
+2
-2
console.c
dlls/kernel32/tests/console.c
+0
-18
No files found.
dlls/kernel32/file.c
View file @
8a529d60
...
...
@@ -1322,10 +1322,10 @@ HANDLE WINAPI CreateFileW( LPCWSTR filename, DWORD access, DWORD sharing,
switch
(
access
&
(
GENERIC_READ
|
GENERIC_WRITE
))
{
case
GENERIC_READ
:
ret
=
OpenConsoleW
(
coninW
,
access
,
(
sa
&&
sa
->
bInheritHandle
),
creation
);
ret
=
OpenConsoleW
(
coninW
,
access
,
(
sa
&&
sa
->
bInheritHandle
),
OPEN_EXISTING
);
goto
done
;
case
GENERIC_WRITE
:
ret
=
OpenConsoleW
(
conoutW
,
access
,
(
sa
&&
sa
->
bInheritHandle
),
creation
);
ret
=
OpenConsoleW
(
conoutW
,
access
,
(
sa
&&
sa
->
bInheritHandle
),
OPEN_EXISTING
);
goto
done
;
default:
SetLastError
(
ERROR_FILE_NOT_FOUND
);
...
...
dlls/kernel32/tests/console.c
View file @
8a529d60
...
...
@@ -1002,7 +1002,6 @@ static void test_OpenCON(void)
for
(
i
=
0
;
i
<
sizeof
(
accesses
)
/
sizeof
(
accesses
[
0
]);
i
++
)
{
if
(
accesses
[
i
]
!=
OPEN_EXISTING
)
todo_wine
{
h
=
CreateFileW
(
conW
,
GENERIC_WRITE
,
0
,
NULL
,
accesses
[
i
],
0
,
NULL
);
ok
(
h
!=
INVALID_HANDLE_VALUE
,
"Expected to open the CON device on write (%x)
\n
"
,
accesses
[
i
]);
CloseHandle
(
h
);
...
...
@@ -1018,23 +1017,6 @@ static void test_OpenCON(void)
ok
(
h
!=
INVALID_HANDLE_VALUE
,
"Expected to open the CON device on read (%x)
\n
"
,
accesses
[
i
]);
}
CloseHandle
(
h
);
}
else
{
h
=
CreateFileW
(
conW
,
GENERIC_WRITE
,
0
,
NULL
,
accesses
[
i
],
0
,
NULL
);
ok
(
h
!=
INVALID_HANDLE_VALUE
,
"Expected to open the CON device on write (%x)
\n
"
,
accesses
[
i
]);
CloseHandle
(
h
);
h
=
CreateFileW
(
conW
,
GENERIC_READ
,
0
,
NULL
,
accesses
[
i
],
0
,
NULL
);
/* Windows versions differ here:
* MSDN states in CreateFile that TRUNCATE_EXISTING requires GENERIC_WRITE
* NT, XP, Vista comply, but Win7 doesn't and allows to open CON with TRUNCATE_EXISTING
* So don't test when disposition is TRUNCATE_EXISTING
*/
if
(
accesses
[
i
]
!=
TRUNCATE_EXISTING
)
{
ok
(
h
!=
INVALID_HANDLE_VALUE
,
"Expected to open the CON device on read (%x)
\n
"
,
accesses
[
i
]);
}
CloseHandle
(
h
);
}
h
=
CreateFileW
(
conW
,
GENERIC_READ
|
GENERIC_WRITE
,
0
,
NULL
,
accesses
[
i
],
0
,
NULL
);
ok
(
h
==
INVALID_HANDLE_VALUE
,
"Expected not to open the CON device on read-write (%x)
\n
"
,
accesses
[
i
]);
ok
(
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
"Unexpected error %x
\n
"
,
GetLastError
());
...
...
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