Is this a typo in DDK documentation or a bug in code?

Following is what I find in :C:\WinDDK\5384\inc\wdf\kmdf\10\wdfrequest.h. Following definition is the same in 6000 WDK.

//
// WDF Function: WdfRequestStopAcknowledge
//
typedef
WDFAPI
VOID
(*PFN_WDFREQUESTSTOPACKNOWLEDGE)(
IN PWDF_DRIVER_GLOBALS DriverGlobals,
WDFREQUEST Request,
IN BOOLEAN Requeue
);

VOID
FORCEINLINE
WdfRequestStopAcknowledge(
__in
WDFREQUEST Request,
IN BOOLEAN Requeue
)
{
((PFN_WDFREQUESTSTOPACKNOWLEDGE) WdfFunctions[WdfRequestStopAcknowledgeTableIndex])(WdfDriverGlobals, Request, Requeue);
}

This is what I find in DDK doc:
WdfRequestStopAcknowledge
[This is preliminary documentation and subject to change.]

The WdfRequestStopAcknowledge method informs the framework that the driver has stopped processing a specified I/O request.

NTSTATUS
WdfRequestStopAcknowledge(
IN WDFREQUEST Request,
IN BOOLEAN Requeue
);

Parameters
Request
A handle to a framework request object.
Requeue
A Boolean value that, if TRUE, causes the framework to requeue the request into the queue so that the framework will deliver it to the driver again. If FALSE, the framework does not requeue the request. For more information, see the following Comments section.

Return Value
WdfRequestStopAcknowledge returns STATUS_SUCCESS if the operation succeeds. Otherwise, this method might return one of the following values:

STATUS_INVALID_PARAMETER
The driver supplies an invalid handle.
STATUS_INVALID_DEVICE_REQUEST
The specified request is not currently owned by the driver or the Requeue parameter is TRUE and the request is currently cancelable.

This method might return other NTSTATUS values.

A bug check occurs if the driver supplies an invalid object handle.

Here is the compilation error message I get when using return value from WdfRequestStopAcknowledge():

c:\p4client\sw\net\rel65\drivers\windows\kmdf\busenum.c(771) : error C2069: cast of ‘void’ term to non-‘void’

Code looks like:

if (!NT_SUCCESS(WdfRequestStopAcknowledge (Request, FALSE)))

If void return value as documented in header file is correct, then will the above call never fail? If it fails how does driver know about it?

Regards,

-Praveen

This is a error in the docs, the function doesn’t return anything (as you can see by the header). That means it cannot fail.

d

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Praveen Kumar Amritaluru
Sent: Wednesday, November 22, 2006 5:53 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Is this a typo in DDK documentation or a bug in code?

Following is what I find in :C:\WinDDK\5384\inc\wdf\kmdf\10\wdfrequest.h. Following definition is the same in 6000 WDK.
?
//
// WDF Function: WdfRequestStopAcknowledge
//
typedef
WDFAPI
VOID
(*PFN_WDFREQUESTSTOPACKNOWLEDGE)(
??? IN PWDF_DRIVER_GLOBALS DriverGlobals,
??? WDFREQUEST Request,
??? IN BOOLEAN Requeue
??? );
?
VOID
FORCEINLINE
WdfRequestStopAcknowledge(
??? __in
??? WDFREQUEST Request,
??? IN BOOLEAN Requeue
??? )
{
??? ((PFN_WDFREQUESTSTOPACKNOWLEDGE) WdfFunctions[WdfRequestStopAcknowledgeTableIndex])(WdfDriverGlobals, Request, Requeue);
}
?
?
This is what I find in DDK doc:
WdfRequestStopAcknowledge
[This is preliminary documentation and subject to change.]
The WdfRequestStopAcknowledge method informs the framework that the driver has stopped processing a specified I/O request.
NTSTATUS
??WdfRequestStopAcknowledge(
???IN?WDFREQUEST??Request,
???IN?BOOLEAN??Requeue
???);
Parameters
Request
A handle to a framework request object.
Requeue
A Boolean value that, if TRUE, causes the framework to requeue the request into the queue so that the framework will deliver it to the driver again. If FALSE, the framework does not requeue the request. For more information, see the following Comments section.
Return Value
WdfRequestStopAcknowledge returns STATUS_SUCCESS if the operation succeeds. Otherwise, this method might return one of the following values:
STATUS_INVALID_PARAMETER
The driver supplies an invalid handle.
STATUS_INVALID_DEVICE_REQUEST
The specified request is not currently owned by the driver or the Requeue parameter is TRUE and the request is currently cancelable.
This method might return other NTSTATUS values.
A bug check occurs if the driver supplies an invalid object handle.
?
?
Here is the compilation error message I get when using return value from WdfRequestStopAcknowledge():
c:\p4client\sw\net\rel65\drivers\windows\kmdf\busenum.c(771) : error C2069: cast of ‘void’ term to non-‘void’
?
Code looks like:
? if (!NT_SUCCESS(WdfRequestStopAcknowledge (Request, FALSE)))
?If void return value as documented in header file is?correct, then will the above call never fail? If it fails how does driver know about it?
Regards,
-Praveen
?
?
?


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer