public RDPINPUT_INVALID_PDU CreateRdpInputInvalidPdu(ushort eventId, uint pduLength, byte[] data) { RDPINPUT_INVALID_PDU pdu = new RDPINPUT_INVALID_PDU(); pdu.eventId = eventId; pdu.pduLength = pduLength; pdu.data = data; return pdu; }
public void SendRdpInvalidPdu(RDPINPUT_INVALID_PDU pdu) { byte[] data = PduMarshaler.Marshal(pdu); //Sleep 100 millisecond to this packet to be merged with another packet in TCP channel. System.Threading.Thread.Sleep(100); rdpeiServer.RdpeiDVChannel.Send(data); }
public RDPINPUT_INVALID_PDU CreateRdpInputInvalidPdu(ushort eventId, uint pduLength, byte[] data) { RDPINPUT_INVALID_PDU pdu = new RDPINPUT_INVALID_PDU(); pdu.eventId = eventId; pdu.pduLength = pduLength; pdu.data = data; return(pdu); }
public void SendRdpInvalidPdu(RDPINPUT_INVALID_PDU pdu) { byte[] data = PduMarshaler.Marshal(pdu); //Sleep 100 millisecond to this packet to be merged with another packet in TCP channel. System.Threading.Thread.Sleep(100); rdpeiServer.RdpeiDVChannel.Send(data); }
public void Rdpei_TouchInputTest_Negative_InvalidEventIdInInitializingPhase() { Site.Log.Add(LogEntryKind.Debug, "Establishing RDP connection ..."); StartRDPConnection(); Site.Log.Add(LogEntryKind.Debug, "Creating dynamic virtual channels for MS-RDPEI ..."); bool bProtocolSupported = this.rdpeiServer.CreateRdpeiDvc(waitTime); TestSite.Assert.IsTrue(bProtocolSupported, "Client should support this protocol."); // RDPEI initializing phase Site.Log.Add(LogEntryKind.Debug, "Sending an invalid PDU."); RDPINPUT_INVALID_PDU invalidPdu = CreateRdpInputInvalidPdu(0xFFFF, 10, new byte[] { 0xFF, 0xFF, 0xFF, 0xFF }); SendRdpInvalidPdu(invalidPdu); RDPINPUT_CS_READY_PDU csReadyPdu = this.rdpeiServer.ExpectRdpInputCsReadyPdu(shortWaitTime); Site.Assert.IsNull(csReadyPdu, "The client should ignore the RDPINPUT_SC_READY_PDU message with invalid eventId."); }
public void Rdpei_TouchControlTest_Negative_InvalidResumePduLength() { Site.Log.Add(LogEntryKind.Debug, "Establishing RDP connection ..."); StartRDPConnection(); Site.Log.Add(LogEntryKind.Debug, "Creating dynamic virtual channels for MS-RDPEI ..."); bool bProtocolSupported = this.rdpeiServer.CreateRdpeiDvc(waitTime); TestSite.Assert.IsTrue(bProtocolSupported, "Client should support this protocol."); // RDPEI initializing phase Site.Log.Add(LogEntryKind.Debug, "Sending a RDPINPUT_SC_READY_PDU."); RDPINPUT_SC_READY_PDU scReadyPdu = this.rdpeiServer.CreateRdpInputScReadyPdu(); this.rdpeiServer.SendRdpInputScReadyPdu(scReadyPdu); Site.Log.Add(LogEntryKind.Debug, "Expecting RDPINPUT_CS_READY_PDU ..."); RDPINPUT_CS_READY_PDU csReadyPdu = this.rdpeiServer.ExpectRdpInputCsReadyPdu(waitTime); TestSite.Assert.IsTrue(csReadyPdu != null, "Client is expected to send RDPINPUT_CS_READY_PDU to the server."); // RDPEI running phase Site.Log.Add(LogEntryKind.Debug, "Sending a RDPINPUT_SUSPEND_TOUCH_PDU."); RDPINPUT_SUSPEND_TOUCH_PDU suspendPdu = this.rdpeiServer.CreateRdpInputSuspendTouchPdu(); this.rdpeiServer.SendRdpInputSuspendTouchPdu(suspendPdu); Site.Log.Add(LogEntryKind.Debug, "Sending a RDPINPUT_RESUME_TOUCH_PDU with invalid PduLength."); RDPINPUT_INVALID_PDU invalidPdu = CreateRdpInputInvalidPdu((ushort)EventId_Values.EVENTID_RESUME_TOUCH, 16, null); SendRdpInvalidPdu(invalidPdu); // Expect the client to ignore the RDPINPUT_RESUME_TOUCH_PDU with invalid pduLength. this.rdpeiSUTControlAdapter.TriggerContinuousTouchEventOnClient(this.TestContext.TestName); // Expect to reveice nothing. RDPINPUT_PDU pdu = this.rdpeiServer.ExpectRdpInputPdu(waitTime); TestSite.Assert.IsNull(pdu, "Client should ignore the RDPINPUT_RESUME_TOUCH_PDU message when the pduLength field is inconsistent with the amount of data read from DVC."); }
public void Rdpei_TouchControlTest_Negative_InvalidEventIdInRunningPhase() { Site.Log.Add(LogEntryKind.Debug, "Establishing RDP connection ..."); StartRDPConnection(); Site.Log.Add(LogEntryKind.Debug, "Creating dynamic virtual channels for MS-RDPEI ..."); bool bProtocolSupported = this.rdpeiServer.CreateRdpeiDvc(waitTime); TestSite.Assert.IsTrue(bProtocolSupported, "Client should support this protocol."); // RDPEI initializing phase Site.Log.Add(LogEntryKind.Debug, "Sending a RDPINPUT_SC_READY_PDU."); RDPINPUT_SC_READY_PDU scReadyPdu = this.rdpeiServer.CreateRdpInputScReadyPdu(); this.rdpeiServer.SendRdpInputScReadyPdu(scReadyPdu); Site.Log.Add(LogEntryKind.Debug, "Expecting RDPINPUT_CS_READY_PDU ..."); RDPINPUT_CS_READY_PDU csReadyPdu = this.rdpeiServer.ExpectRdpInputCsReadyPdu(waitTime); TestSite.Assert.IsNotNull(csReadyPdu, "Client is expected to send RDPINPUT_CS_READY_PDU to the server."); // RDPEI running phase Site.Log.Add(LogEntryKind.Debug, "Sending an invalid PDU."); RDPINPUT_INVALID_PDU invalidPdu = CreateRdpInputInvalidPdu(0xFFFF, 6, null); SendRdpInvalidPdu(invalidPdu); this.rdpeiSUTControlAdapter.TriggerOneTouchEventOnClient(this.TestContext.TestName); Site.Log.Add(LogEntryKind.Debug, "Expecting RDPINPUT_TOUCH_EVENT_PDU ..."); RDPINPUT_TOUCH_EVENT_PDU touchEventPdu = this.rdpeiServer.ExpectRdpInputTouchEventPdu(waitTime); VerifyRdpInputTouchEventPdu(touchEventPdu, true); if (isManagedAdapter) { RdpeiUtility.SendConfirmImage(); } }