summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/path.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2009-07-14 17:37:42 +0000
committerCorinna Vinschen <corinna@vinschen.de>2009-07-14 17:37:42 +0000
commit8deb411836f5c7faf15202b29499266f081f5708 (patch)
tree32ef5201ac1c91e55e9d025aa12e2442230041b9 /winsup/cygwin/path.cc
parent472345a06cd5accbba1796ed227c620e583b11a4 (diff)
downloadcygnal-8deb411836f5c7faf15202b29499266f081f5708.tar.gz
cygnal-8deb411836f5c7faf15202b29499266f081f5708.tar.bz2
cygnal-8deb411836f5c7faf15202b29499266f081f5708.zip
Throughout avoid having to initialize constant UNICODE_STRINGs.
* globals.cc: Define constant UNICODE_STRINGs and store in .rdata section. * fhandler_disk_file.cc: Throughout, use readonly UNICODE_STRINGs rather then initializing local UNICODE_STRING variable where applicable. * fhandler_mem.cc (fhandler_dev_mem::open): Ditto. * flock.cc (inode_t::inode_t): Ditto. * mmap.cc: Ditto. * syscalls.cc: Ditto. * mount.cc (fs_info::update): Ditto. * path.cc: Ditto. * ntdll.h (RtlEqualUnicodePathPrefix): Redefine to take prefix as UNICODE_STRING. (RtlEqualUnicodePathSuffix): Redefine to take suffix as UNICODE_STRING. * fhandler_disk_file.cc: Accommodate throughout. * mount.cc (fs_info::update): Ditto. * path.cc (cwdstuff::set): Ditto. * syscalls.cc: Ditto.
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r--winsup/cygwin/path.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 56bf6aece..b8be19f2e 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -448,7 +448,7 @@ get_nt_native_path (const char *path, UNICODE_STRING& upath)
{
if (path[1] == ':') /* X:\... */
{
- RtlAppendUnicodeToString (&upath, L"\\??\\");
+ RtlAppendUnicodeStringToString (&upath, &ro_u_natp);
str2uni_cat (upath, path);
/* The drive letter must be upper case. */
upath.Buffer[4] = towupper (upath.Buffer[4]);
@@ -462,13 +462,13 @@ get_nt_native_path (const char *path, UNICODE_STRING& upath)
else if ((path[2] != '.' && path[2] != '?')
|| path[3] != '\\') /* \\server\share\... */
{
- RtlAppendUnicodeToString (&upath, L"\\??\\UNC\\");
+ RtlAppendUnicodeStringToString (&upath, &ro_u_uncp);
str2uni_cat (upath, path + 2);
transform_chars (&upath, 8);
}
else /* \\.\device or \\?\foo */
{
- RtlAppendUnicodeToString (&upath, L"\\??\\");
+ RtlAppendUnicodeStringToString (&upath, &ro_u_natp);
str2uni_cat (upath, path + 4);
}
return &upath;
@@ -3079,7 +3079,7 @@ cwdstuff::set (PUNICODE_STRING nat_cwd, const char *posix_cwd, bool doit)
else
{
len = upath.Length / sizeof (WCHAR) - 4;
- if (RtlEqualUnicodePathPrefix (&upath, L"\\??\\UNC\\", TRUE))
+ if (RtlEqualUnicodePathPrefix (&upath, &ro_u_uncp, TRUE))
len -= 2;
}
}