update sharpcifs

This commit is contained in:
Luke Pulverenti
2017-06-21 02:46:57 -04:00
parent 2b20163775
commit 23691e181b
218 changed files with 25512 additions and 23721 deletions

View File

@@ -19,66 +19,68 @@ using SharpCifs.Util.Sharpen;
namespace SharpCifs.Smb
{
internal class SmbComTreeConnectAndXResponse : AndXServerMessageBlock
{
private const int SmbSupportSearchBits = unchecked(0x0001);
internal class SmbComTreeConnectAndXResponse : AndXServerMessageBlock
{
private const int SmbSupportSearchBits = unchecked(0x0001);
private const int SmbShareIsInDfs = unchecked(0x0002);
private const int SmbShareIsInDfs = unchecked(0x0002);
internal bool SupportSearchBits;
internal bool SupportSearchBits;
internal bool ShareIsInDfs;
internal bool ShareIsInDfs;
internal string Service;
internal string Service;
internal string NativeFileSystem = string.Empty;
internal string NativeFileSystem = string.Empty;
internal SmbComTreeConnectAndXResponse(ServerMessageBlock andx) : base(andx)
{
}
internal SmbComTreeConnectAndXResponse(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
)
{
SupportSearchBits = (buffer[bufferIndex] & SmbSupportSearchBits) == SmbSupportSearchBits;
ShareIsInDfs = (buffer[bufferIndex] & SmbShareIsInDfs) == SmbShareIsInDfs;
return 2;
}
internal override int ReadParameterWordsWireFormat(byte[] buffer, int bufferIndex)
{
SupportSearchBits = (buffer[bufferIndex] & SmbSupportSearchBits) == SmbSupportSearchBits;
ShareIsInDfs = (buffer[bufferIndex] & SmbShareIsInDfs) == SmbShareIsInDfs;
return 2;
}
internal override int ReadBytesWireFormat(byte[] buffer, int bufferIndex)
{
int start = bufferIndex;
int len = ReadStringLength(buffer, bufferIndex, 32);
try
{
//Service = Runtime.GetStringForBytes(buffer, bufferIndex, len, "ASCII");
internal override int ReadBytesWireFormat(byte[] buffer, int bufferIndex)
{
int start = bufferIndex;
int len = ReadStringLength(buffer, bufferIndex, 32);
try
{
//Service = Runtime.GetStringForBytes(buffer, bufferIndex, len, "ASCII");
Service = Runtime.GetStringForBytes(buffer, bufferIndex, len, "UTF-8");
}
catch (UnsupportedEncodingException)
{
return 0;
}
bufferIndex += len + 1;
// win98 observed not returning nativeFileSystem
return bufferIndex - start;
}
}
catch (UnsupportedEncodingException)
{
return 0;
}
bufferIndex += len + 1;
// win98 observed not returning nativeFileSystem
return bufferIndex - start;
}
public override string ToString()
{
string result = "SmbComTreeConnectAndXResponse[" + base.ToString() + ",supportSearchBits="
+ SupportSearchBits + ",shareIsInDfs=" + ShareIsInDfs + ",service=" + Service +
",nativeFileSystem=" + NativeFileSystem + "]";
return result;
}
}
public override string ToString()
{
string result = "SmbComTreeConnectAndXResponse["
+ base.ToString()
+ ",supportSearchBits=" + SupportSearchBits
+ ",shareIsInDfs=" + ShareIsInDfs
+ ",service=" + Service
+ ",nativeFileSystem=" + NativeFileSystem + "]";
return result;
}
}
}