private void SendAndReceiveSCSICommand(RsvdClient rsvdClient, byte cdbLength, byte[] cdbBuffer, byte[] dataBuffer, out byte scsiStatus) { SVHDX_TUNNEL_OPERATION_HEADER?header; SVHDX_TUNNEL_SCSI_RESPONSE? response; byte[] payload = rsvdClient.CreateTunnelScsiRequest( RsvdConst.SVHDX_TUNNEL_SCSI_REQUEST_LENGTH, cdbLength, (byte)RsvdConst.RSVD_SCSI_SENSE_BUFFER_SIZE, false, SRB_FLAGS.SRB_FLAGS_DATA_OUT, (byte)dataBuffer.Length, cdbBuffer, dataBuffer); uint status = rsvdClient.TunnelOperation <SVHDX_TUNNEL_SCSI_RESPONSE>( false,//true for Async operation, false for non-async operation RSVD_TUNNEL_OPERATION_CODE.RSVD_TUNNEL_SCSI_OPERATION, ++RequestIdentifier, payload, out header, out response); BaseTestSite.Assert.AreEqual( (uint)Smb2Status.STATUS_SUCCESS, status, "Ioctl should succeed, actual status: {0}", GetStatus(status)); VerifyTunnelOperationHeader(header.Value, RSVD_TUNNEL_OPERATION_CODE.RSVD_TUNNEL_SCSI_OPERATION, (uint)RsvdStatus.STATUS_SVHDX_SUCCESS, RequestIdentifier); VerifyFieldInResponse("DataIn", false, response.Value.DataIn); // the CDB buffer specified is to receive data from the server. VerifyFieldInResponse("Length", 36, response.Value.Length); // the size of the SVHDX_TUNNEL_SCSI_REQUEST structure excluding the DataBuffer field; This field MUST be set to 36. scsiStatus = response.Value.ScsiStatus; }
private void SendAndReceiveSCSICommand(RsvdClient rsvdClient, byte cdbLength, byte[] cdbBuffer, byte[] dataBuffer, out byte scsiStatus) { SVHDX_TUNNEL_OPERATION_HEADER? header; SVHDX_TUNNEL_SCSI_RESPONSE? response; byte[] payload = rsvdClient.CreateTunnelScsiRequest( RsvdConst.SVHDX_TUNNEL_SCSI_REQUEST_LENGTH, cdbLength, (byte)RsvdConst.RSVD_SCSI_SENSE_BUFFER_SIZE, false, SRB_FLAGS.SRB_FLAGS_DATA_OUT, (byte)dataBuffer.Length, cdbBuffer, dataBuffer); uint status = rsvdClient.TunnelOperation<SVHDX_TUNNEL_SCSI_RESPONSE>( false,//true for Async operation, false for non-async operation RSVD_TUNNEL_OPERATION_CODE.RSVD_TUNNEL_SCSI_OPERATION, ++RequestIdentifier, payload, out header, out response); BaseTestSite.Assert.AreEqual( (uint)Smb2Status.STATUS_SUCCESS, status, "Ioctl should succeed, actual status: {0}", GetStatus(status)); VerifyTunnelOperationHeader(header.Value, RSVD_TUNNEL_OPERATION_CODE.RSVD_TUNNEL_SCSI_OPERATION, (uint)RsvdStatus.STATUS_SVHDX_SUCCESS, RequestIdentifier); VerifyFieldInResponse("DataIn", false, response.Value.DataIn); // the CDB buffer specified is to receive data from the server. VerifyFieldInResponse("Length", 36, response.Value.Length);// the size of the SVHDX_TUNNEL_SCSI_REQUEST structure excluding the DataBuffer field; This field MUST be set to 36. scsiStatus = response.Value.ScsiStatus; }