Commit 7c6302b7 authored by Alexandre Julliard's avatar Alexandre Julliard

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

parent 74cdb539
...@@ -1316,6 +1316,7 @@ HANDLE WINAPI CreateFileW( LPCWSTR filename, DWORD access, DWORD sharing, ...@@ -1316,6 +1316,7 @@ HANDLE WINAPI CreateFileW( LPCWSTR filename, DWORD access, DWORD sharing,
IO_STATUS_BLOCK io; IO_STATUS_BLOCK io;
HANDLE ret; HANDLE ret;
DWORD dosdev; DWORD dosdev;
const WCHAR *vxd_name = NULL;
static const WCHAR bkslashes_with_dotW[] = {'\\','\\','.','\\',0}; static const WCHAR bkslashes_with_dotW[] = {'\\','\\','.','\\',0};
static const WCHAR coninW[] = {'C','O','N','I','N','$',0}; static const WCHAR coninW[] = {'C','O','N','I','N','$',0};
static const WCHAR conoutW[] = {'C','O','N','O','U','T','$',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, ...@@ -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 */ dosdev += MAKELONG( 0, 4*sizeof(WCHAR) ); /* adjust position to start of filename */
} }
else if (!(GetVersion() & 0x80000000)) else if (GetVersion() & 0x80000000)
{ {
dosdev = 0; vxd_name = filename + 4;
}
else if (filename[4])
{
ret = VXD_Open( filename+4, access, sa );
goto done;
}
else
{
SetLastError( ERROR_INVALID_NAME );
return INVALID_HANDLE_VALUE;
} }
} }
else dosdev = RtlIsDosDeviceName_U( filename ); else dosdev = RtlIsDosDeviceName_U( filename );
...@@ -1465,6 +1456,8 @@ HANDLE WINAPI CreateFileW( LPCWSTR filename, DWORD access, DWORD sharing, ...@@ -1465,6 +1456,8 @@ HANDLE WINAPI CreateFileW( LPCWSTR filename, DWORD access, DWORD sharing,
options, NULL, 0 ); options, NULL, 0 );
if (status) 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); WARN("Unable to create file %s (status %x)\n", debugstr_w(filename), status);
ret = INVALID_HANDLE_VALUE; ret = INVALID_HANDLE_VALUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment