aboutsummaryrefslogtreecommitdiff
path: root/Emby.Common.Implementations/IO/SharpCifs/Smb/SmbComSessionSetupAndXResponse.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Common.Implementations/IO/SharpCifs/Smb/SmbComSessionSetupAndXResponse.cs')
-rw-r--r--Emby.Common.Implementations/IO/SharpCifs/Smb/SmbComSessionSetupAndXResponse.cs124
1 files changed, 61 insertions, 63 deletions
diff --git a/Emby.Common.Implementations/IO/SharpCifs/Smb/SmbComSessionSetupAndXResponse.cs b/Emby.Common.Implementations/IO/SharpCifs/Smb/SmbComSessionSetupAndXResponse.cs
index ba7b66acd..a3b80a669 100644
--- a/Emby.Common.Implementations/IO/SharpCifs/Smb/SmbComSessionSetupAndXResponse.cs
+++ b/Emby.Common.Implementations/IO/SharpCifs/Smb/SmbComSessionSetupAndXResponse.cs
@@ -18,77 +18,75 @@ using System;
namespace SharpCifs.Smb
{
- internal class SmbComSessionSetupAndXResponse : AndXServerMessageBlock
- {
- private string _nativeOs = string.Empty;
+ internal class SmbComSessionSetupAndXResponse : AndXServerMessageBlock
+ {
+ private string _nativeOs = string.Empty;
- private string _nativeLanMan = string.Empty;
+ private string _nativeLanMan = string.Empty;
- private string _primaryDomain = string.Empty;
+ private string _primaryDomain = string.Empty;
- internal bool IsLoggedInAsGuest;
+ internal bool IsLoggedInAsGuest;
- internal byte[] Blob;
+ internal byte[] Blob;
- internal SmbComSessionSetupAndXResponse(ServerMessageBlock andx) : base(andx)
- {
- }
+ internal SmbComSessionSetupAndXResponse(ServerMessageBlock andx) : base(andx)
+ {
+ }
- internal override int WriteParameterWordsWireFormat(byte[] dst, int dstIndex)
- {
- return 0;
- }
+ internal override int WriteParameterWordsWireFormat(byte[] dst, int dstIndex)
+ {
+ return 0;
+ }
- internal override int WriteBytesWireFormat(byte[] dst, int dstIndex)
- {
- return 0;
- }
+ internal override int WriteBytesWireFormat(byte[] dst, int dstIndex)
+ {
+ return 0;
+ }
- internal override int ReadParameterWordsWireFormat(byte[] buffer, int bufferIndex)
- {
- int start = bufferIndex;
- IsLoggedInAsGuest = (buffer[bufferIndex] & 0x01) == 0x01
- ? true
- : false;
- bufferIndex += 2;
- if (ExtendedSecurity)
- {
- int blobLength = ReadInt2(buffer, bufferIndex);
- bufferIndex += 2;
- Blob = new byte[blobLength];
- }
- return bufferIndex - start;
- }
+ internal override int ReadParameterWordsWireFormat(byte[] buffer, int bufferIndex
+ )
+ {
+ int start = bufferIndex;
+ IsLoggedInAsGuest = (buffer[bufferIndex] & 0x01) == 0x01 ? true : false;
+ bufferIndex += 2;
+ if (ExtendedSecurity)
+ {
+ int blobLength = ReadInt2(buffer, bufferIndex);
+ bufferIndex += 2;
+ Blob = new byte[blobLength];
+ }
+ return bufferIndex - start;
+ }
- internal override int ReadBytesWireFormat(byte[] buffer, int bufferIndex)
- {
- int start = bufferIndex;
- if (ExtendedSecurity)
- {
- Array.Copy(buffer, bufferIndex, Blob, 0, Blob.Length);
- bufferIndex += Blob.Length;
- }
- _nativeOs = ReadString(buffer, bufferIndex);
- bufferIndex += StringWireLength(_nativeOs, bufferIndex);
- _nativeLanMan = ReadString(buffer, bufferIndex, start + ByteCount, 255, UseUnicode);
- bufferIndex += StringWireLength(_nativeLanMan, bufferIndex);
- if (!ExtendedSecurity)
- {
- _primaryDomain = ReadString(buffer, bufferIndex, start + ByteCount, 255, UseUnicode);
- bufferIndex += StringWireLength(_primaryDomain, bufferIndex);
- }
- return bufferIndex - start;
- }
+ internal override int ReadBytesWireFormat(byte[] buffer, int bufferIndex)
+ {
+ int start = bufferIndex;
+ if (ExtendedSecurity)
+ {
+ Array.Copy(buffer, bufferIndex, Blob, 0, Blob.Length);
+ bufferIndex += Blob.Length;
+ }
+ _nativeOs = ReadString(buffer, bufferIndex);
+ bufferIndex += StringWireLength(_nativeOs, bufferIndex);
+ _nativeLanMan = ReadString(buffer, bufferIndex, start + ByteCount, 255, UseUnicode
+ );
+ bufferIndex += StringWireLength(_nativeLanMan, bufferIndex);
+ if (!ExtendedSecurity)
+ {
+ _primaryDomain = ReadString(buffer, bufferIndex, start + ByteCount, 255, UseUnicode
+ );
+ bufferIndex += StringWireLength(_primaryDomain, bufferIndex);
+ }
+ return bufferIndex - start;
+ }
- public override string ToString()
- {
- string result = "SmbComSessionSetupAndXResponse["
- + base.ToString()
- + ",isLoggedInAsGuest=" + IsLoggedInAsGuest
- + ",nativeOs=" + _nativeOs
- + ",nativeLanMan=" + _nativeLanMan
- + ",primaryDomain=" + _primaryDomain + "]";
- return result;
- }
- }
+ public override string ToString()
+ {
+ string result = "SmbComSessionSetupAndXResponse[" + base.ToString() +
+ ",isLoggedInAsGuest=" + IsLoggedInAsGuest + ",nativeOs=" + _nativeOs + ",nativeLanMan="
+ + _nativeLanMan + ",primaryDomain=" + _primaryDomain + "]";
+ return result;
+ }
+ }
}