private bool TestSqosVersion(string share, SQOS_PROTOCOL_VERSION version)
        {
            using (SqosClient client = new SqosClient(new TimeSpan(0, 0, defaultTimeoutInSeconds)))
            {
                client.ConnectToVHD(
                    SUTName, SUTIpAddress, Credential.DomainName, Credential.AccountName, Credential.Password, SecurityPackageType,
                    true, share, vhdName);
                SqosRequestPacket sqosRequest = new SqosRequestPacket(version == SQOS_PROTOCOL_VERSION.Sqos10 ? SqosRequestType.V10 : SqosRequestType.V11,
                    (ushort)version,
                    SqosOptions_Values.STORAGE_QOS_CONTROL_FLAG_SET_LOGICAL_FLOW_ID | SqosOptions_Values.STORAGE_QOS_CONTROL_FLAG_GET_STATUS,
                    Guid.NewGuid(),
                    Guid.Empty,
                    Guid.Empty,
                    string.Empty,
                    string.Empty
                    );
                SqosResponsePacket sqosResponse;
                uint status = client.SendAndReceiveSqosPacket(
                    sqosRequest,
                    out sqosResponse);

                if (status != Smb2Status.STATUS_SUCCESS)
                    return false;

                return (ushort)version == sqosResponse.Header.ProtocolVersion;
            }
        }
Пример #2
0
        private bool TestSqosVersion(string share, SQOS_PROTOCOL_VERSION version)
        {
            using (SqosClient client = new SqosClient(new TimeSpan(0, 0, defaultTimeoutInSeconds)))
            {
                client.ConnectToVHD(
                    SUTName, SUTIpAddress, Credential.DomainName, Credential.AccountName, Credential.Password, SecurityPackageType,
                    true, share, vhdName);
                SqosRequestPacket sqosRequest = new SqosRequestPacket(version == SQOS_PROTOCOL_VERSION.Sqos10 ? SqosRequestType.V10 : SqosRequestType.V11,
                                                                      (ushort)version,
                                                                      SqosOptions_Values.STORAGE_QOS_CONTROL_FLAG_SET_LOGICAL_FLOW_ID | SqosOptions_Values.STORAGE_QOS_CONTROL_FLAG_GET_STATUS,
                                                                      Guid.NewGuid(),
                                                                      Guid.Empty,
                                                                      Guid.Empty,
                                                                      string.Empty,
                                                                      string.Empty
                                                                      );
                SqosResponsePacket sqosResponse;
                uint status = client.SendAndReceiveSqosPacket(
                    sqosRequest,
                    out sqosResponse);

                if (status != Smb2Status.STATUS_SUCCESS)
                {
                    return(false);
                }

                return((ushort)version == sqosResponse.Header.ProtocolVersion);
            }
        }
 /// <summary>
 /// To reset the detection information.
 /// </summary>
 public void ResetDetectResult()
 {
     F_CopyOffload           = new DetectResult[] { DetectResult.UnSupported, DetectResult.UnSupported };
     F_IntegrityInfo         = new DetectResult[] { DetectResult.UnSupported, DetectResult.UnSupported };
     F_FileLevelTrim         = DetectResult.UnSupported;
     F_ResilientHandle       = DetectResult.UnSupported;
     F_ValidateNegotiateInfo = DetectResult.UnSupported;
     F_EnumerateSnapShots    = DetectResult.UnSupported;
     F_AppInstanceId         = DetectResult.UnSupported;
     F_HandleV1_BatchOplock  = DetectResult.UnSupported;
     F_HandleV1_LeaseV1      = DetectResult.UnSupported;
     F_HandleV2_BatchOplock  = DetectResult.UnSupported;
     F_HandleV2_LeaseV1      = DetectResult.UnSupported;
     F_HandleV2_LeaseV2      = DetectResult.UnSupported;
     F_Leasing_V1            = DetectResult.UnSupported;
     F_Leasing_V2            = DetectResult.UnSupported;
     RsvdVersion             = 0;
     SqosVersion             = 0;
 }