WmiCompleteRequest function (wmilib.h)

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

Syntax

NTSTATUS WmiCompleteRequest(
  [in]      PDEVICE_OBJECT DeviceObject,
  [in, out] PIRP           Irp,
  [in]      NTSTATUS       Status,
  [in]      ULONG          BufferUsed,
  [in]      CCHAR          PriorityBoost
);

Parameters

[in] DeviceObject

A pointer to the driver's DEVICE_OBJECT.

[in, out] Irp

A pointer to the IRP.

[in] Status

Specifies the status to return for the IRP.

[in] BufferUsed

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.

[in] PriorityBoost

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

   
Minimum supported client Available starting with Windows 2000.
Target Platform Universal
Header wmilib.h (include Wmilib.h)
Library Wmilib.lib
IRQL <= DISPATCH_LEVEL

See also

DpWmiExecuteMethod

DpWmiFunctionControl

DpWmiQueryDataBlock

DpWmiQueryReginfo

DpWmiSetDataBlock

DpWmiSetDataItem

IoCompleteRequest

WmiSystemControl