Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Drivers > RDF_CARD_TRACKING

Reply
Fix Vista Errors
Thread Tools Display Modes

RDF_CARD_TRACKING

 
 
AO
Guest
Posts: n/a

 
      11-13-2009



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...?
 
Reply With Quote
 
Doron Holan [MSFT]
Guest
Posts: n/a

 
      11-16-2009
reuse the request, that is what WdfRequestReuse is for

d

--

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


"AO" <> wrote in message
news:2A2CEB40-EA09-4A1B-BCDE-...
> 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...?


 
Reply With Quote
 
AO
Guest
Posts: n/a

 
      11-17-2009
WdfRequestReuse doesn't solve the fundamental problematique I described when
it might fail as well
 
Reply With Quote
 
Abhishek R [MSFT]
Guest
Posts: n/a

 
      11-19-2009
If you pass in correct arguments and set WDF_REQUEST_REUSE_NO_FLAGS in the
ReuseParams, WdfRequestReuse will not fail.

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


 
Reply With Quote
 
AO
Guest
Posts: n/a

 
      11-19-2009
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?
 
Reply With Quote
 
Abhishek R [MSFT]
Guest
Posts: n/a

 
      11-19-2009
I understand that you need a reliable way to reuse a request. The
documentation for WdfRequestCreate is not very explicit about the
circumstances under which this call can fail. We'll work on getting the
documentation updated to explicitly clarify that this call will not fail if
the correct arguments are passed in and if WDF_REQUEST_REUSE_NO_FLAGS is
used, so you can take a dependency on this.

Abhishek Ram
WDF team

"AO" <> wrote in message
news:5762E15B-DBCC-4F03-8A7B-...
> 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?


 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59