Re: Something else related to work item.



you must not be looking very hard

C:\WINDDK\WDF\KMDF10\src\kmdf>findstr /s
WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE *
1394\driver\pnp.c:
WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&fdoAttributes, DE
VICE_EXTENSION);
AMCC5933\sys\AMCC5933.c:
WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&fdoAttributes,
AMCC_DEVICE_EXTENSION);
[...]

WDF_OBJECT_ATTRIBUTES_SET_CONTEXT_TYPE() was created before
INIT_CONTEXT_TYPE existed. It is still there so that existing samples that
were written before the new INIT call still work.

yes, you cannot control the queue type. the DDK says "Drivers must specify
DelayedWorkQueue."

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"KMDF_FW" <KMDFFW@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:4DFEF30C-1AE1-44C2-B3EB-4CFC47A93351@xxxxxxxxxxxxxxxx
Doron:

Hi, thank you for your reply. Based on what you said about the object
attribute, these two approaches are equivalent ways of initilizing it.
However, it seems that none of the samples of kmdf ddk use either

WDF_OBJECT_ATTRIBUTES_SET_CONTEXT_TYPE(&woa, DEVICE_CONTEXT);

or

WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&woa, DEVICE_CONTEXT);
Then I wonder how the device context info of the work item will be used by
KMDF framework, or the context info is only used by driver writers' own
use
and it's optional?

Meanwhile, for WDM work item object, we can specify whether we want to use
DelayedWorkQueue or CriticalWorkQueue for it. But it seems that we can't
specify that any more for KMDF work item anymore, is that right?

Thanks.

AT.
"Doron Holan [MS]" wrote:

there is no way to cancel a WDM work item once it is queued, so the
callback
will be called. What KMDF will guarantee is that by the time your
WDFDEVICE's EvtObjectCleanup() routine is called, that the work item
callback has been called and completed.

WDF_OBJECT_ATTRIBUTES_SET_CONTEXT_TYPE() is just the 2nd part of
WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(). For instance

WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(DEVICE_CONTEXT, GetDeviceContext);

WDF_OBJECT_ATTRIBUTES woa;
WDF_OBJECT_ATTRIBUTES_INIT(&woa);
WDF_OBJECT_ATTRIBUTES_SET_CONTEXT_TYPE(&woa, DEVICE_CONTEXT);

which is functionally the same as this code
WDF_OBJECT_ATTRIBUTES woa;
WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&woa, DEVICE_CONTEXT);

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no
rights.


"KMDF_FW" <KMDFFW@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:ACCA56B0-FFE4-448C-915C-EC27BE156CC9@xxxxxxxxxxxxxxxx
Ah, I got something else to ask. I understand that when a device is
removed,
the work itme related to it will also be removed since we specified
work
item's ParentObject to be the device. But in my case, when I remove my
usb
device, my work item callback routine is still called. Is it because I
didn't
specifiy correct ParentObject or there is something else we need to do?
BTW,
does anyone know how/when to use KMDF's
WDF_OBJECT_ATTRIBUTES_SET_CONTEXT_TYPE() macro as there is no sample in
kmdf
ddk uses it and the short code in help file is not detailed enough to
be
helpful.

Thanks.

AT.





.



Relevant Pages

  • Re: Something else related to work item.
    ... Please do not send e-mail directly to this alias. ... KMDF framework, or the context info is only used by driver writers' own ... Meanwhile, for WDM work item object, we can specify whether we want to use ... callback has been called and completed. ...
    (microsoft.public.development.device.drivers)
  • Re: Something else related to work item.
    ... KMDF framework, or the context info is only used by driver writers' own use ... Meanwhile, for WDM work item object, we can specify whether we want to use ... Please do not send e-mail directly to this alias. ... specifiy correct ParentObject or there is something else we need to do? ...
    (microsoft.public.development.device.drivers)
  • Re: Something else related to work item.
    ... What KMDF will guarantee is that by the time your ... callback has been called and completed. ... Please do not send e-mail directly to this alias. ... specifiy correct ParentObject or there is something else we need to do? ...
    (microsoft.public.development.device.drivers)
  • Re: could WDM sample code: selsusp work on any platform?
    ... Please do not send e-mail directly to this alias. ... newsgroup purposes only. ... source that have easily moved to kmdf. ... KMDF changes how the driver ...
    (microsoft.public.development.device.drivers)
  • Re: USB to Serial Convertor
    ... KMDF USB APIs ... Please do not send e-mail directly to this alias. ... I think its time for me to start working on KMDF serial sample. ...
    (microsoft.public.development.device.drivers)

Quantcast