returning STATUS_MORE_ENTRIES from KMDF driver

I want to notify user space app that it has more data to process by returning STATUS_MORE_ENTRIES instead of STATUS_SUCCESS

if (status == STATUS_SUCCESS || status == STATUS_MORE_ENTRIES)
WdfRequestSetInformation(request, bytesCopied);
WdfRequestComplete(request, status);

However, DeviceIOControl in overlapped mode returns ERROR_IO_PENDING as expected, but GetOverlappedResult returns TRUE indicating success. If i return STATUS_UNSUCCESSFULL from driver then GetOverlappedResult returns FALSE as expected.

What is proper way to indicate that operation succeeded, but more data is available from driver?

You have a choice, either use STATUS_MORE_ENTRIES which is a success code,
but make sure your user space code understands it needs to get the results.
Or fail the request with something like STATUS_BUFFER_OVERFLOW.

Don Burn
Windows Driver Consulting
Website: http://www.windrvr.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@dewesoft.si
Sent: Tuesday, January 19, 2016 7:44 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] returning STATUS_MORE_ENTRIES from KMDF driver

I want to notify user space app that it has more data to process by
returning STATUS_MORE_ENTRIES instead of STATUS_SUCCESS

if (status == STATUS_SUCCESS || status == STATUS_MORE_ENTRIES)
WdfRequestSetInformation(request, bytesCopied);
WdfRequestComplete(request, status);

However, DeviceIOControl in overlapped mode returns ERROR_IO_PENDING as
expected, but GetOverlappedResult returns TRUE indicating success. If i
return STATUS_UNSUCCESSFULL from driver then GetOverlappedResult returns
FALSE as expected.

What is proper way to indicate that operation succeeded, but more data is
available from driver?


NTDEV is sponsored by OSR

Visit the list online at:
http:

MONTHLY seminars on crash dump analysis, WDF, Windows internals and software
drivers!
Details at http:

To unsubscribe, visit the List Server section of OSR Online at
http:</http:></http:></http:>

I think STATUS_BUFFER_OVERFLOW is the correct code.


Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com

wrote in message news:xxxxx@ntdev…
>I want to notify user space app that it has more data to process by returning STATUS_MORE_ENTRIES instead of STATUS_SUCCESS
>
> if (status == STATUS_SUCCESS || status == STATUS_MORE_ENTRIES)
> WdfRequestSetInformation(request, bytesCopied);
> WdfRequestComplete(request, status);
>
> However, DeviceIOControl in overlapped mode returns ERROR_IO_PENDING as expected, but GetOverlappedResult returns TRUE indicating success. If i return STATUS_UNSUCCESSFULL from driver then GetOverlappedResult returns FALSE as expected.
>
> What is proper way to indicate that operation succeeded, but more data is available from driver?
>

xxxxx@dewesoft.si wrote:

I want to notify user space app that it has more data to process by returning STATUS_MORE_ENTRIES instead of STATUS_SUCCESS

if (status == STATUS_SUCCESS || status == STATUS_MORE_ENTRIES)
WdfRequestSetInformation(request, bytesCopied);
WdfRequestComplete(request, status);

However, DeviceIOControl in overlapped mode returns ERROR_IO_PENDING as expected, but GetOverlappedResult returns TRUE indicating success.

And that’s exactly right, because your operation was successful.
GetLastError should still return ERROR_MORE DATA to tell you more data
awaits.

If i return STATUS_UNSUCCESSFULL from driver then GetOverlappedResult returns FALSE as expected.

What is proper way to indicate that operation succeeded, but more data is available from driver?

I hope you can see the inherent conflict in your thinking. If you want
to indicate that the operation succeeded, then why are you surprised
that GetOverlappedResult told you that the operation succeeded?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Thanks for help. STATUS_BUFFER_OVERFLOW code is what i was looking for. I did not check that STATUS_MORE_ENTRIES indicates success.