The PoFxPowerControl routine sends a power control request to the power management framework (PoFx).
NTSTATUS PoFxPowerControl( _In_ POHANDLE Handle, _In_ LPCGUID PowerControlCode, _In_opt_ PVOID InBuffer, _In_ SIZE_T InBufferSize, _Out_opt_ PVOID OutBuffer, _In_ SIZE_T OutBufferSize, _Out_opt_ PSIZE_T BytesReturned );
A handle that represents the registration of the device with PoFx. The device driver previously received this handle from the PoFxRegisterDevice routine.
A pointer to the power control code. This code is a GUID value that specifies the requested operation.
A pointer to a caller-allocated buffer that contains the input data for the operation. The format for the data in this buffer depends on the power control code specified by the PowerControlCode parameter. The InBuffer parameter is optional and can be specified as NULL if the specified operation requires no input data.
The size, in bytes, of the input buffer that is pointed to by the InBuffer parameter. If InBuffer is NULL, set InBufferSize to zero.
A pointer to a caller-allocated buffer that is to contain the output data from the operation. The format for the data in this buffer depends on the power control code specified by the PowerControlCode parameter. The OutBuffer parameter is optional and can be specified as NULL if the specified operation produces no output data.
The size, in bytes, of the output buffer that is pointed to by the OutBuffer parameter. If OutBuffer is NULL, set OutBufferSize to zero.
A pointer to a location into which the routine writes the number of bytes of data that were written to the buffer that is pointed to by OutBuffer. The number of bytes written will be less than or equal to OutBufferSize. This parameter is optional and can be specified as NULL if the caller does not need to know how many bytes were written to the output buffer.
PoFxPowerControl returns STATUS_SUCCESS if the requested operation succeeds. Possible error return values include the following status code.
||The requested power control operation is not implemented.|
||The power engine plug-in (PEP) does not acknowledge support for this device.|
A device driver calls this routine to send a power control request directly to PoFx. A power control request is similar to an I/O control request (IOCTL). Unlike an IOCTL, however, a power control request is sent directly to PoFx and is not observed by other device drivers in the device stack. During a PoFxPowerControl call, PoFx synchronously performs the requested operation.
Similarly, PoFx can send a power control request directly to the device driver. The driver handles this request in its PowerControlCallback routine.
PoFx delegates the handling of all power control requests to the power engine plug-in (PEP). The PEP is an optional software component that performs power management tasks that are specific to a particular product line of processor or System on a Chip (SoC) modules. If the hardware vendor for the processor or SoC supplies a PEP for a hardware platform, this PEP might handle custom power control requests from a device driver, or might send custom power control requests to the driver's PowerControlCallback routine. The vendor can specify a set of PowerControlCode GUIDs and define the operations that are designated by these GUIDs. As an option, a device driver can contain platform-specific code to handle or to send requests for these operations.
|Windows version||Available starting with Windows 8. Available starting with Windows 8.|