Commit 60f11d29 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

kernelbase: Simplify CreateFileW.

parent 141e53ba
...@@ -738,7 +738,6 @@ HANDLE WINAPI DECLSPEC_HOTPATCH CreateFileW( LPCWSTR filename, DWORD access, DWO ...@@ -738,7 +738,6 @@ HANDLE WINAPI DECLSPEC_HOTPATCH CreateFileW( LPCWSTR filename, DWORD access, DWO
UNICODE_STRING nameW; UNICODE_STRING nameW;
IO_STATUS_BLOCK io; IO_STATUS_BLOCK io;
HANDLE ret; HANDLE ret;
DWORD dosdev;
const WCHAR *vxd_name = NULL; const WCHAR *vxd_name = NULL;
SECURITY_QUALITY_OF_SERVICE qos; SECURITY_QUALITY_OF_SERVICE qos;
...@@ -770,25 +769,14 @@ HANDLE WINAPI DECLSPEC_HOTPATCH CreateFileW( LPCWSTR filename, DWORD access, DWO ...@@ -770,25 +769,14 @@ HANDLE WINAPI DECLSPEC_HOTPATCH CreateFileW( LPCWSTR filename, DWORD access, DWO
(sharing & FILE_SHARE_DELETE) ? "FILE_SHARE_DELETE " : "", (sharing & FILE_SHARE_DELETE) ? "FILE_SHARE_DELETE " : "",
creation, attributes); creation, attributes);
if (!wcsncmp( filename, L"\\\\.\\", 4 )) if ((GetVersion() & 0x80000000) && !wcsncmp( filename, L"\\\\.\\", 4 ) &&
{ !RtlIsDosDeviceName_U( filename + 4 ) &&
if ((filename[4] && filename[5] == ':' && !filename[6]) || wcsnicmp( filename + 4, L"PIPE\\", 5 ) &&
!wcsnicmp( filename + 4, L"PIPE\\", 5 ) || wcsnicmp( filename + 4, L"MAILSLOT\\", 9 ))
!wcsnicmp( filename + 4, L"MAILSLOT\\", 9 ))
{
dosdev = 0;
}
else if ((dosdev = RtlIsDosDeviceName_U( filename + 4 )))
{
dosdev += MAKELONG( 0, 4*sizeof(WCHAR) ); /* adjust position to start of filename */
}
else if (GetVersion() & 0x80000000)
{ {
vxd_name = filename + 4; vxd_name = filename + 4;
if (!creation) creation = OPEN_EXISTING; if (!creation) creation = OPEN_EXISTING;
} }
}
else dosdev = RtlIsDosDeviceName_U( filename );
if (creation < CREATE_NEW || creation > TRUNCATE_EXISTING) if (creation < CREATE_NEW || creation > TRUNCATE_EXISTING)
{ {
......
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