EvtIoInCallerContext callback: totally useless?

The documentation for EvtIoInCallerContext says it is called in the thread
context of the caller, at PASSIVE_LEVEL.

Being naturally skeptical of these conflicting claims, I tested it, and
found that, as one might expect, it is called in the thread context and at
the IRQL of the caller of IoCallDriver.

I can certainly deal with that–it’s obviously no different than the context
and IRQL for the dispatch routine in a WDM driver. The problem is that
WdfDeviceEnqueueRequest can only be called at PASSIVE_LEVEL. So when you
get a request in EvtIoInCallerContext at APC_LEVEL or DISPATCH_LEVEL, what
the heck are you supposed to do with it? It seems the only option is to
complete it, which naturally means your driver doesn’t work.

Thanks,

  • Dan.

What do you need to do in EvtIoInCallerContext that must be done at IRQL

PASSIVE_LEVEL? The point of this function is to probe and lock UM
buffers in the right context, all other processing can be done in the
arbitrary context of the WDFQUEUE. If you are getting I/O at APC or
dispatch level, that means a KM component is sending you the i/o, so no
probe/lock is required.

With that said, there was talk in the team of removing the IRQL
restriction on WdfDeviceEnqueueRequest, but that doesn’t help you now

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Dan Kyler
Sent: Wednesday, February 28, 2007 8:31 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] EvtIoInCallerContext callback: totally useless?

The documentation for EvtIoInCallerContext says it is called in the
thread
context of the caller, at PASSIVE_LEVEL.

Being naturally skeptical of these conflicting claims, I tested it, and
found that, as one might expect, it is called in the thread context and
at
the IRQL of the caller of IoCallDriver.

I can certainly deal with that–it’s obviously no different than the
context
and IRQL for the dispatch routine in a WDM driver. The problem is that
WdfDeviceEnqueueRequest can only be called at PASSIVE_LEVEL. So when
you
get a request in EvtIoInCallerContext at APC_LEVEL or DISPATCH_LEVEL,
what
the heck are you supposed to do with it? It seems the only option is to
complete it, which naturally means your driver doesn’t work.

Thanks,

  • Dan.

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

What is it in the application address space that you wanted to access at
DISPATCH_LEVEL?

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Dan Kyler
Sent: Wednesday, February 28, 2007 8:31 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] EvtIoInCallerContext callback: totally useless?

The documentation for EvtIoInCallerContext says it is called in the
thread
context of the caller, at PASSIVE_LEVEL.

Being naturally skeptical of these conflicting claims, I tested it, and
found that, as one might expect, it is called in the thread context and
at
the IRQL of the caller of IoCallDriver.

I can certainly deal with that–it’s obviously no different than the
context
and IRQL for the dispatch routine in a WDM driver. The problem is that
WdfDeviceEnqueueRequest can only be called at PASSIVE_LEVEL. So when
you
get a request in EvtIoInCallerContext at APC_LEVEL or DISPATCH_LEVEL,
what
the heck are you supposed to do with it? It seems the only option is to
complete it, which naturally means your driver doesn’t work.

Thanks,

  • Dan.

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

The only thing I need to do at greater than passive is queue the request.

If I have a single method neither ioctl that requires in-context processing,
than I must set the EvtIoInCallerContext for the device, and every request,
regardless of the current IRQL, is passed to it. I don’t need to preprocess
those requests, but now I’m stuck with them.

The problem is not with requests that I need to preprocess, but with the
requests I have no desire to see in this routine.

  • Dan.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Wednesday, February 28, 2007 10:13 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] EvtIoInCallerContext callback: totally useless?

What do you need to do in EvtIoInCallerContext that must be done at IRQL

PASSIVE_LEVEL? The point of this function is to probe and lock UM
buffers in the right context, all other processing can be done in the
arbitrary context of the WDFQUEUE. If you are getting I/O at APC or
dispatch level, that means a KM component is sending you the i/o, so no
probe/lock is required.

With that said, there was talk in the team of removing the IRQL restriction
on WdfDeviceEnqueueRequest, but that doesn’t help you now

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Dan Kyler
Sent: Wednesday, February 28, 2007 8:31 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] EvtIoInCallerContext callback: totally useless?

The documentation for EvtIoInCallerContext says it is called in the thread
context of the caller, at PASSIVE_LEVEL.

Being naturally skeptical of these conflicting claims, I tested it, and
found that, as one might expect, it is called in the thread context and at
the IRQL of the caller of IoCallDriver.

I can certainly deal with that–it’s obviously no different than the context
and IRQL for the dispatch routine in a WDM driver. The problem is that
WdfDeviceEnqueueRequest can only be called at PASSIVE_LEVEL. So when you
get a request in EvtIoInCallerContext at APC_LEVEL or DISPATCH_LEVEL, what
the heck are you supposed to do with it? It seems the only option is to
complete it, which naturally means your driver doesn’t work.

Thanks,

  • Dan.

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


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

>What is it in the application address space that you wanted to access at
DISPATCH_LEVEL?

Absolutely nothing.

The requests I need the callback for will always be at PASSIVE_LEVEL. But,
unless I’m missing something, EvtIoInCallerContext is called for ALL
requests sent to a device object. I can’t specify a particular major
function or ioctl code. But when the file system sends me a read at
APC_LEVEL, or another of my drivers sends me a read at DISPATCH_LEVEL (which
it actually does), there is no way to queue that request for processing.

  • Dan.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Peter Wieland
Sent: Wednesday, February 28, 2007 10:15 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] EvtIoInCallerContext callback: totally useless?

What is it in the application address space that you wanted to access at
DISPATCH_LEVEL?

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Dan Kyler
Sent: Wednesday, February 28, 2007 8:31 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] EvtIoInCallerContext callback: totally useless?

The documentation for EvtIoInCallerContext says it is called in the thread
context of the caller, at PASSIVE_LEVEL.

Being naturally skeptical of these conflicting claims, I tested it, and
found that, as one might expect, it is called in the thread context and at
the IRQL of the caller of IoCallDriver.

I can certainly deal with that–it’s obviously no different than the context
and IRQL for the dispatch routine in a WDM driver. The problem is that
WdfDeviceEnqueueRequest can only be called at PASSIVE_LEVEL. So when you
get a request in EvtIoInCallerContext at APC_LEVEL or DISPATCH_LEVEL, what
the heck are you supposed to do with it? It seems the only option is to
complete it, which naturally means your driver doesn’t work.

Thanks,

  • Dan.

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


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

This one we know about.

It will be fixed in a future version of the framework (1.7 == Vista SP1 is what I expect).

Related question:

If I set an EvtIoInCallerContext callback for the FDO of a bus driver, and
all my explicit accesses to that FDO are at PASSIVE_LEVEL, are there any
circumstances (Power, PNP, etc.) where my EvtIoInCallerContext callback
could be called at greater than PASSIVE_LEVEL?

If not, then I think I can get this to work.

  • Dan.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Wednesday, February 28, 2007 10:13 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] EvtIoInCallerContext callback: totally useless?

What do you need to do in EvtIoInCallerContext that must be done at IRQL

PASSIVE_LEVEL? The point of this function is to probe and lock UM
buffers in the right context, all other processing can be done in the
arbitrary context of the WDFQUEUE. If you are getting I/O at APC or
dispatch level, that means a KM component is sending you the i/o, so no
probe/lock is required.

With that said, there was talk in the team of removing the IRQL restriction
on WdfDeviceEnqueueRequest, but that doesn’t help you now

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Dan Kyler
Sent: Wednesday, February 28, 2007 8:31 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] EvtIoInCallerContext callback: totally useless?

The documentation for EvtIoInCallerContext says it is called in the thread
context of the caller, at PASSIVE_LEVEL.

Being naturally skeptical of these conflicting claims, I tested it, and
found that, as one might expect, it is called in the thread context and at
the IRQL of the caller of IoCallDriver.

I can certainly deal with that–it’s obviously no different than the context
and IRQL for the dispatch routine in a WDM driver. The problem is that
WdfDeviceEnqueueRequest can only be called at PASSIVE_LEVEL. So when you
get a request in EvtIoInCallerContext at APC_LEVEL or DISPATCH_LEVEL, what
the heck are you supposed to do with it? It seems the only option is to
complete it, which naturally means your driver doesn’t work.

Thanks,

  • Dan.

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


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

No, there aren’t. (And I’m the guy who found the bug you hit first.) The
original guy who layed out this work in WDF thought that drivers would
either handle requests from user-mode or kernel-mode but not both. So a
driver that might get requests at DISPATCH_LEVEL would never need this
callback. We’ve since “re-educated” him.

The only time you will ever get this callback invoked at elevated IRQL is
when another driver sends you the IRP. PnP and Power don’t go through this
path.

  • Jake Oshins
    Windows Kernel Team

“Dan Kyler” wrote in message news:xxxxx@ntdev…
> Related question:
>
> If I set an EvtIoInCallerContext callback for the FDO of a bus driver, and
> all my explicit accesses to that FDO are at PASSIVE_LEVEL, are there any
> circumstances (Power, PNP, etc.) where my EvtIoInCallerContext callback
> could be called at greater than PASSIVE_LEVEL?
>
> If not, then I think I can get this to work.
>
> - Dan.
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
> Sent: Wednesday, February 28, 2007 10:13 AM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] EvtIoInCallerContext callback: totally useless?
>
>
> What do you need to do in EvtIoInCallerContext that must be done at IRQL
>> PASSIVE_LEVEL? The point of this function is to probe and lock UM
> buffers in the right context, all other processing can be done in the
> arbitrary context of the WDFQUEUE. If you are getting I/O at APC or
> dispatch level, that means a KM component is sending you the i/o, so no
> probe/lock is required.
>
> With that said, there was talk in the team of removing the IRQL
> restriction
> on WdfDeviceEnqueueRequest, but that doesn’t help you now
>
> d
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Dan Kyler
> Sent: Wednesday, February 28, 2007 8:31 AM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] EvtIoInCallerContext callback: totally useless?
>
> The documentation for EvtIoInCallerContext says it is called in the thread
> context of the caller, at PASSIVE_LEVEL.
>
> Being naturally skeptical of these conflicting claims, I tested it, and
> found that, as one might expect, it is called in the thread context and at
> the IRQL of the caller of IoCallDriver.
>
> I can certainly deal with that–it’s obviously no different than the
> context
> and IRQL for the dispatch routine in a WDM driver. The problem is that
> WdfDeviceEnqueueRequest can only be called at PASSIVE_LEVEL. So when you
> get a request in EvtIoInCallerContext at APC_LEVEL or DISPATCH_LEVEL, what
> the heck are you supposed to do with it? It seems the only option is to
> complete it, which naturally means your driver doesn’t work.
>
> Thanks,
> - Dan.
>
>
> —
> 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
>
> —
> 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
>
>

EvtIoInCallerContext is only called for requests managed by a WDFQUEUE.
That means read/write/ioctl/internal ioctl. Pnp/power/wmi/etc do not
flow through this function

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Dan Kyler
Sent: Wednesday, February 28, 2007 10:06 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] EvtIoInCallerContext callback: totally useless?

Related question:

If I set an EvtIoInCallerContext callback for the FDO of a bus driver,
and
all my explicit accesses to that FDO are at PASSIVE_LEVEL, are there any
circumstances (Power, PNP, etc.) where my EvtIoInCallerContext callback
could be called at greater than PASSIVE_LEVEL?

If not, then I think I can get this to work.

  • Dan.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Wednesday, February 28, 2007 10:13 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] EvtIoInCallerContext callback: totally useless?

What do you need to do in EvtIoInCallerContext that must be done at IRQL

PASSIVE_LEVEL? The point of this function is to probe and lock UM
buffers in the right context, all other processing can be done in the
arbitrary context of the WDFQUEUE. If you are getting I/O at APC or
dispatch level, that means a KM component is sending you the i/o, so no
probe/lock is required.

With that said, there was talk in the team of removing the IRQL
restriction
on WdfDeviceEnqueueRequest, but that doesn’t help you now

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Dan Kyler
Sent: Wednesday, February 28, 2007 8:31 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] EvtIoInCallerContext callback: totally useless?

The documentation for EvtIoInCallerContext says it is called in the
thread
context of the caller, at PASSIVE_LEVEL.

Being naturally skeptical of these conflicting claims, I tested it, and
found that, as one might expect, it is called in the thread context and
at
the IRQL of the caller of IoCallDriver.

I can certainly deal with that–it’s obviously no different than the
context
and IRQL for the dispatch routine in a WDM driver. The problem is that
WdfDeviceEnqueueRequest can only be called at PASSIVE_LEVEL. So when
you
get a request in EvtIoInCallerContext at APC_LEVEL or DISPATCH_LEVEL,
what
the heck are you supposed to do with it? It seems the only option is to
complete it, which naturally means your driver doesn’t work.

Thanks,

  • Dan.

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


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


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

Even better…

Thanks,

  • Dan.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Wednesday, February 28, 2007 11:36 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] EvtIoInCallerContext callback: totally useless?

EvtIoInCallerContext is only called for requests managed by a WDFQUEUE. That
means read/write/ioctl/internal ioctl. Pnp/power/wmi/etc do not flow
through this function

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Dan Kyler
Sent: Wednesday, February 28, 2007 10:06 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] EvtIoInCallerContext callback: totally useless?

Related question:

If I set an EvtIoInCallerContext callback for the FDO of a bus driver, and
all my explicit accesses to that FDO are at PASSIVE_LEVEL, are there any
circumstances (Power, PNP, etc.) where my EvtIoInCallerContext callback
could be called at greater than PASSIVE_LEVEL?

If not, then I think I can get this to work.

  • Dan.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Wednesday, February 28, 2007 10:13 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] EvtIoInCallerContext callback: totally useless?

What do you need to do in EvtIoInCallerContext that must be done at IRQL

PASSIVE_LEVEL? The point of this function is to probe and lock UM
buffers in the right context, all other processing can be done in the
arbitrary context of the WDFQUEUE. If you are getting I/O at APC or
dispatch level, that means a KM component is sending you the i/o, so no
probe/lock is required.

With that said, there was talk in the team of removing the IRQL restriction
on WdfDeviceEnqueueRequest, but that doesn’t help you now

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Dan Kyler
Sent: Wednesday, February 28, 2007 8:31 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] EvtIoInCallerContext callback: totally useless?

The documentation for EvtIoInCallerContext says it is called in the thread
context of the caller, at PASSIVE_LEVEL.

Being naturally skeptical of these conflicting claims, I tested it, and
found that, as one might expect, it is called in the thread context and at
the IRQL of the caller of IoCallDriver.

I can certainly deal with that–it’s obviously no different than the context
and IRQL for the dispatch routine in a WDM driver. The problem is that
WdfDeviceEnqueueRequest can only be called at PASSIVE_LEVEL. So when you
get a request in EvtIoInCallerContext at APC_LEVEL or DISPATCH_LEVEL, what
the heck are you supposed to do with it? It seems the only option is to
complete it, which naturally means your driver doesn’t work.

Thanks,

  • Dan.

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


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


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


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, Jake. Sounds like I’ll be able to use it where I need to.

  • Dan.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Jake Oshins
Sent: Wednesday, February 28, 2007 11:27 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] EvtIoInCallerContext callback: totally useless?

No, there aren’t. (And I’m the guy who found the bug you hit first.) The
original guy who layed out this work in WDF thought that drivers would
either handle requests from user-mode or kernel-mode but not both. So a
driver that might get requests at DISPATCH_LEVEL would never need this
callback. We’ve since “re-educated” him.

The only time you will ever get this callback invoked at elevated IRQL is
when another driver sends you the IRP. PnP and Power don’t go through this
path.

  • Jake Oshins
    Windows Kernel Team

“Dan Kyler” wrote in message news:xxxxx@ntdev…
> Related question:
>
> If I set an EvtIoInCallerContext callback for the FDO of a bus driver,
> and all my explicit accesses to that FDO are at PASSIVE_LEVEL, are
> there any circumstances (Power, PNP, etc.) where my
> EvtIoInCallerContext callback could be called at greater than
> PASSIVE_LEVEL?
>
> If not, then I think I can get this to work.
>
> - Dan.
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
> Sent: Wednesday, February 28, 2007 10:13 AM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] EvtIoInCallerContext callback: totally useless?
>
>
> What do you need to do in EvtIoInCallerContext that must be done at
> IRQL
>> PASSIVE_LEVEL? The point of this function is to probe and lock UM
> buffers in the right context, all other processing can be done in the
> arbitrary context of the WDFQUEUE. If you are getting I/O at APC or
> dispatch level, that means a KM component is sending you the i/o, so
> no probe/lock is required.
>
> With that said, there was talk in the team of removing the IRQL
> restriction
> on WdfDeviceEnqueueRequest, but that doesn’t help you now
>
> d
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Dan Kyler
> Sent: Wednesday, February 28, 2007 8:31 AM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] EvtIoInCallerContext callback: totally useless?
>
> The documentation for EvtIoInCallerContext says it is called in the
> thread context of the caller, at PASSIVE_LEVEL.
>
> Being naturally skeptical of these conflicting claims, I tested it,
> and found that, as one might expect, it is called in the thread
> context and at the IRQL of the caller of IoCallDriver.
>
> I can certainly deal with that–it’s obviously no different than the
> context
> and IRQL for the dispatch routine in a WDM driver. The problem is that
> WdfDeviceEnqueueRequest can only be called at PASSIVE_LEVEL. So when you
> get a request in EvtIoInCallerContext at APC_LEVEL or DISPATCH_LEVEL, what
> the heck are you supposed to do with it? It seems the only option is to
> complete it, which naturally means your driver doesn’t work.
>
> Thanks,
> - Dan.
>
>
> —
> 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
>
> —
> 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
>
>


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

And to complete this thread…

It appears that WdfDeviceInitAssignWdmIrpPreprocessCallback can be used to
the same effect without the arbitrary IRQL restrictions.

I find something new in Kmdf every day :slight_smile:

  • Dan.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Dan Kyler
Sent: Wednesday, February 28, 2007 11:44 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] EvtIoInCallerContext callback: totally useless?

Even better…

Thanks,

  • Dan.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Wednesday, February 28, 2007 11:36 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] EvtIoInCallerContext callback: totally useless?

EvtIoInCallerContext is only called for requests managed by a WDFQUEUE. That
means read/write/ioctl/internal ioctl. Pnp/power/wmi/etc do not flow
through this function

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Dan Kyler
Sent: Wednesday, February 28, 2007 10:06 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] EvtIoInCallerContext callback: totally useless?

Related question:

If I set an EvtIoInCallerContext callback for the FDO of a bus driver, and
all my explicit accesses to that FDO are at PASSIVE_LEVEL, are there any
circumstances (Power, PNP, etc.) where my EvtIoInCallerContext callback
could be called at greater than PASSIVE_LEVEL?

If not, then I think I can get this to work.

  • Dan.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Wednesday, February 28, 2007 10:13 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] EvtIoInCallerContext callback: totally useless?

What do you need to do in EvtIoInCallerContext that must be done at IRQL

PASSIVE_LEVEL? The point of this function is to probe and lock UM
buffers in the right context, all other processing can be done in the
arbitrary context of the WDFQUEUE. If you are getting I/O at APC or
dispatch level, that means a KM component is sending you the i/o, so no
probe/lock is required.

With that said, there was talk in the team of removing the IRQL restriction
on WdfDeviceEnqueueRequest, but that doesn’t help you now

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Dan Kyler
Sent: Wednesday, February 28, 2007 8:31 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] EvtIoInCallerContext callback: totally useless?

The documentation for EvtIoInCallerContext says it is called in the thread
context of the caller, at PASSIVE_LEVEL.

Being naturally skeptical of these conflicting claims, I tested it, and
found that, as one might expect, it is called in the thread context and at
the IRQL of the caller of IoCallDriver.

I can certainly deal with that–it’s obviously no different than the context
and IRQL for the dispatch routine in a WDM driver. The problem is that
WdfDeviceEnqueueRequest can only be called at PASSIVE_LEVEL. So when you
get a request in EvtIoInCallerContext at APC_LEVEL or DISPATCH_LEVEL, what
the heck are you supposed to do with it? It seems the only option is to
complete it, which naturally means your driver doesn’t work.

Thanks,

  • Dan.

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


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


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


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


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

The thing with the WDM IRP preprocess callback is that you don’t get a
WDFREQUEST, only a PIRP. If you need to probe/lock memory via a
WDFMEMORY, there is no place to cleanly hang the WDFMEMORY off of. if
you need this for some other purpose, it is probably the function for
you.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Dan Kyler
Sent: Wednesday, February 28, 2007 10:58 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] EvtIoInCallerContext callback: totally useless?

And to complete this thread…

It appears that WdfDeviceInitAssignWdmIrpPreprocessCallback can be used
to
the same effect without the arbitrary IRQL restrictions.

I find something new in Kmdf every day :slight_smile:

  • Dan.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Dan Kyler
Sent: Wednesday, February 28, 2007 11:44 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] EvtIoInCallerContext callback: totally useless?

Even better…

Thanks,

  • Dan.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Wednesday, February 28, 2007 11:36 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] EvtIoInCallerContext callback: totally useless?

EvtIoInCallerContext is only called for requests managed by a WDFQUEUE.
That
means read/write/ioctl/internal ioctl. Pnp/power/wmi/etc do not flow
through this function

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Dan Kyler
Sent: Wednesday, February 28, 2007 10:06 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] EvtIoInCallerContext callback: totally useless?

Related question:

If I set an EvtIoInCallerContext callback for the FDO of a bus driver,
and
all my explicit accesses to that FDO are at PASSIVE_LEVEL, are there any
circumstances (Power, PNP, etc.) where my EvtIoInCallerContext callback
could be called at greater than PASSIVE_LEVEL?

If not, then I think I can get this to work.

  • Dan.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Wednesday, February 28, 2007 10:13 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] EvtIoInCallerContext callback: totally useless?

What do you need to do in EvtIoInCallerContext that must be done at IRQL

PASSIVE_LEVEL? The point of this function is to probe and lock UM
buffers in the right context, all other processing can be done in the
arbitrary context of the WDFQUEUE. If you are getting I/O at APC or
dispatch level, that means a KM component is sending you the i/o, so no
probe/lock is required.

With that said, there was talk in the team of removing the IRQL
restriction
on WdfDeviceEnqueueRequest, but that doesn’t help you now

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Dan Kyler
Sent: Wednesday, February 28, 2007 8:31 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] EvtIoInCallerContext callback: totally useless?

The documentation for EvtIoInCallerContext says it is called in the
thread
context of the caller, at PASSIVE_LEVEL.

Being naturally skeptical of these conflicting claims, I tested it, and
found that, as one might expect, it is called in the thread context and
at
the IRQL of the caller of IoCallDriver.

I can certainly deal with that–it’s obviously no different than the
context
and IRQL for the dispatch routine in a WDM driver. The problem is that
WdfDeviceEnqueueRequest can only be called at PASSIVE_LEVEL. So when
you
get a request in EvtIoInCallerContext at APC_LEVEL or DISPATCH_LEVEL,
what
the heck are you supposed to do with it? It seems the only option is to
complete it, which naturally means your driver doesn’t work.

Thanks,

  • Dan.

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


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


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


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


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


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