a problem with clienteventreceive handler

Hi All.
I have a problem trying to get the remainder of the tsdu in
clienteventreceive handler when bytesindicated<bytesavailable.i allocated irp with tdibuildinternaldevicecontrolirp to make a request for the remainder tsdu may be this is wrong way cause it works at passive_level only always receive run dispatch_level but how can i allocate goal.may there another avoid problem.>can anybody help me? thanks to all.</bytesavailable.i>

> I have a problem trying to get the remainder of the tsdu in

clienteventreceive handler when bytesindicated<bytesavailable.i allocated>irp with
TdiBuildInternalDeviceControlIrp to make a request for the remainder tsdu, may
be this is the
wrong way cause it works at passive_level only(almost always, receive run at
dispatch_level),
but how can i allocate irp for this goal.

TdiBuildInternalDeviceControlIrp is a macro around
IoBuildDeviceIoControlRequest.
Use IoAllocateIrp, and fill the IOCTL stack location properly.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com</bytesavailable.i>

You can do one of two things.

  1. Either return STATUS_SUCCESS with *IoRequestPacket set to NULL and *BytesTaken as BytesIndicated.
    This would make the ClientEventReceive handler to be called again.
  2. Allocate the IRP as Max suggested. But i believe you need to call IoSetNextIrpStackLocation before returning Status. otherwise your StackLocation would be pointing to invalid stack location.

Max: This is what i see atleast in ClientEventConnect handler. Do you need to set the StackLocation or not?

-Srin.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Dolgopolov Alex
Sent: Monday, September 15, 2003 9:07 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] a problem with clienteventreceive handler

Hi All.
I have a problem trying to get the remainder of the tsdu in
clienteventreceive handler when bytesindicated<bytesavailable.i allocated irp with tdibuildinternaldevicecontrolirp to make a request for the remainder tsdu may be this is wrong way cause it works at passive_level only always receive run dispatch_level but how can i allocate goal.may there another avoid problem.>can anybody help me? thanks to all.


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@nai.com
To unsubscribe send a blank email to xxxxx@lists.osr.com</bytesavailable.i>

> 2. Allocate the IRP as Max suggested. But i believe you need to call
IoSetNextIrpStackLocation before returning Status. otherwise your StackLocation
would be
pointing to invalid stack location.

Max: This is what i see atleast in ClientEventConnect handler. Do you need to
set the
StackLocation or not?

Yes.
IoSetNextIrpStackLocation is mandatory for both Connect and Receive event
handlers.

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