mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-04-30 10:47:48 +02:00
Fixed InvalidCastException during SMB 2.002 connection
This commit is contained in:
parent
3539d3bd31
commit
1679629b47
2 changed files with 10 additions and 2 deletions
|
@ -47,8 +47,12 @@ namespace SMBLibrary.Server
|
||||||
if (command is NegotiateRequest)
|
if (command is NegotiateRequest)
|
||||||
{
|
{
|
||||||
NegotiateRequest request = (NegotiateRequest)command;
|
NegotiateRequest request = (NegotiateRequest)command;
|
||||||
state = new SMB2ConnectionState(state, AllocatePersistentFileID);
|
SMB2Command response = NegotiateHelper.GetNegotiateResponse(request, state, m_serverGuid);
|
||||||
return NegotiateHelper.GetNegotiateResponse(request, state, m_serverGuid);
|
if (state.ServerDialect != SMBDialect.NotSet)
|
||||||
|
{
|
||||||
|
state = new SMB2ConnectionState(state, AllocatePersistentFileID);
|
||||||
|
}
|
||||||
|
return response;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -245,6 +245,10 @@ namespace SMBLibrary.Server
|
||||||
if (smb2Dialects.Count > 0)
|
if (smb2Dialects.Count > 0)
|
||||||
{
|
{
|
||||||
SMB2Command response = SMB2.NegotiateHelper.GetNegotiateResponse(smb2Dialects, state, m_serverGuid);
|
SMB2Command response = SMB2.NegotiateHelper.GetNegotiateResponse(smb2Dialects, state, m_serverGuid);
|
||||||
|
if (state.ServerDialect != SMBDialect.NotSet)
|
||||||
|
{
|
||||||
|
state = new SMB2ConnectionState(state, AllocatePersistentFileID);
|
||||||
|
}
|
||||||
TrySendResponse(state, response);
|
TrySendResponse(state, response);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue