/*++

    Copyright (c) Microsoft Corporation.  All rights reserved.

Rule Name:

    Cleanup4CtlDeviceRegistered

Domain:

    wdf

Rule ID:

    Not Applicable

Description:

    If a PnP driver creates a control device object, it must register for the Cleanup callback.

    If a PnP driver calls WdfDeviceCreate for the control device object, 
    it must register for one of the following callbacks:
    EvtCleanupCallback or EvtDestroyCallback (in WDF_OBJECT_ATTRIBUTES structure for the Control Device) 
    or EvtDeviceSelfManagedIoCleanup  (in WDF_PNPPOWER_EVENT_CALLBACKS structure) .
 
	Rule diagnostics:
    "EvtCleanupCallback or EvtDestroyCallback (in WDF_OBJECT_ATTRIBUTES structure for the Control Device) 
    or EvtDeviceSelfManagedIoCleanup (in WDF_PNPPOWER_EVENT_CALLBACKS structure) must be registered for 
    the PnP driver that creates the Control Device."

Help Link:

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

--*/




#include "slic_base.h"

select one { 
  case fun_WDF_DEVICE_CONTEXT_CLEANUP:         none
  case fun_WDF_DEVICE_CONTEXT_DESTROY:         none
  case fun_WDF_DEVICE_SELF_MANAGED_IO_CLEANUP: none
  case fun_WDF_DRIVER_DEVICE_ADD: 
       [sdv_WdfControlDeviceInitAllocate].entry {
            abort "ContextCleanup or ContextDestroy (for WDFDEVICE) or EvtDeviceSelfManagedIoCleanup (in pnpPowerCallbacks) must be registered for the Pnp driver that creates a Control Device.";
        }
}

   
