Question about MouseClassServiceCallback

Hello,

this will probably sound like a stupid question, but why does MouseClassServiceCallback take four arguments… wouldn’t three suffice?

I’m obviously talking about InputDataEnd and InputDataConsumed, because one of them is dispensable, in my opinion.

Furthermore, how should my filter walk through the mouse packets?

Thanks.

I find it a bit amusing that you question the parameters of a function
without understanding how to use those parameters in the first place ;).
InputDataEnd is one past the end of the array and is an __in parameter,
while InputDataConsumed is an __out parameter. InputDataEnd is for the
service callback function to know the end of the array (essentially how
many packets are being reported), whiel INputDataConsumed is for the
driver which is calling the service callback function so that it knows
upon return how many packets in the array were consumed so that it can
free up those packets for reuse later.

How do you walk through the array? Something like this

ULONG count = 0;

for ( ; InputDataBegin < InputDataEnd; count++, InputDataBegin++) {
// InputDataBegin is the current packet in the list, do with it
what you want. If you are selectively not consuming
// packets, you would move the increment of count outside of the
for() statement
}

*InputDataConsumed = count;

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@hushmail.com
Sent: Wednesday, June 13, 2007 4:44 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Question about MouseClassServiceCallback

Hello,

this will probably sound like a stupid question, but why does
MouseClassServiceCallback take four arguments… wouldn’t three suffice?

I’m obviously talking about InputDataEnd and InputDataConsumed, because
one of them is dispensable, in my opinion.

Furthermore, how should my filter walk through the mouse packets?

Thanks.


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

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Thanks for your answer; I have misunderstood InputDataConsumed’s purpose.

Just to clarify it:
The function driver has an internal MOUSE_INPUT_DATA buffer and transfers that array (InputDataStart, InputDataEnd) to filter and class drivers via the service callback routine.
These drivers process the packets and report InputDataConsumed back to the function driver, which then clears the buffer accordingly.

Is everything right?

Yup. That is how it works.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@hushmail.com
Sent: Wednesday, June 13, 2007 11:14 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Question about MouseClassServiceCallback

Thanks for your answer; I have misunderstood InputDataConsumed’s
purpose.

Just to clarify it:
The function driver has an internal MOUSE_INPUT_DATA buffer and
transfers that array (InputDataStart, InputDataEnd) to filter and class
drivers via the service callback routine.
These drivers process the packets and report InputDataConsumed back to
the function driver, which then clears the buffer accordingly.

Is everything right?


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

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer