NTFileSystemAdapter: ToNTStatus: Return STATUS_OBJECT_PATH_INVALID when Win32 error code is ERROR_BAD_PATHNAME

This commit is contained in:
Tal Aloni 2018-11-23 23:31:05 +02:00
parent c4406b6a8f
commit 4c29d5a402

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2014-2017 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
/* Copyright (C) 2014-2018 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
*
* You can redistribute this program and/or modify it under the terms of
* the GNU Lesser Public License as published by the Free Software Foundation,
@ -467,6 +467,10 @@ namespace SMBLibrary
// In such case, Windows 7 will delete folder 1 and will expect STATUS_DIRECTORY_NOT_EMPTY if there are files to merge.
return NTStatus.STATUS_DIRECTORY_NOT_EMPTY;
}
else if (errorCode == (ushort)Win32Error.ERROR_BAD_PATHNAME)
{
return NTStatus.STATUS_OBJECT_PATH_INVALID;
}
else if (errorCode == (ushort)Win32Error.ERROR_ALREADY_EXISTS)
{
// According to [MS-FSCC], FileRenameInformation MUST return STATUS_OBJECT_NAME_COLLISION when the specified name already exists and ReplaceIfExists is zero.