driver B not able to read from the queue in driver A

Hi all, I am calling driver A’s write/read IOCTLs from my driver B synchronously.Driver A is asynchronous and as soon as it gets the event data from shared memory ,driver A queues it by creating its one buffer. I am able to send Write command successfully to driver A and it also give the data back in response(I am able to print the data). problem is when i am doing a Read i am not getting that in my buffer which actually i got from application using WdfMemoryGetBuffer in my driver B. I am not able to find out the exact reason what might be the issue. Any guess and suggestion to get hold of read data will be helpful.

NOTE: asynchronous call from driver B to driver A is in pipeline but as present i have to deliver code without much changes.

thanks,
AJ

You need to provide more details. The best way is to publish parts of the code which allocate buffers and send them to the other driver.

Igor Sharovar

For one thing, the description below does not match the subject line. The
subject line raises somany red flags that the only reasonable response to
that question is “This is a truly horrible idea!”. But you seem to be
asking a quite different question. What it appears is

"I have a lower level driver, A, and a driver that uses it, Driver B.
Driver B is (and here youdefine the relationship of A to B: for example,
driver B is a filter driver that sits above A, or A is something like
USBD, or a storport driver, and A implements some abstraction and needs
driver B to fulfill its mission, or…).

The lower-level driver has its own queue, and when it receives an IRP from
A, it marks it as pending, enqueues it, and returns STATUS_PENDING.

[I am uncertain why the concept of “shared memory” is felt to be relevant because all kernel memory is common to all drivers in the kernel]

During a write operation, there is no data to “give back” so I have no
idea what you mean here. Similarly, on a read operation, data willbe
placed in a buffer in accordane to the specifications of the IOCTL sent to
driver A; so you have to makr sure you have conformed to its interface
spec. Even if you show your code for driver B, nobody will know if it
conforms to Driver A unless you tell us what the spec is (note that if you
say “I am submitting an IOCTL_SUBMIT_URB to USBD” or some similar
well-documented driver, we really have to se the spec for that IOCTL to
your lower-level driver. [Note I am currently in a location where I no
access to my docs, and I’m reasonably certain I have mangled the name of
that IOCTL]

But without knowing the spec and seeing the code, you have asked the
question “My driver doesn’t work, what did I do wrong?” which is a really
hard question to answer.
joe

Hi all, I am calling driver A’s write/read IOCTLs from my driver B
synchronously.Driver A is asynchronous and as soon as it gets the event
data from shared memory ,driver A queues it by creating its one buffer. I
am able to send Write command successfully to driver A and it also give
the data back in response(I am able to print the data). problem is when i
am doing a Read i am not getting that in my buffer which actually i got
from application using WdfMemoryGetBuffer in my driver B. I am not able to
find out the exact reason what might be the issue. Any guess and
suggestion to get hold of read data will be helpful.

NOTE: asynchronous call from driver B to driver A is in pipeline but as
present i have to deliver code without much changes.

thanks,
AJ


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

My apologies!! Actually before posting i somehow knew that it is a bad way of asking questions…but i dint have any choice…in fact i typed and deleted many times. Code snippet can not help here as the code is huge and very much scattered ,so there is hard chance to co relate function calls. So i thought better i ask in a generic way whatever i was doing. Let me try to give you the code snippet if possible…coming soon… :slight_smile: .
thanks,
AJ

On 11/4/2011 6:11 AM, xxxxx@gmail.com wrote:

Actually before posting i somehow knew that it is a bad way of asking
questions…but i dint have any choice…

Having no choice is always bad! Please read:
http://catb.org/~esr/faqs/smart-questions.html
where Eric Raymond gives some useful tips on how to research problems
and formulate questions to get the maximum useful response.

If English language is your problem, this site can be very useful:
http://lang-8.org/ (a few days ago I started using it myself)

Hey…thanks a lot Hagen…First link is really helpful. I do not think
language is my problem though…it is just that i am new to device driver
field and i am here to learn from you guys…

thanks,
AJ

On Fri, Nov 4, 2011 at 12:34 PM, Hagen Patzke wrote:

> On 11/4/2011 6:11 AM, xxxxx@gmail.com wrote:
> > Actually before posting i somehow knew that it is a bad way of asking
> > questions…but i dint have any choice…
>
> Having no choice is always bad! Please read:
> http://catb.org/~esr/faqs/smart-questions.html
> where Eric Raymond gives some useful tips on how to research problems
> and formulate questions to get the maximum useful response.
>
> If English language is your problem, this site can be very useful:
> http://lang-8.org/ (a few days ago I started using it myself)
>
> —
> 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
>


Thanks and Regards,
Ajay Kumar