* path.cc (get_nt_native_path): Allow to convert special paths which

have no native NT path representation for simplified debug output.
	* syscalls.cc: Convert debug output to print native NT path.
	(unlink): Drop redundant debug output.
This commit is contained in:
Corinna Vinschen
2007-08-15 16:27:09 +00:00
parent 6d70255fe8
commit c4bd837700
3 changed files with 19 additions and 11 deletions

View File

@ -544,20 +544,22 @@ path_conv::set_normalized_path (const char *path_copy, bool strip_tail)
PUNICODE_STRING
get_nt_native_path (const char *path, UNICODE_STRING &upath)
{
if (path[0] != '\\') /* X:\... or NUL, etc. */
if (path[0] == '/') /* special path w/o NT path representation. */
str2uni_cat (upath, path);
else if (path[0] != '\\') /* X:\... or NUL, etc. */
{
str2uni_cat (upath, "\\??\\");
str2uni_cat (upath, path);
}
else if (path[1] != '\\') /* \Device\... */
else if (path[1] != '\\') /* \Device\... */
str2uni_cat (upath, path);
else if ((path[2] != '.' && path[2] != '?')
|| path[3] != '\\') /* \\server\share\... */
|| path[3] != '\\') /* \\server\share\... */
{
str2uni_cat (upath, "\\??\\UNC\\");
str2uni_cat (upath, path + 2);
}
else /* \\.\device or \\?\foo */
else /* \\.\device or \\?\foo */
{
str2uni_cat (upath, "\\??\\");
str2uni_cat (upath, path + 4);