diff --git a/SMBLibrary/Server/SMB1/Transaction2SubcommandHelper.cs b/SMBLibrary/Server/SMB1/Transaction2SubcommandHelper.cs index 0e1985f..1cf0cf2 100644 --- a/SMBLibrary/Server/SMB1/Transaction2SubcommandHelper.cs +++ b/SMBLibrary/Server/SMB1/Transaction2SubcommandHelper.cs @@ -53,7 +53,16 @@ namespace SMBLibrary.Server.SMB1 int entriesToReturn = Math.Min(subcommand.SearchCount, entries.Count); List segment = entries.GetRange(0, entriesToReturn); int maxLength = (int)state.GetMaxDataCount(header.PID).Value; - FindInformationList findInformationList = SMB1FileStoreHelper.GetFindInformationList(segment, subcommand.InformationLevel, header.UnicodeFlag, returnResumeKeys, maxLength); + FindInformationList findInformationList; + try + { + findInformationList = SMB1FileStoreHelper.GetFindInformationList(segment, subcommand.InformationLevel, header.UnicodeFlag, returnResumeKeys, maxLength); + } + catch (UnsupportedInformationLevelException) + { + header.Status = NTStatus.STATUS_OS2_INVALID_LEVEL; + return null; + } int returnCount = findInformationList.Count; Transaction2FindFirst2Response response = new Transaction2FindFirst2Response(); response.SetFindInformationList(findInformationList, header.UnicodeFlag); diff --git a/SMBLibrary/Server/SMBServer.SMB1.cs b/SMBLibrary/Server/SMBServer.SMB1.cs index a2fb2d1..d07560d 100644 --- a/SMBLibrary/Server/SMBServer.SMB1.cs +++ b/SMBLibrary/Server/SMBServer.SMB1.cs @@ -257,28 +257,12 @@ namespace SMBLibrary.Server else if (command is TransactionRequest) // Both TransactionRequest and Transaction2Request { TransactionRequest request = (TransactionRequest)command; - try - { - return TransactionHelper.GetTransactionResponse(header, request, share, state); - } - catch (UnsupportedInformationLevelException) - { - header.Status = NTStatus.STATUS_INVALID_PARAMETER; - return new ErrorResponse(command.CommandName); - } + return TransactionHelper.GetTransactionResponse(header, request, share, state); } else if (command is TransactionSecondaryRequest) // Both TransactionSecondaryRequest and Transaction2SecondaryRequest { TransactionSecondaryRequest request = (TransactionSecondaryRequest)command; - try - { - return TransactionHelper.GetTransactionResponse(header, request, share, state); - } - catch (UnsupportedInformationLevelException) - { - header.Status = NTStatus.STATUS_INVALID_PARAMETER; - return new ErrorResponse(command.CommandName); - } + return TransactionHelper.GetTransactionResponse(header, request, share, state); } else if (command is NTTransactRequest) {