/*++

    Copyright (c) Microsoft Corporation.  All rights reserved.

Rule Name:
 
    RequestedPowerIrp

Domain:

    Wdm

Rule ID:

    0x0004100B

Description:

    The RequestedPowerIrp rule specifies that driver calls PoRequestPowerIrp 
    with the last argument set to NULL except when the minor function is set 
    to IRP_MN_WAIT_WAKE.

    Because the pointer by PoRequestPowerIrp is not reliable, drivers should 
    not retrieve or use this value.

Help Link:

    https://go.microsoft.com/fwlink/?LinkId=216013

--*/


#include "slic_base.h"



/* 
    Drivers should not use the allocated power IRP returned by a call
    to PoRequestPowerIrp: By the time this function returns, this IRP
    might have been completed and the memory freed. Thus, touching the
    IRP after this call may bugcheck the system.
*/
state
{
}

PoRequestPowerIrp.entry
{
   
      if($2!=IRP_MN_WAIT_WAKE)
      {
        if ($6 != NULL) 
        {
            abort "The last parameter of PoRequestPowerIrp must be null.";
        }
      }
      else
      {
        halt;
      }
}
