Alexandre Julliard : kernel32: Only try to open a VxD if opening a normal device failed.

Alexandre Julliard julliard at winehq.org
Thu Oct 30 10:10:21 CDT 2008


Module: wine
Branch: master
Commit: 7c6302b7ff5571a5119a7dea2f946e043b956156
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7c6302b7ff5571a5119a7dea2f946e043b956156

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Oct 30 10:33:45 2008 +0100

kernel32: Only try to open a VxD if opening a normal device failed.

---

 dlls/kernel32/file.c |   17 +++++------------
 1 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/dlls/kernel32/file.c b/dlls/kernel32/file.c
index adbc69d..608a539 100644
--- a/dlls/kernel32/file.c
+++ b/dlls/kernel32/file.c
@@ -1316,6 +1316,7 @@ HANDLE WINAPI CreateFileW( LPCWSTR filename, DWORD access, DWORD sharing,
     IO_STATUS_BLOCK io;
     HANDLE ret;
     DWORD dosdev;
+    const WCHAR *vxd_name = NULL;
     static const WCHAR bkslashes_with_dotW[] = {'\\','\\','.','\\',0};
     static const WCHAR coninW[] = {'C','O','N','I','N','$',0};
     static const WCHAR conoutW[] = {'C','O','N','O','U','T','$',0};
@@ -1371,19 +1372,9 @@ HANDLE WINAPI CreateFileW( LPCWSTR filename, DWORD access, DWORD sharing,
         {
             dosdev += MAKELONG( 0, 4*sizeof(WCHAR) );  /* adjust position to start of filename */
         }
-        else if (!(GetVersion() & 0x80000000))
+        else if (GetVersion() & 0x80000000)
         {
-            dosdev = 0;
-        }
-        else if (filename[4])
-        {
-            ret = VXD_Open( filename+4, access, sa );
-            goto done;
-        }
-        else
-        {
-            SetLastError( ERROR_INVALID_NAME );
-            return INVALID_HANDLE_VALUE;
+            vxd_name = filename + 4;
         }
     }
     else dosdev = RtlIsDosDeviceName_U( filename );
@@ -1465,6 +1456,8 @@ HANDLE WINAPI CreateFileW( LPCWSTR filename, DWORD access, DWORD sharing,
                            options, NULL, 0 );
     if (status)
     {
+        if (vxd_name && vxd_name[0] && (ret = VXD_Open( vxd_name, access, sa ))) goto done;
+
         WARN("Unable to create file %s (status %x)\n", debugstr_w(filename), status);
         ret = INVALID_HANDLE_VALUE;
 




More information about the wine-cvs mailing list