From: AO on
I create a card tracking request at D0 entry. The RDF_CARD_TRACKING callback
will then be called when a card is inserted in the card reader. So far so
good. In the request's corresponding completion routine, I delete the
request, create a new card tracking request and set the completion routine so
that the RDF_CARD_TRACKING callback will be called on the next card status
change as well. An option would also be to reuse the old request, I guess.
The completion routine has the following declaration:

VOID
WdfRequestSetCompletionRoutine(
IN WDFREQUEST Request,
IN OPTIONAL PFN_WDF_REQUEST_COMPLETION_ROUTINE CompletionRoutine,
IN OPTIONAL WDFCONTEXT CompletionContext
);

If the card tracking request creation would fail in the completion routine,
there is no way to indicate failure to the outside world due the above
declaration. I guess I could get a bugcheck later on or is it okay if the
request creation fails? I mean, the driver won't detect any card status
changes but any SMCLIB callbacks won't be called either, right? It is okay to
create a new card tracking request in the completion routine, isn't it? If
not, where would I otherwise start the card tracking again...?
From: Doron Holan [MSFT] on
reuse the request, that is what WdfRequestReuse is for

d

--

This posting is provided "AS IS" with no warranties, and confers no rights.


"AO" <AO(a)discussions.microsoft.com> wrote in message
news:2A2CEB40-EA09-4A1B-BCDE-D931981C9666(a)microsoft.com...
> I create a card tracking request at D0 entry. The RDF_CARD_TRACKING
> callback
> will then be called when a card is inserted in the card reader. So far so
> good. In the request's corresponding completion routine, I delete the
> request, create a new card tracking request and set the completion routine
> so
> that the RDF_CARD_TRACKING callback will be called on the next card status
> change as well. An option would also be to reuse the old request, I guess.
> The completion routine has the following declaration:
>
> VOID
> WdfRequestSetCompletionRoutine(
> IN WDFREQUEST Request,
> IN OPTIONAL PFN_WDF_REQUEST_COMPLETION_ROUTINE CompletionRoutine,
> IN OPTIONAL WDFCONTEXT CompletionContext
> );
>
> If the card tracking request creation would fail in the completion
> routine,
> there is no way to indicate failure to the outside world due the above
> declaration. I guess I could get a bugcheck later on or is it okay if the
> request creation fails? I mean, the driver won't detect any card status
> changes but any SMCLIB callbacks won't be called either, right? It is okay
> to
> create a new card tracking request in the completion routine, isn't it? If
> not, where would I otherwise start the card tracking again...?

From: AO on
WdfRequestReuse doesn't solve the fundamental problematique I described when
it might fail as well
From: Abhishek R [MSFT] on
If you pass in correct arguments and set WDF_REQUEST_REUSE_NO_FLAGS in the
ReuseParams, WdfRequestReuse will not fail.

"AO" <AO(a)discussions.microsoft.com> wrote in message
news:3E7F338F-EB2B-46DE-ADB7-60A66C96153F(a)microsoft.com...
> WdfRequestReuse doesn't solve the fundamental problematique I described
> when
> it might fail as well

From: AO on
A stable driver doesn't assume anything. All return values should therefore
be checked. You see the problematique with creating a new request or reusing
a request in the completetion routine now?