* fhandler.cc (fhandler_base::open): Fix NT native path evaluation

to allow opening serial ports.
This commit is contained in:
Corinna Vinschen 2004-04-30 14:02:37 +00:00
parent 72f3756e07
commit e6b21dafc1
2 changed files with 21 additions and 11 deletions

View File

@ -1,3 +1,8 @@
2004-04-30 Corinna Vinschen <corinna@vinschen.de>
* fhandler.cc (fhandler_base::open): Fix NT native path evaluation
to allow opening serial ports.
2004-04-30 DJ Delorie <dj@redhat.com>
* init.cc (threadfunc_fe): Hack to make thread stacks always 16

View File

@ -554,21 +554,26 @@ fhandler_base::open (int flags, mode_t mode)
set_errno (ENOENT);
goto done;
}
if (get_win32_name ()[0] == '\\')
{
if (get_win32_name ()[1] == '\\')
{
str2buf2uni (upath, wpath, "\\??\\UNC");
str2buf2uni_cat (upath, get_win32_name () + 1);
}
else
str2buf2uni (upath, wpath, get_win32_name ());
}
else
if (get_win32_name ()[0] != '\\') /* X:\... or NUL, etc. */
{
str2buf2uni (upath, wpath, "\\??\\");
str2buf2uni_cat (upath, get_win32_name ());
}
else if (get_win32_name ()[1] != '\\') /* \Device\... */
str2buf2uni (upath, wpath, get_win32_name ());
else if (get_win32_name ()[2] != '.'
|| get_win32_name ()[3] != '\\') /* \\server\share\... */
{
str2buf2uni (upath, wpath, "\\??\\UNC\\");
str2buf2uni_cat (upath, get_win32_name () + 2);
}
else /* \\.\device */
{
str2buf2uni (upath, wpath, "\\??\\");
str2buf2uni_cat (upath, get_win32_name () + 4);
}
InitializeObjectAttributes (&attr, &upath, OBJ_CASE_INSENSITIVE | OBJ_INHERIT,
sa.lpSecurityDescriptor, NULL);