aboutsummaryrefslogtreecommitdiff
path: root/Emby.Common.Implementations/IO/SharpCifs/Smb/SmbComNtTransactionResponse.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Common.Implementations/IO/SharpCifs/Smb/SmbComNtTransactionResponse.cs')
-rw-r--r--Emby.Common.Implementations/IO/SharpCifs/Smb/SmbComNtTransactionResponse.cs63
1 files changed, 63 insertions, 0 deletions
diff --git a/Emby.Common.Implementations/IO/SharpCifs/Smb/SmbComNtTransactionResponse.cs b/Emby.Common.Implementations/IO/SharpCifs/Smb/SmbComNtTransactionResponse.cs
new file mode 100644
index 0000000000..88d73528a1
--- /dev/null
+++ b/Emby.Common.Implementations/IO/SharpCifs/Smb/SmbComNtTransactionResponse.cs
@@ -0,0 +1,63 @@
+// This code is derived from jcifs smb client library <jcifs at samba dot org>
+// Ported by J. Arturo <webmaster at komodosoft dot net>
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+namespace SharpCifs.Smb
+{
+ internal abstract class SmbComNtTransactionResponse : SmbComTransactionResponse
+ {
+ internal override int ReadParameterWordsWireFormat(byte[] buffer, int bufferIndex
+ )
+ {
+ int start = bufferIndex;
+ buffer[bufferIndex++] = unchecked(unchecked(0x00));
+ // Reserved
+ buffer[bufferIndex++] = unchecked(unchecked(0x00));
+ // Reserved
+ buffer[bufferIndex++] = unchecked(unchecked(0x00));
+ // Reserved
+ TotalParameterCount = ReadInt4(buffer, bufferIndex);
+ if (BufDataStart == 0)
+ {
+ BufDataStart = TotalParameterCount;
+ }
+ bufferIndex += 4;
+ TotalDataCount = ReadInt4(buffer, bufferIndex);
+ bufferIndex += 4;
+ ParameterCount = ReadInt4(buffer, bufferIndex);
+ bufferIndex += 4;
+ ParameterOffset = ReadInt4(buffer, bufferIndex);
+ bufferIndex += 4;
+ ParameterDisplacement = ReadInt4(buffer, bufferIndex);
+ bufferIndex += 4;
+ DataCount = ReadInt4(buffer, bufferIndex);
+ bufferIndex += 4;
+ DataOffset = ReadInt4(buffer, bufferIndex);
+ bufferIndex += 4;
+ DataDisplacement = ReadInt4(buffer, bufferIndex);
+ bufferIndex += 4;
+ SetupCount = buffer[bufferIndex] & unchecked(0xFF);
+ bufferIndex += 2;
+ if (SetupCount != 0)
+ {
+ if (Log.Level >= 3)
+ {
+ Log.WriteLine("setupCount is not zero: " + SetupCount);
+ }
+ }
+ return bufferIndex - start;
+ }
+ }
+}