summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/path.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2005-09-28 19:22:25 +0000
committerCorinna Vinschen <corinna@vinschen.de>2005-09-28 19:22:25 +0000
commitdcb091caaf9e00e840520141c1a74fb3f0eeb1d2 (patch)
tree483b37f8f41a0ce565559a2a5340f2fe5c3c9e57 /winsup/cygwin/path.cc
parent1204c515fe00335920c5707cc136e9562fd7cf38 (diff)
downloadcygnal-dcb091caaf9e00e840520141c1a74fb3f0eeb1d2.tar.gz
cygnal-dcb091caaf9e00e840520141c1a74fb3f0eeb1d2.tar.bz2
cygnal-dcb091caaf9e00e840520141c1a74fb3f0eeb1d2.zip
Revert erroneous checkin.
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r--winsup/cygwin/path.cc35
1 files changed, 15 insertions, 20 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index cec315b74..6b1e44cbd 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -75,7 +75,6 @@ details. */
#include "shared_info.h"
#include "registry.h"
#include "cygtls.h"
-#include "ntdll.h"
#include <assert.h>
static int normalize_win32_path (const char *, char *, char *&);
@@ -489,29 +488,25 @@ path_conv::set_normalized_path (const char *path_copy, bool strip_tail)
PUNICODE_STRING
path_conv::get_nt_native_path (UNICODE_STRING &upath)
{
- if (path[0] == '\\' && path[1] != '\\')
+ if (path[0] != '\\') /* X:\... or NUL, etc. */
{
- /* This handles all paths already given in NT speak. On writing this
- comment, these are the raw device paths. */
- if (RtlCreateUnicodeStringFromAsciiz (&upath, path))
- return &upath;
+ str2uni_cat (upath, "\\??\\");
+ str2uni_cat (upath, path);
}
- else
+ else if (path[1] != '\\') /* \Device\... */
+ str2uni_cat (upath, path);
+ else if (path[2] != '.'
+ || path[3] != '\\') /* \\server\share\... */
{
- wchar_t wc_path[CYG_MAX_PATH];
- sys_mbstowcs (wc_path, path, CYG_MAX_PATH);
- if (RtlDosPathNameToNtPathName_U (wc_path, &upath, NULL, NULL))
- {
-#ifdef DEBUGGING
- char nt_path[CYG_MAX_PATH + 7];
- sys_wcstombs (nt_path, upath.Buffer, CYG_MAX_PATH + 7);
- debug_printf ("DOS: <%s> NT: <%s>", path, nt_path);
-#endif
- return &upath;
- }
+ str2uni_cat (upath, "\\??\\UNC\\");
+ str2uni_cat (upath, path + 2);
}
- set_errno (ENOMEM);
- return NULL;
+ else /* \\.\device */
+ {
+ str2uni_cat (upath, "\\??\\");
+ str2uni_cat (upath, path + 4);
+ }
+ return &upath;
}
/* Convert an arbitrary path SRC to a pure Win32 path, suitable for