wsksendTo issue

Hi ,
I am using WSK socket in my driver to send UDP packets out. I use an array of IRPs. The packets are sent out using IRP’s from array, very fast. I dont wait for the completion routine to get called. Completion routine puts the IRPs back to array for reuse. Due to some reason the send completion routine does not get called. I can see the packets going out in wireshark. After some time the IRPs all get used up. Now since there are lot of outstanding sends , I will not be able to close the socket also.
I want to debug ,
where are the packets stuck?
How I will cancel the outstanding sends?
Can I call wsksocketclose now?

Plz help.

Regards,
Subhash

Do you check the return status form WskSendTo?

For many kernel network functions the completion routine will not be called
unless STATUS_PENDING is returned from the call.

Add code that checks for STATUS_PENDING after calling WskSendTo. If the
return code is not STATUS_PENDING, call you completion routine yourself so
it can free or re-use your buffer and IRP.

Thomas F. Divine
htto://www.pcausa.com


From:
Sent: Wednesday, April 06, 2011 10:57 AM
To: “Windows System Software Devs Interest List”
Subject: [ntdev] wsksendTo issue

> Hi ,
> I am using WSK socket in my driver to send UDP packets out. I use an
> array of IRPs. The packets are sent out using IRP’s from array, very fast.
> I dont wait for the completion routine to get called. Completion routine
> puts the IRPs back to array for reuse. Due to some reason the send
> completion routine does not get called. I can see the packets going out in
> wireshark. After some time the IRPs all get used up. Now since there are
> lot of outstanding sends , I will not be able to close the socket also.
> I want to debug ,
> where are the packets stuck?
> How I will cancel the outstanding sends?
> Can I call wsksocketclose now?
>
> Plz help.
>
> Regards,
> Subhash
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer

Hi,
Thanks for the reply.
The Return value from WskSendTo os 0x103 (STATUS_PENDING). This is always the case. (Even when it works . )

The scenario is

My laptop is a station, which sends packets to AP over wireless. I keep on sending packets through
WSK socket. Then, the AP is switched off. Stop WskSendTo. No outstanding sends till now. (All completion routne called.) AP started again. Wireless connection established. I can ping the AP. Resume WSKSendTo. Now the WskSendTo goes pending and the call backs will not get called.

Why WSKSendTo does not work?
Why the wireshark shows the packet as going out?
Can we cansel the sends, which is pending, so that I can call wskclosesocket?

Looking forward for your reply.

Thanks,
Subhash

Hi,
What will happen if WskSendTo goes pending? Is there any way out, other than waiting for the completion routine?

Regards,
Subhash