KMDF EvtIo callback question

Hi, Doron and others,
Can we safely assume that KMDF library will assure all of my EvtIo
callback routine will be invoked at PASSIVEL_LEVEL? What I mean is
whether it is safe to send WDFREQUEST synchronously to the WDFTARGET in
EvtIo callback under all situations?
I suspect we needn’t care about IRQL semantics in KDMF library since the
docs doesn’t mention it at most circumstances and we can’t distinguish
which callback will be called at PASSIVE_LEVEL, which will be at DPC_LEVEL.
IMHO, the hardest part of learning KMDF is to try to make it clear that
what work KMDF could do for you, and what it cannot. Hope Microsoft
could throw more light on this aspect.I really understand why source
code is an critical part for the framework to help us learn how to deal
with it. :slight_smile:


Best Regards,
hanzhu

Are you a filter in a stack ? are you writing a FDO for an already
defined stack? or are you writing your own driver for you own type of
device which windows does not have a class for? The answer to each of
these changes my answer.

First off, yes KMDF *CAN* guarantee passive IRQL when calling EvtIoXxx.
The question is, do you want to enable that feature.

For instance, if you are a filter in a storage stack, you most
definitely should *NOT* enable that feature since you could cause a
deadlock. If you are writing a serial port driver (an already defined
stack), you can enable the feature and get away with it, but perf will
hurt a lot. If you writing a driver for your own device for which there
is no class, you can easily do it, but then again, no one will be
sending you I/O higher the PASSIVE_LEVEL anyways unless some other
kernel component knows about your device…

…to enable passive level guarantees you set the ExecutionLevel field
in WDF_OBJECT_ATTRIBUTES to WdfExecutionLevelPassive. See src\kmdf\
toaster\func\featured\toaster.c for an example.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of hanzhu
Sent: Sunday, June 11, 2006 4:47 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] KMDF EvtIo callback question

Hi, Doron and others,
Can we safely assume that KMDF library will assure all of my EvtIo
callback routine will be invoked at PASSIVEL_LEVEL? What I mean is
whether it is safe to send WDFREQUEST synchronously to the WDFTARGET in
EvtIo callback under all situations?
I suspect we needn’t care about IRQL semantics in KDMF library since the

docs doesn’t mention it at most circumstances and we can’t distinguish
which callback will be called at PASSIVE_LEVEL, which will be at
DPC_LEVEL.
IMHO, the hardest part of learning KMDF is to try to make it clear that
what work KMDF could do for you, and what it cannot. Hope Microsoft
could throw more light on this aspect.I really understand why source
code is an critical part for the framework to help us learn how to deal
with it. :slight_smile:


Best Regards,
hanzhu


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

Doron,
Thanks a lot for your hints.
I misread the docs yesterday, so I ask such a silly question. :slight_smile:
For these callbacks which forced to run at PASSIVE_LEVEL, does KMDF
insert some workitems to achieve such goals?


Best Regards,
hanzhu

Doron Holan дµÀ:

Are you a filter in a stack ? are you writing a FDO for an already
defined stack? or are you writing your own driver for you own type of
device which windows does not have a class for? The answer to each of
these changes my answer.

First off, yes KMDF *CAN* guarantee passive IRQL when calling EvtIoXxx.
The question is, do you want to enable that feature.

For instance, if you are a filter in a storage stack, you most
definitely should *NOT* enable that feature since you could cause a
deadlock. If you are writing a serial port driver (an already defined
stack), you can enable the feature and get away with it, but perf will
hurt a lot. If you writing a driver for your own device for which there
is no class, you can easily do it, but then again, no one will be
sending you I/O higher the PASSIVE_LEVEL anyways unless some other
kernel component knows about your device…

…to enable passive level guarantees you set the ExecutionLevel field
in WDF_OBJECT_ATTRIBUTES to WdfExecutionLevelPassive. See src\kmdf\
toaster\func\featured\toaster.c for an example.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of hanzhu
Sent: Sunday, June 11, 2006 4:47 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] KMDF EvtIo callback question

Hi, Doron and others,
Can we safely assume that KMDF library will assure all of my EvtIo
callback routine will be invoked at PASSIVEL_LEVEL? What I mean is
whether it is safe to send WDFREQUEST synchronously to the WDFTARGET in
EvtIo callback under all situations?
I suspect we needn’t care about IRQL semantics in KDMF library since the

docs doesn’t mention it at most circumstances and we can’t distinguish
which callback will be called at PASSIVE_LEVEL, which will be at
DPC_LEVEL.
IMHO, the hardest part of learning KMDF is to try to make it clear that
what work KMDF could do for you, and what it cannot. Hope Microsoft
could throw more light on this aspect.I really understand why source
code is an critical part for the framework to help us learn how to deal
with it. :slight_smile: