summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/path.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2015-04-23 15:02:32 +0200
committerCorinna Vinschen <corinna@vinschen.de>2015-04-23 15:02:32 +0200
commit5de9c2745c5539909973771844bcbef3e94c2070 (patch)
treee700fccb56e0bb4f6a2f146152940c686509eb70 /winsup/cygwin/path.cc
parent46077e809d15ea008576b305799e476ee80d5474 (diff)
downloadcygnal-5de9c2745c5539909973771844bcbef3e94c2070.tar.gz
cygnal-5de9c2745c5539909973771844bcbef3e94c2070.tar.bz2
cygnal-5de9c2745c5539909973771844bcbef3e94c2070.zip
Handle unlinking in-use files on virtual drives
* path.cc (path_conv::set_nt_native_path): New function. * path.h (path_conv::set_nt_native_path): Add prototype. * syscall.cc (try_to_bin): Handle moving files to the recycler accessed via a local virtual drive (subst). Fix a problem renaming the file to the unique replacement name on Samba. Align comment. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r--winsup/cygwin/path.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index ea5595698..b1a02e133 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -486,6 +486,18 @@ get_nt_native_path (const char *path, UNICODE_STRING& upath, bool dos)
return &upath;
}
+/* Handle with extrem care! Only used in a certain instance in try_to_bin.
+ Every other usage needs a careful check. */
+void
+path_conv::set_nt_native_path (PUNICODE_STRING new_path)
+{
+ wide_path = (PWCHAR) crealloc_abort (wide_path, new_path->MaximumLength);
+ memcpy (wide_path, new_path->Buffer, new_path->Length);
+ uni_path.Length = new_path->Length;
+ uni_path.MaximumLength = new_path->MaximumLength;
+ uni_path.Buffer = wide_path;
+}
+
PUNICODE_STRING
path_conv::get_nt_native_path ()
{