Author: tkreuzer Date: Mon Jan 19 21:17:31 2009 New Revision: 38967
URL: http://svn.reactos.org/svn/reactos?rev=38967&view=rev Log: kdcom: partly handle control packets, now we resend our data on reset packets, but WinDbg still doesn't like them.
Modified: branches/ros-amd64-bringup/reactos/drivers/base/kdcom/i386/kdbg.c
Modified: branches/ros-amd64-bringup/reactos/drivers/base/kdcom/i386/kdbg.c URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/driver... ============================================================================== --- branches/ros-amd64-bringup/reactos/drivers/base/kdcom/i386/kdbg.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/drivers/base/kdcom/i386/kdbg.c [iso-8859-1] Mon Jan 19 21:17:31 2009 @@ -878,9 +878,9 @@
/* Step 3 - Read ByteCount */ RcvCode = KdpReceiveBuffer(&Packet.ByteCount, sizeof(USHORT)); - if (RcvCode != KdPacketReceived) - { - /* Didn't receive ByteCount. Start over. */ + if (RcvCode != KdPacketReceived || Packet.ByteCount > PACKET_MAX_SIZE) + { + /* Didn't receive ByteCount or it's too big. Start over. */ continue; }
@@ -913,6 +913,30 @@
FrLdrDbgPrint("KdReceivePacket 5, Checksum == 0x%x\n", Packet.Checksum);
+ /* Step 6 - Handle control packets */ + if (Packet.PacketLeader == CONTROL_PACKET_LEADER) + { + switch (Packet.PacketType) + { + case PACKET_TYPE_KD_ACKNOWLEDGE: + /* Remote acknowledges the last packet */ + return KdPacketReceived; + + case PACKET_TYPE_KD_RESEND: + /* Remote wants us to resend the last packet */ + return KdPacketNeedsResend; + + case PACKET_TYPE_KD_RESET: + FrLdrDbgPrint("KdReceivePacket - got a reset packet\n"); + // FIXME + return KdPacketNeedsResend; + + default: + FrLdrDbgPrint("KdReceivePacket - got unknown control packet\n"); + return KdPacketNeedsResend; + } + } +
}