WmiCompleteRequest routine

The WmiCompleteRequest routine indicates that a driver has finished processing a WMI request in a DpWmiXxx routine.

Syntax


NTSTATUS WmiCompleteRequest(
  _In_    PDEVICE_OBJECT DeviceObject,
  _Inout_ PIRP           Irp,
  _In_    NTSTATUS       Status,
  _In_    ULONG          BufferUsed,
  _In_    CCHAR          PriorityBoost 
);

Parameters

DeviceObject [in]

A pointer to the driver's DEVICE_OBJECT.

Irp [in, out]

A pointer to the IRP.

Status [in]

Specifies the status to return for the IRP.

BufferUsed [in]

Specifies the number of bytes needed in the buffer passed to the driver's DpWmiXxx routine. If the buffer is too small, the driver sets Status to STATUS_BUFFER_TOO_SMALL and sets BufferUsed to the number of bytes needed for the data to be returned. If the buffer passed is large enough, the driver sets BufferUsed to the number of bytes actually used.

PriorityBoost [in]

Specifies a system-defined constant by which to increment the run-time priority of the original thread that requested the operation. WMI calls IoCompleteRequest with PriorityBoost when it completes the IRP. See IoCompleteRequest for more information on PriorityBoost.

Return value

WmiCompleteRequest returns the value that was passed to it in the Status parameter unless Status was set to STATUS_BUFFER_TOO_SMALL. If the driver set Status equal to STATUS_BUFFER_TOO_SMALL, WmiCompleteRequest builds a WNODE_TOO_SMALL structure and returns STATUS_SUCCESS. The return value from WmiCompleteRequest should be returned by the driver in its DpWmiXxx routine.

Remarks

A driver calls WmiCompleteRequest from a DpWmiXxx routine after it finishes all other processing in that routine, or after the driver finishes all processing for a pending IRP. WmiCompleteRequest fills in a WNODE_XXX with any data returned by the driver and calls IoCompleteRequest to complete the IRP.

A driver should always return the return value from WmiCompleteRequest in its DpWmiXxx routine.

A driver must not call WmiCompleteRequest from its DpWmiQueryRegInfo routine.

Requirements

Target platform

Universal

Version

Available starting with Windows 2000.

Header

Wmilib.h (include Wmilib.h)

Library

Wmilib.lib

IRQL

<= DISPATCH_LEVEL

See also

DpWmiExecuteMethod
DpWmiFunctionControl
DpWmiQueryDataBlock
DpWmiQueryReginfo
DpWmiSetDataBlock
DpWmiSetDataItem
IoCompleteRequest
WmiSystemControl

 

 

Send comments about this topic to Microsoft

Show: