[PATCH] [Kernel32]: in CreateFile, when trying to open the CON special DOS file, force OPEN_EXISTING as creation flag, as MS does

Eric Pouech eric.pouech at orange.fr
Sat Apr 23 07:28:27 CDT 2011


fix for #24876

A+
---

 dlls/kernel32/file.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


diff --git a/dlls/kernel32/file.c b/dlls/kernel32/file.c
index 6ee243e..537ea0a 100644
--- a/dlls/kernel32/file.c
+++ b/dlls/kernel32/file.c
@@ -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 );




More information about the wine-patches mailing list