public NtStatus SmbdNegotiate( SmbdVersion minVersion, SmbdVersion maxVersion, ushort reserved, ushort creditsRequested, ushort receiveCreditMax, uint preferredSendSize, uint maxReceiveSize, uint maxFragmentedSize, out SmbdNegotiateResponse smbdNegotiateResponse ) { NtStatus status = smbdClient.Negotiate( minVersion, maxVersion, creditsRequested, receiveCreditMax, preferredSendSize, maxReceiveSize, maxFragmentedSize, out smbdNegotiateResponse, reserved ); // record Server's ADM ServerConnection.MaxSendSize = smbdNegotiateResponse.PreferredSendSize; ServerConnection.MaxReceiveSize = smbdNegotiateResponse.MaxReceiveSize; ServerConnection.MaxFragmentedSize = smbdNegotiateResponse.MaxFragmentedSize; ServerConnection.MaxReadWriteSize = smbdNegotiateResponse.MaxReadWriteSize; return(status); }
public void SMBDNegotiate( ushort creditsRequested, ushort receiveCreditMax, uint preferredSendSize, uint maxReceiveSize, uint maxFragmentedSize ) { SmbdNegotiateResponse response; var status = smbdClient.Negotiate( SmbdVersion.V1, SmbdVersion.V1, creditsRequested, receiveCreditMax, preferredSendSize, maxReceiveSize, maxFragmentedSize, out response ); if (status != NtStatus.STATUS_SUCCESS) { throw new InvalidOperationException("Negotiate failed!"); } smbdNegotiated = true; maxSMBDSendSize = response.PreferredSendSize; maxSMBDReceiveSize = response.MaxReceiveSize; }