Re: Callback Driver !

MessageHello Everybody,

Issue 1:

I wanted to pass some information from driver to
upper level of application. Pl guide me how call back
routines helps in this case.
pl give some links where I will find this information.

Issue 2 : (Observed under Win-98)

In my Driver I allocate Huge memory in terms of pages.
At some instance, while allocating pages, If due to some
reason, page fault occurs my application gets terminated.
(illegal operation/blue screen)
I have already taken care to leave free pages for system
(1000 pages)
Every time my call of getting free pages from system returns
different number of pages ??? (strange thing ???)

* This problem is not observed if free pages increased substantially.
If this is the case, how come we can decide free pages for system.

Pl. focus on the topic.

Thanks in advance.

Tushar Samnerkar
NitAl Computer,Pune


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

MessageOn Friday, May 11, 2001 5:04 AM “Tushar Samnerkar” wrote:

Hello Everybody,

Issue 1:
I wanted to pass some information from driver to
upper level of application. Pl guide me how call back
routines helps in this case.
pl give some links where I will find this information.

Simplest approach (not using callback routines):
-At user level, allocate a buffer large enough to hold the information,
then pass the driver a pointer to that buffer, via DeviceIoControl()
call;
-At driver level copy the information to the buffer (using
RtlCopyMemory(),
for e.g.) on the Device Control dispatcher.
Links: Read the DDK documentation.

Issue 2 : (Observed under Win-98)
In my Driver I allocate Huge memory in terms of pages.
At some instance, while allocating pages, If due to some
reason, page fault occurs my application gets terminated.
(illegal operation/blue screen)

Not very user-friendly… Do not release your driver like that.

I have already taken care to leave free pages for system
(1000 pages)

That’s about 4Mb. Might not be enough (suppose a 128Mb system…)

Every time my call of getting free pages from system returns
different number of pages ??? (strange thing ???)

* This problem is not observed if free pages increased substantially.
If this is the case, how come we can decide free pages for system.

You’re a bit confused, my friend: you’re looking at the problem
sideways.
You should allocate ONLY the memory YOU need; leave the system
alone. As to the “strange behaviour” you mention, could be a lot of
things:
system does not always return what you expect because sometimes
memory is being paged-out :slight_smile: ; also, you could have a bug on your
code…

Hope being kept focused on topic… :slight_smile:

Miguel Monteiro
xxxxx@criticalsoftware.com
www.criticalsoftware.com

«Humour and love are God’s answers
to Human weaknesses»


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Tushar,
Reg Issue1.
From my experience there is nothing of this sort I
mean call back functions from drivers( Kernel/rin0) to
user/reng3 levels. We have what is called Asynchronous
notifications from driver to Apps that can meet ur
requirement.
In ur app if u want to do some processing after
requesting the driver to do a work addigenment, u can do
this by using Asynchronous APIs.
For example u opened the driver (create file) abd then
either u will be using read/write APIs or deviceio APIs
to communicate with the driver. These WIN APIs have got
a parameter in them called OverLapped object. this can
one of Synchronisation object(Like event Object). The
calling thead in the APP can wait synchronously for
completion of request in driver. If u want to wait
asynchronously in APP u can do this also by launching
the thread in the APP and in the thread u can wait for
the completion.
U can refer to these APIs for programming details:
CreateFile, Read/WriteFile, DeviceIoControl,
GetoverlappedObject, Waiforsingle/miltipleObjects.

U can also use Eventobject to communicate between from
driver to APP by creating it the app (named object) and
using it in the driver.

I hope this is what U r looking for.


Girish H.

MessageHello Everybody,

Issue 1:

I wanted to pass some information from driver to
upper level of application. Pl guide me how call back
routines helps in this case.
pl give some links where I will find this information.

Issue 2 : (Observed under Win-98)

In my Driver I allocate Huge memory in terms of pages.
At some instance, while allocating pages, If due to some
reason, page fault occurs my application gets terminated.
(illegal operation/blue screen)
I have already taken care to leave free pages for system
(1000 pages)
Every time my call of getting free pages from system returns
different number of pages ??? (strange thing ???)

* This problem is not observed if free pages increased substantially.
If this is the case, how come we can decide free pages for system.

Pl. focus on the topic.

Thanks in advance.

Tushar Samnerkar
NitAl Computer,Pune


You are currently subscribed to ntdev as: xxxxx@att.net
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com