Re: How do I create a custom packet?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Thanks Maxim. I am not clear at the part where I fill the packet with
data. First of all do I just create a packet of type NDIS_PACKET? If
so, then how do I fill it with my data that is in a structure that I
have created?

Maxim S. Shatskih wrote:
Allocate the nonpaged memory
Fill it with data, do not forget to fill the Ethernet header
call NdisAllocateBuffer to create the descriptor which will describe this
memory
call NdisAllocatePacket to create NDIS_PACKET
call NdisChainBufferAtFront to attach the descriptor to the packet
call NdisSend
if it returned something other then "pending" - call your own
ProtocolSendComplete yourself inline

The ProtocolSendComplete handler must free the NDIS_BUFFER descriptor,
NDIS_PACKET and also the memory chunk.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@xxxxxxxxxxxxxxxx
http://www.storagecraft.com

<rohanm79@xxxxxxxxx> wrote in message
news:1156356381.142930.60120@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi all. I am new to windows driver programming and I am interested in
NDIS programming. I would like to know how to create a custom packet
using NDIS for sending a UDP message. If anybody could show some code
as to how to create custom packets it would be much appreciated.
Thanks.


.



Relevant Pages

  • Re: NDIS functionality details
    ... > In adapter driver talking to underlying software - the so-called ... >> actually copy data from source packet to destination packet or it just ... > Maxim Shatskih, Windows DDK MVP ...
    (microsoft.public.development.device.drivers)
  • Re: Problem Modifing the NDIS packet
    ... > If i do not change anything in my packet(packet and buffer allocated by ... > I am modifing the received packet as well. ... > I am facing the problem only when i am modifing the send packet. ... >> Maxim Shatskih, Windows DDK MVP ...
    (microsoft.public.development.device.drivers)
  • Whats in linux1394-2.6.git? - drivers/firewire queue
    ... commit e1d65076dd7009a35a83b408e8095597a243c447 ... the fw-ohci driver used fixed-length buffers for storing ... struct descriptor *last); ... Fix extraction of the source node id from the packet header. ...
    (Linux-Kernel)
  • Re: Device enumeration fails
    ... CE host was acting though... ... correctly to the descriptor request. ... packet. ... It got 32 and would try to handshake, ...
    (microsoft.public.windowsce.platbuilder)
  • Re: rndis for image downloading
    ... IN:first 16 bytes of descriptor ... premature ack, host issuses a reset. ... you only need to send an empty packet as last packet if the ... > suspend interrupt ...
    (microsoft.public.windowsce.platbuilder)