DriverCreate rule (kmdf)

The DriverCreate rule specifies that a driver that uses Kernel Mode Driver Framework (KMDF) must call the WdfDriverCreate method to create a framework driver object from within its DriverEntry routine.

Driver model KMDF

How to test

At compile time

Run Static Driver Verifier and specify the DriverCreate rule.

Use the following steps to run an analysis of your code:
  1. Prepare your code (use role type declarations).
  2. Run Static Driver Verifier.
  3. View and analyze the results.

For more information, see Using Static Driver Verifier to Find Defects in Drivers.

Applies to

WdfChildListAddOrUpdateChildDescriptionAsPresent WdfChildListBeginIteration WdfChildListBeginScan WdfChildListCreate WdfChildListEndIteration WdfChildListEndScan WdfChildListGetDevice WdfChildListRequestChildEject WdfChildListRetrieveAddressDescription WdfChildListRetrieveNextDevice WdfChildListRetrievePdo WdfChildListUpdateAllChildDescriptionsAsPresent WdfChildListUpdateChildDescriptionAsMissing WdfCmResourceListAppendDescriptor WdfCmResourceListGetCount WdfCmResourceListGetDescriptor WdfCmResourceListInsertDescriptor WdfCmResourceListRemove WdfCmResourceListRemoveByDescriptor WdfCollectionAdd WdfCollectionCreate WdfCollectionGetCount WdfCollectionGetFirstItem WdfCollectionGetItem WdfCollectionGetLastItem WdfCollectionRemove WdfCollectionRemoveItem WdfCommonBufferCreate WdfCommonBufferCreateWithConfig WdfCommonBufferGetAlignedLogicalAddress WdfCommonBufferGetAlignedVirtualAddress WdfCommonBufferGetLength WdfControlDeviceInitAllocate WdfControlDeviceInitSetShutdownNotification WdfControlFinishInitializing WdfDeviceAddDependentUsageDeviceObject WdfDeviceAddQueryInterface WdfDeviceAddRemovalRelationsPhysicalDevice WdfDeviceAllocAndQueryProperty WdfDeviceAssignMofResourceName WdfDeviceAssignS0IdleSettings WdfDeviceAssignSxWakeSettings WdfDeviceClearRemovalRelationsDevices WdfDeviceConfigureRequestDispatching WdfDeviceConfigureWdmIrpDispatchCallback WdfDeviceCreate WdfDeviceCreateDeviceInterface WdfDeviceCreateSymbolicLink WdfDeviceEnqueueRequest WdfDeviceGetAlignmentRequirement WdfDeviceGetCharacteristics WdfDeviceGetDefaultQueue WdfDeviceGetDevicePnpState WdfDeviceGetDevicePowerPolicyState WdfDeviceGetDevicePowerState WdfDeviceGetDeviceState WdfDeviceGetDriver WdfDeviceGetFileObject WdfDeviceGetIoTarget WdfDeviceGetSystemPowerAction WdfDeviceIndicateWakeStatus WdfDeviceInitAssignName WdfDeviceInitAssignSDDLString WdfDeviceInitAssignWdmIrpPreprocessCallback WdfDeviceInitFree WdfDeviceInitRegisterPnpStateChangeCallback WdfDeviceInitRegisterPowerPolicyStateChangeCallback WdfDeviceInitRegisterPowerStateChangeCallback WdfDeviceInitSetCharacteristics WdfDeviceInitSetDeviceClass WdfDeviceInitSetDeviceType WdfDeviceInitSetExclusive WdfDeviceInitSetFileObjectConfig WdfDeviceInitSetIoInCallerContextCallback WdfDeviceInitSetIoType WdfDeviceInitSetPnpPowerEventCallbacks WdfDeviceInitSetPowerInrush WdfDeviceInitSetPowerNotPageable WdfDeviceInitSetPowerPageable WdfDeviceInitSetPowerPolicyEventCallbacks WdfDeviceInitSetPowerPolicyOwnership WdfDeviceInitSetReleaseHardwareOrderOnFailure WdfDeviceInitSetRemoveLockOptions WdfDeviceInitSetRequestAttributes WdfDeviceMiniportCreate WdfDeviceOpenRegistryKey WdfDeviceQueryProperty WdfDeviceRemoveDependentUsageDeviceObject WdfDeviceRemoveRemovalRelationsPhysicalDevice WdfDeviceResumeIdle WdfDeviceRetrieveDeviceInterfaceString WdfDeviceRetrieveDeviceName WdfDeviceSetAlignmentRequirement WdfDeviceSetBusInformationForChildren WdfDeviceSetCharacteristics WdfDeviceSetDeviceInterfaceState WdfDeviceSetDeviceState WdfDeviceSetFailed WdfDeviceSetPnpCapabilities WdfDeviceSetPowerCapabilities WdfDeviceSetSpecialFileSupport WdfDeviceSetStaticStopRemove WdfDeviceStopIdle WdfDeviceWdmAssignPowerFrameworkSettings WdfDeviceWdmDispatchIrp WdfDeviceWdmDispatchIrpToIoQueue WdfDeviceWdmDispatchPreprocessedIrp WdfDeviceWdmGetAttachedDevice WdfDeviceWdmGetDeviceObject WdfDeviceWdmGetPhysicalDevice WdfDmaEnablerConfigureSystemProfile WdfDmaEnablerCreate WdfDmaEnablerGetFragmentLength WdfDmaEnablerGetMaximumLength WdfDmaEnablerGetMaximumScatterGatherElements WdfDmaEnablerSetMaximumScatterGatherElements WdfDmaEnablerWdmGetDmaAdapter WdfDmaTransactionAllocateResources WdfDmaTransactionCancel WdfDmaTransactionCreate WdfDmaTransactionDmaCompleted WdfDmaTransactionDmaCompletedFinal WdfDmaTransactionDmaCompletedWithLength WdfDmaTransactionExecute WdfDmaTransactionFreeResources WdfDmaTransactionGetBytesTransferred WdfDmaTransactionGetCurrentDmaTransferLength WdfDmaTransactionGetDevice WdfDmaTransactionGetRequest WdfDmaTransactionGetTransferInfo WdfDmaTransactionInitialize WdfDmaTransactionInitializeUsingOffset WdfDmaTransactionInitializeUsingRequest WdfDmaTransactionRelease WdfDmaTransactionSetChannelConfigurationCallback WdfDmaTransactionSetDeviceAddressOffset WdfDmaTransactionSetImmediateExecution WdfDmaTransactionSetMaximumLength WdfDmaTransactionSetTransferCompleteCallback WdfDmaTransactionStopSystemTransfer WdfDmaTransactionWdmGetTransferContext WdfDpcCancel WdfDpcCreate WdfDpcEnqueue WdfDpcGetParentObject WdfDpcWdmGetDpc WdfDriverCreate WdfDriverGetRegistryPath WdfDriverIsVersionAvailable WdfDriverMiniportUnload WdfDriverOpenParametersRegistryKey WdfDriverRegisterTraceInfo WdfDriverRetrieveVersionString WdfDriverWdmGetDriverObject WdfFdoAddStaticChild WdfFdoGetDefaultChildList WdfFdoInitAllocAndQueryProperty WdfFdoInitOpenRegistryKey WdfFdoInitQueryProperty WdfFdoInitSetDefaultChildListConfig WdfFdoInitSetEventCallbacks WdfFdoInitSetFilter WdfFdoInitWdmGetPhysicalDevice WdfFdoLockStaticChildListForIteration WdfFdoQueryForInterface WdfFdoRetrieveNextStaticChild WdfFdoUnlockStaticChildListFromIteration WdfFileObjectGetDevice WdfFileObjectGetFileName WdfFileObjectGetFlags WdfFileObjectWdmGetFileObject WdfGetTriageInfo WdfInterruptAcquireLock WdfInterruptCreate WdfInterruptDisable WdfInterruptEnable WdfInterruptGetDevice WdfInterruptGetInfo WdfInterruptQueueDpcForIsr WdfInterruptQueueWorkItemForIsr WdfInterruptReleaseLock WdfInterruptReportActive WdfInterruptReportInactive WdfInterruptSetExtendedPolicy WdfInterruptSetPolicy WdfInterruptSynchronize WdfInterruptTryToAcquireLock WdfInterruptWdmGetInterrupt WdfIoQueueAssignForwardProgressPolicy WdfIoQueueCreate WdfIoQueueDrain WdfIoQueueDrainSynchronously WdfIoQueueFindRequest WdfIoQueueGetDevice WdfIoQueueGetState WdfIoQueuePurge WdfIoQueuePurgeSynchronously WdfIoQueueReadyNotify WdfIoQueueRetrieveFoundRequest WdfIoQueueRetrieveNextRequest WdfIoQueueRetrieveRequestByFileObject WdfIoQueueStart WdfIoQueueStop WdfIoQueueStopAndPurge WdfIoQueueStopAndPurgeSynchronously WdfIoQueueStopSynchronously WdfIoResourceListAppendDescriptor WdfIoResourceListCreate WdfIoResourceListGetCount WdfIoResourceListGetDescriptor WdfIoResourceListInsertDescriptor WdfIoResourceListRemove WdfIoResourceListRemoveByDescriptor WdfIoResourceListUpdateDescriptor WdfIoResourceRequirementsListAppendIoResList WdfIoResourceRequirementsListGetCount WdfIoResourceRequirementsListGetIoResList WdfIoResourceRequirementsListInsertIoResList WdfIoResourceRequirementsListRemove WdfIoResourceRequirementsListRemoveByIoResList WdfIoResourceRequirementsListSetInterfaceType WdfIoResourceRequirementsListSetSlotNumber WdfIoTargetAllocAndQueryTargetProperty WdfIoTargetClose WdfIoTargetCloseForQueryRemove WdfIoTargetCreate WdfIoTargetFormatRequestForInternalIoctl WdfIoTargetFormatRequestForInternalIoctlOthers WdfIoTargetFormatRequestForIoctl WdfIoTargetFormatRequestForRead WdfIoTargetFormatRequestForWrite WdfIoTargetGetDevice WdfIoTargetGetState WdfIoTargetOpen WdfIoTargetPurge WdfIoTargetQueryForInterface WdfIoTargetQueryTargetProperty WdfIoTargetSendInternalIoctlOthersSynchronously WdfIoTargetSendInternalIoctlSynchronously WdfIoTargetSendIoctlSynchronously WdfIoTargetSendReadSynchronously WdfIoTargetSendWriteSynchronously WdfIoTargetStart WdfIoTargetStop WdfIoTargetWdmGetTargetDeviceObject WdfIoTargetWdmGetTargetFileHandle WdfIoTargetWdmGetTargetFileObject WdfIoTargetWdmGetTargetPhysicalDevice WdfLookasideListCreate WdfMemoryAssignBuffer WdfMemoryCopyFromBuffer WdfMemoryCopyToBuffer WdfMemoryCreate WdfMemoryCreateFromLookaside WdfMemoryCreatePreallocated WdfMemoryGetBuffer WdfObjectAcquireLock WdfObjectAllocateContext WdfObjectContextGetObject WdfObjectCreate WdfObjectDelete WdfObjectDereference WdfObjectDereferenceActual WdfObjectGetTypedContextWorker WdfObjectQuery WdfObjectReference WdfObjectReferenceActual WdfObjectReleaseLock WdfPdoAddEjectionRelationsPhysicalDevice WdfPdoClearEjectionRelationsDevices WdfPdoGetParent WdfPdoInitAddCompatibleID WdfPdoInitAddDeviceText WdfPdoInitAddHardwareID WdfPdoInitAllocate WdfPdoInitAllowForwardingRequestToParent WdfPdoInitAssignContainerID WdfPdoInitAssignDeviceID WdfPdoInitAssignInstanceID WdfPdoInitAssignRawDevice WdfPdoInitSetDefaultLocale WdfPdoInitSetEventCallbacks WdfPdoMarkMissing WdfPdoRemoveEjectionRelationsPhysicalDevice WdfPdoRequestEject WdfPdoRetrieveAddressDescription WdfPdoRetrieveIdentificationDescription WdfPdoUpdateAddressDescription WdfRegistryAssignMemory WdfRegistryAssignMultiString WdfRegistryAssignString WdfRegistryAssignULong WdfRegistryAssignUnicodeString WdfRegistryAssignValue WdfRegistryClose WdfRegistryCreateKey WdfRegistryOpenKey WdfRegistryQueryMemory WdfRegistryQueryMultiString WdfRegistryQueryString WdfRegistryQueryULong WdfRegistryQueryUnicodeString WdfRegistryQueryValue WdfRegistryRemoveKey WdfRegistryRemoveValue WdfRegistryWdmGetHandle WdfRequestAllocateTimer WdfRequestCancelSentRequest WdfRequestChangeTarget WdfRequestComplete WdfRequestCompleteWithInformation WdfRequestCompleteWithPriorityBoost WdfRequestCreate WdfRequestCreateFromIrp WdfRequestFormatRequestUsingCurrentType WdfRequestForwardToIoQueue WdfRequestForwardToParentDeviceIoQueue WdfRequestGetCompletionParams WdfRequestGetFileObject WdfRequestGetInformation WdfRequestGetIoQueue WdfRequestGetParameters WdfRequestGetRequestorMode WdfRequestGetStatus WdfRequestIsCanceled WdfRequestIsFrom32BitProcess WdfRequestIsReserved WdfRequestMarkCancelable WdfRequestMarkCancelableEx WdfRequestProbeAndLockUserBufferForRead WdfRequestProbeAndLockUserBufferForWrite WdfRequestRequeue WdfRequestRetrieveInputBuffer WdfRequestRetrieveInputMemory WdfRequestRetrieveInputWdmMdl WdfRequestRetrieveOutputBuffer WdfRequestRetrieveOutputMemory WdfRequestRetrieveOutputWdmMdl WdfRequestRetrieveUnsafeUserInputBuffer WdfRequestRetrieveUnsafeUserOutputBuffer WdfRequestReuse WdfRequestSend WdfRequestSetCompletionRoutine WdfRequestSetInformation WdfRequestStopAcknowledge WdfRequestUnmarkCancelable WdfRequestWdmFormatUsingStackLocation WdfRequestWdmGetIrp WdfSpinLockAcquire WdfSpinLockCreate WdfSpinLockRelease WdfStringCreate WdfStringGetUnicodeString WdfTimerCreate WdfTimerGetParentObject WdfTimerStart WdfTimerStop WdfUsbInterfaceGetConfiguredPipe WdfUsbInterfaceGetConfiguredSettingIndex WdfUsbInterfaceGetDescriptor WdfUsbInterfaceGetEndpointInformation WdfUsbInterfaceGetInterfaceNumber WdfUsbInterfaceGetNumConfiguredPipes WdfUsbInterfaceGetNumEndpoints WdfUsbInterfaceGetNumSettings WdfUsbInterfaceSelectSetting WdfUsbTargetDeviceAllocAndQueryString WdfUsbTargetDeviceCreate WdfUsbTargetDeviceCreateIsochUrb WdfUsbTargetDeviceCreateUrb WdfUsbTargetDeviceCreateWithParameters WdfUsbTargetDeviceCyclePortSynchronously WdfUsbTargetDeviceFormatRequestForControlTransfer WdfUsbTargetDeviceFormatRequestForCyclePort WdfUsbTargetDeviceFormatRequestForString WdfUsbTargetDeviceFormatRequestForUrb WdfUsbTargetDeviceGetDeviceDescriptor WdfUsbTargetDeviceGetInterface WdfUsbTargetDeviceGetNumInterfaces WdfUsbTargetDeviceIsConnectedSynchronous WdfUsbTargetDeviceQueryString WdfUsbTargetDeviceQueryUsbCapability WdfUsbTargetDeviceResetPortSynchronously WdfUsbTargetDeviceRetrieveConfigDescriptor WdfUsbTargetDeviceRetrieveCurrentFrameNumber WdfUsbTargetDeviceRetrieveInformation WdfUsbTargetDeviceSelectConfig WdfUsbTargetDeviceSendControlTransferSynchronously WdfUsbTargetDeviceSendUrbSynchronously WdfUsbTargetDeviceWdmGetConfigurationHandle WdfUsbTargetPipeAbortSynchronously WdfUsbTargetPipeConfigContinuousReader WdfUsbTargetPipeFormatRequestForAbort WdfUsbTargetPipeFormatRequestForRead WdfUsbTargetPipeFormatRequestForReset WdfUsbTargetPipeFormatRequestForUrb WdfUsbTargetPipeFormatRequestForWrite WdfUsbTargetPipeGetInformation WdfUsbTargetPipeGetIoTarget WdfUsbTargetPipeGetType WdfUsbTargetPipeIsInEndpoint WdfUsbTargetPipeIsOutEndpoint WdfUsbTargetPipeReadSynchronously WdfUsbTargetPipeResetSynchronously WdfUsbTargetPipeSendUrbSynchronously WdfUsbTargetPipeSetNoMaximumPacketSizeCheck WdfUsbTargetPipeWdmGetPipeHandle WdfUsbTargetPipeWriteSynchronously WdfVerifierDbgBreakPoint WdfVerifierKeBugCheck WdfWaitLockAcquire WdfWaitLockCreate WdfWaitLockRelease WdfWdmDeviceGetWdfDeviceHandle WdfWdmDriverGetWdfDriverHandle WdfWmiInstanceCreate WdfWmiInstanceDeregister WdfWmiInstanceFireEvent WdfWmiInstanceGetDevice WdfWmiInstanceGetProvider WdfWmiInstanceRegister WdfWmiProviderCreate WdfWmiProviderGetDevice WdfWmiProviderGetTracingHandle WdfWmiProviderIsEnabled WdfWorkItemCreate WdfWorkItemEnqueue WdfWorkItemFlush WdfWorkItemGetParentObject