VOID ParaNdis_PadPacketToMinimalLength(PNET_PACKET_INFO packetInfo)
{
    // Ethernet standard declares minimal possible packet size
    // Packets smaller than that must be padded before transfer
    // Ethernet HW pads packets on transmit, however in our case
    // some packets do not travel over Ethernet but being routed
    // guest-to-guest by virtual switch.
    // In this case padding is not performed and we may
    // receive packet smaller than minimal allowed size. This is not
    // a problem for real life scenarios however WHQL/HCK contains
    // tests that check padding of received packets.
    // To make these tests happy we have to pad small packets on receive

    //NOTE: This function assumes that VLAN header has been already stripped out

    if(packetInfo->dataLength < ETH_MIN_PACKET_SIZE)
    {
        RtlZeroMemory(
                        RtlOffsetToPointer(packetInfo->headersBuffer, packetInfo->dataLength),
                        ETH_MIN_PACKET_SIZE - packetInfo->dataLength);
        packetInfo->dataLength = ETH_MIN_PACKET_SIZE;
    }
}
VOID ParaNdis_PadPacketToMinimalLength(PNET_PACKET_INFO packetInfo)
{
     
     
     
     
     
     
     
     
     
     

     

    if(packetInfo->dataLength < ETH_MIN_PACKET_SIZE)
    {
        RtlZeroMemory(
                        RtlOffsetToPointer(packetInfo->headersBuffer, packetInfo->dataLength),
                        ETH_MIN_PACKET_SIZE - packetInfo->dataLength);
        packetInfo->dataLength = ETH_MIN_PACKET_SIZE;
    }
}