The collection object itself is NP, just the string buffers are paged. WDFSTRING is not a generalized srtring class (note there is no cat, compare, etc), it solves one small design problem controlling the lifetime of a string alloc’ed by kmdf and giving you a way to free it. Outside of that purpose which suites the vast majority, you will need to roll your own whatever it is you need
d
Sent from my phone with no t9, all spilling mistakes are not intentional.
-----Original Message-----
From: Mark Roddy
Sent: Friday, August 07, 2009 8:08 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] type of memory allocated for WdfRegistryQueryMultiString
The use case is clear. One initializes the collection of strings at
passive level but then need to access them subsequently at dispatch
level. The collection needs to be dispatch level safe. Perhaps it is
just a doc issue, but for the WDM and earlier apis, the Rtl docs make
it clear that the returned strings if allocated by the interface are
allocated from paged pool, the WDF docs obscure this information, thus
causing James to have his problem.
Mark Roddy
On Fri, Aug 7, 2009 at 10:00 AM, Doron Holan wrote:
> Yes the underlying class that supports the handle is NP. For additional memory allocations such as for WDFSTRING or a pageable WDFMEMORY buffer, they can come from pagable pool. The buffer in WDFSTRING is always pagable, this follow the pattern of Rtl and since nearly all supporting string APIs are passive lvel only, it does not make much sense to put the string buffers in NP pool.
>
> Mark, the execution level only dictates callbacks (and even then really only callbacks on queues). If it were set to dispatch, what api would you use to create the string inf the first place? Again all of them require passive…
>
> d
>
> Sent from my phone with no t9, all spilling mistakes are not intentional.
>
> -----Original Message-----
> From: David R. Cattley
> Sent: Friday, August 07, 2009 6:48 AM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] type of memory allocated for WdfRegistryQueryMultiString
>
>
> AFAIK, the FxObject is not paged but the memory allocated to hold the string
> might be. FxObject(s) with dispatch level execution contracts end up
> having spinlocks to protect the internal context. They would all be NP. My
> experience so far is that I have not seen an actual WDF Object itself be
> allocated from NP pool but that might just be because I have not hit the
> case it makes sense yet.
>
> I think, however, that all of the memory that defines framework context
> (FxObject) and allocations for the ‘association’ objects in the collection
> that store the reference to the ‘collected’ objects, along with the
> framework context of each collected object, is entirely in NP memory and
> thus traversable/accesable at elevated IRQL.
>
> Consider that WdfObjectDelete() is callable at DISPATCH_LEVEL. That would
> pretty much mean an object, no matter what, cannot have the FxObject in
> paged pool.
>
> So I think Jame’s issue is that the backing pool for the string data itself
> is in NPPool, not the remaining goobledygook of the FxObjects, etc.
>
> Cheers,
> Dave Cattley
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Mark Roddy
> Sent: Friday, August 07, 2009 8:58 AM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] type of memory allocated for
> WdfRegistryQueryMultiString
>
> I am not an expert on WDF, but it would not make a lot of sense to
> have the objects collected be pageable while the callbacks that
> process those objects are executing at dispatch level. Perhaps when
> Doron or one of the other devs for WDF wake up they will illumninate
> us.
>
> Mark Roddy
>
>
>
> On Fri, Aug 7, 2009 at 7:54 AM, James
> Harper wrote:
>>>
>>> If the execution level of the collection object is set to
>>> WdfExecutionLevelDispatch shouldn’t all of its collected objects also
>>> be appropriate to dispatch level operations?
>>>
>>
>> I started chasing that down in the docs too, but it says of
>> “WDF_OBJECT_ATTRIBUTES”:
>>
>> “specifies the maximum IRQL at which the framework will call the
>> object’s event callback functions”
>> And
>> “By default, the framework sets the ExecutionLevel value of framework
>> driver objects to WdfExecutionLevelDispatch”
>>
>> So I think it only relates to the callback functions, and is set to
>> Dispatch by default anyway.
>>
>> James
>>
>>
>>
>>
>> —
>> 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
>>
>
> —
> 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
>
>
> —
> 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
>
>
> —
> 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
>
—
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