STATUS_CANCELLED not working

Hi,

I have an HID upper filter driver, and under some conditions, I want to cancel read requests coming from hardware (not to reach the user mode application reading from the HID device).

When the condition is met, I complete the request using

WdfRequestComplete(Request,STATUS_CANCELLED);

Surprisingly, the user mode application still sees the request. What I am doing wrong?

Best,
AB

The application can cancel a request, all you can do in the driver is fail
the request.

Don Burn
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@gmail.com
Sent: Wednesday, June 05, 2013 9:59 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] STATUS_CANCELLED not working

Hi,

I have an HID upper filter driver, and under some conditions, I want to
cancel read requests coming from hardware (not to reach the user mode
application reading from the HID device).

When the condition is met, I complete the request using

WdfRequestComplete(Request,STATUS_CANCELLED);

Surprisingly, the user mode application still sees the request. What I am
doing wrong?

Best,
AB


NTDEV is sponsored by OSR

OSR is HIRING!! See http://www.osr.com/careers

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

You need to set the returned length to zero.

Are you filtering the miniport stack (the fdo) or a hid enumerated pdo stack?

d

Bent from my phone


From: xxxxx@gmail.commailto:xxxxx
Sent: ?6/?5/?2013 7:01 AM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: [ntdev] STATUS_CANCELLED not working

Hi,

I have an HID upper filter driver, and under some conditions, I want to cancel read requests coming from hardware (not to reach the user mode application reading from the HID device).

When the condition is met, I complete the request using

WdfRequestComplete(Request,STATUS_CANCELLED);

Surprisingly, the user mode application still sees the request. What I am doing wrong?

Best,
AB


NTDEV is sponsored by OSR

OSR is HIRING!! See http://www.osr.com/careers

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</mailto:xxxxx></mailto:xxxxx>

I am filtering an HID enumerated PDO stack

Are you sure your code is doing what you think it is? What status is the app seeing on the canceled read?

d

Bent from my phone


From: xxxxx@gmail.commailto:xxxxx
Sent: ?6/?5/?2013 8:18 AM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: RE:[ntdev] STATUS_CANCELLED not working

I am filtering an HID enumerated PDO stack


NTDEV is sponsored by OSR

OSR is HIRING!! See http://www.osr.com/careers

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</mailto:xxxxx></mailto:xxxxx>

yes, after I added completion with info and returning zero length as suggested by Alex, it now works fine. Thank you guys so much.