From 09ed6e6eb97dc0e378c9e18ae74f63e0e1b32eb7 Mon Sep 17 00:00:00 2001 From: Tal Aloni Date: Sat, 2 Feb 2019 16:32:10 +0200 Subject: [PATCH] NTFileSystemAdapter: ToNTStatus: Return STATUS_OBJECT_NAME_INVALID when Win32 error code is ERROR_INVALID_NAME --- SMBLibrary/NTFileStore/Adapter/NTFileSystemAdapter.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SMBLibrary/NTFileStore/Adapter/NTFileSystemAdapter.cs b/SMBLibrary/NTFileStore/Adapter/NTFileSystemAdapter.cs index 4341b0e..39d0c40 100644 --- a/SMBLibrary/NTFileStore/Adapter/NTFileSystemAdapter.cs +++ b/SMBLibrary/NTFileStore/Adapter/NTFileSystemAdapter.cs @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2018 Tal Aloni . All rights reserved. +/* Copyright (C) 2014-2019 Tal Aloni . 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, @@ -526,6 +526,10 @@ namespace SMBLibrary { return NTStatus.STATUS_DISK_FULL; } + else if (errorCode == (ushort)Win32Error.ERROR_INVALID_NAME) + { + return NTStatus.STATUS_OBJECT_NAME_INVALID; + } else if (errorCode == (ushort)Win32Error.ERROR_DIR_NOT_EMPTY) { // If a user tries to rename folder1 to folder2 when folder2 already exists, Windows 7 will offer to merge folder1 into folder2.