Поделиться через


DriverCreate rule (kmdf)

Правило DriverCreate указывает, что драйвер, использующий платформу драйвера в режиме ядра (KMDF), должен вызвать метод WdfDriverCreate , чтобы создать объект драйвера платформы из подпрограммы DriverEntry .

Модель драйвера: KMDF

Как тестировать

Во время компиляции

Запустите средство проверки статических драйверов и укажите правило DriverCreate .

Чтобы выполнить анализ кода, выполните следующие действия.
  1. Подготовьте код (используйте объявления типов ролей).
  2. Запустите средство проверки статических драйверов.
  3. Просмотр и анализ результатов.

Дополнительные сведения см. в статье Использование средства проверки статических драйверов для поиска дефектов в драйверах.

Применяется к

WdfChildListAddOrUpdateChildDescriptionAsPresentWdfChildListBeginIterationWdfChildListBeginScanWdfChildListCreateWdfChildListEndIterationWdfChildListEndScanWdfChildListGetDeviceWdfChildListRequestChildEjectWdfChildListRetrieveAddressDescriptionWdfChildListRetrieveNextDeviceWdfChildListRetrievePdoWdfChildListUpdateAllChildDescriptionsAsPresentWdfChildListUpdateChildDescriptionAsMissingWdfCmResourceListAppendDescriptorWdfCmResourceListGetCountWdfCmReResourceListGetDescriptorWdfCmResourceListInsertDescriptorWdfCmResourceListRemoveWdfCmResourceListRemoveByDescriptorWdfCollectionAddWdfCollectionCreateWdfCollectionGetCountWdfCollectionGetFirstItemWdfCollectionGetItemWdfCollectionGetLastItemWdfCollectionRemoveWdfCollectionRemoveItemWdfCommonBufferCreateWdfCommonBufferCreateWithConfigWdfCommonBufferGetAlignedLogicalAddressWdfCommonBufferGetAlignedVirtualAddressWdfCommonBufferGetLengthWdfControlDeviceInitAllocateWdfControlDeviceInitSetShutdownNotificationWdfControlFinishInitializingWdfDeviceAddDependentUsageDeviceObjectWdfDeviceAddQueryInterfaceWdfDeviceAddRemovalRelationsPhysicalDevWdfDeviceAllocAndQueryPropertyWdfDeviceAssignMofResourceNameWdfDeviceAssignS0IdleSettingsWdfDeviceAssignSxWakeSettingsWdfDeviceClearRemovalRelationsDevicesWdfDeviceConfigureRequestDispatchingWdfDeviceConfigureWdmIrpDispatchCallchWdfDeviceCreateWdfDeviceCreateDeviceInterfaceWdfDeviceCreateSymbolicLinkWdfDeviceEnqueueRequestWdfDeviceGetAlignmentRequirementWdfDeviceGetCharacteristicsWdfDeviceGetDefaultQueueWdfDeviceGetDevicePnpStateWdfDeviceGetDevicePowerPolicyStateWdfDeviceGetDevicePowerStateWdfDeviceGetDeviceStateWdfDeviceGetDriverWdfDeviceGetFileObjectWdfDeviceGetIoTargetWdfDeviceGetSystemPowerActionWdfDeviceIndicateWakeStatusWdfDeviceInitAssignNameWdfDeviceInitAssignSDDLStringWdfDeviceInitAssignWdmIrpPreprocessCallbackWdfDeviceInitFreeWdfDeviceInitRegisterPnpStateChangeCallbackWdfDeviceInitRegisterPowerPolicyStateChangeCallbackWdfDeviceInitRegisterPowerStateChangeCallbackWdfDeviceInitSetCharacteristicsWdfDeviceInitSetDeviceClassWdfDeviceInitSetDeviceTypeWdfDeviceInitSetExclusiveWdfDeviceInitSetFileObjectConfigWdfDeviceInitSetIoInCallerContextCallbackbackWdfDeviceInitSetIoTypeWdfDeviceInitSetPnpPowerEventCallbacksWdfDeviceInitSetPowerInrushWdfDeviceInitSetPowerNotPageableWdfDeviceInitSetPowerPageableWdfDeviceInitSetPowerPolicyEventCallbacksWdfDeviceInitSetPowerPolicyOwnershipWdfDeviceInitSetReleaseHardwareOrderOnFailureWdfDeviceInitSetRemoveLockOptionsWdfDeviceInitSetRequestAttributesWdfDeviceMiniportCreateWdfDeviceOpenRegistryKeyWdfDeviceQueryPropertyWdfDeviceRemoveDependentUsageDeviceObjectWdfDeviceRemoveRemovalRelationsPhysicalDeviceWdfDeviceResumeIdleWdfDeviceRetrieveDeviceInterfaceStringWdfDeviceRetrieveDeviceNameWdfDeviceSetAlignmentRequirementWdfDeviceSetBusInformationForChildrenWdfDeviceSetCharacteristicsWdfDeviceSetDeviceInterfaceStateWdfDeviceSetDeviceStateWdfDeviceSetFailedWdfDeviceSetPnpCapabilitiesWdfDeviceSetPowerCapabilitiesWdfDeviceSetSpecialFileSupportWdfDeviceSetStaticStopRemoveWdfDeviceStopIdleWdfDeviceWdmAssignPowerFrameworkSettingsWdfDeviceWdmDispatchIrpWdfDeviceWdmDispatchIrpToIoQueueWdfDeviceWdmDispatchPreprocessedIrpWdfDeviceWdmGetAttachedDeviceWdfDeviceWdmGetDeviceObjectWdfDeviceWdmGetPhysicalDeviceWdfDmaEnablerConfigureSystemProfileWdfDmaEnablerCreateWdfDmaEnablerGetFragmentLengthWdfDmaEnablerGetMaximumLengthWdfDmaEnablerGetMaximumScatterGatherElementsWdfDmaEnablerSetMaximumScatterGatherElementsWdfDmaEnablerWdmGetDmaAdapterWdfDmaTransactionAllocateResourcesWdfDmaTransactionCancelWdfDmaTransactionCreateWdfDmaTransactionDmaCompletedWdfDmaTransactionDmaCompletedFinalWdfDmaTransactionDmaCompletedWithLengthWdfDmaTransactionExecuteWdfDmaTransactionFreeResourcesWdfDmaTransactionGetBytesTransferredWdfDmaTransactionGetCurrentDmaTransferLengthWdfDmaTransactionGetDeviceWdfDmaTransactionGetRequestWdfDmadfDmaTransactionGetTransferInfoWdfDmaTransactionInitializeWdfDmaTransactionInitializeUsingOffsetWdfDmaTransactionInitializeUsingRequestWdfDmaTransactionReleaseWdfDmaTransactionSetChannelConfigurationCallbackWdfDmaTransactionSetDeviceAddressOffsetWdfDmaTransactionSetImmediateExecutionWdfDmaTransactionSetMaximumLengthWdfDmaTransactionSetTransferCompleteCallbackWdfDmaTransactionStopSystemTransferWdfDmaTransactionWdmGetTransferContextWdfDpcCancelWdfDpcCreateWdfDpcEnqueueWdfDpcGetParentObjectWdfDpcWdmGetDpcWdfDriverCreateWdfDriverGetRegistryPathWdfDriverIsVersionAvailableWdfDriverMiniportUnloadWdfDriverOpenParametersRegistryKeyWdfDriverRegisterTraceInfoWdfDriverRetrieveVersionStringWdfDriverWdmGetDriverObjectWdfFdoAddStaticChildWdfFdoGetDefaultChildListWdfFdoInitAllocAndQueryPropertyWdfFdoInitOpenRegistryKeyWdfdoInitQueryPropertyWdfFdoInitSetDefaultChildListConfigWdfFdoInitSetEventCallbacksWdfFdoInitSetFilterWdfFdoInitWdmGetPhysicalDeviceWdfFdoLockStaticChildListForIterationWdfFdoQueryForInterfaceWdfFdoRetrieveNextStaticChildWdfFdoUnlockStaticChildListFromIterationWdfFileObjectGetDeviceWdfFileObjectGetFileNameWdfFileObjectGetFlagsWdfFileObjectWdmGetFileObjectWdfGetTriageInfoWdfInterruptAcquireLockWdfInterruptCreateWdfInterruptDisableWdfInterruptEnableWdfInterruptGetDeviceWdfInterruptGetInfoWdfInterruptQueueDpcForIsrWdfInterruptQueueWorkItemForIsrWdfInterruptReleaseLockWdfInterruptReportActiveWdfInterruptReportInactiveWdfInterruptSetExtendedPolicyWdfInterruptSetPolicyWdfInterruptSynchronizeWdfInterruptTryToAcquireLockWdfInterruptWdmGetInterruptWdfIoQueueAssignForwardProgressPolicyWdfIoQueueCreateWdfIoQueueDrainWdfIoQueueDrainSynchronouslyWdfIoQueueFindRequestWdfIoQueueGetDeviceWdfIoQueueGetStateWdfIoQueuePurgeWdfIoQueuePurgeSynchronouslyWdfIoQueueReadyNotifyWdfIoQueueRetrieveFoundRequestWdfIoQueueRetrieveNextRequestWdfIoQueueRetrieveRequestByFileObjectWdfIoQueueStartWdfIoQueueStopWdfIoQueueStopAndPurgeWdfIoQueueStopAndPurgeSynchronouslyWdfIoQueueStopSynchronouslyWdfIoResourceListAppendDescriptorWdfIoResourceListCreateWdfIoResourceListsourceListGetCountWdfIoResourceListGetDescriptorWdfIoResourceListInsertDescriptorWdfIoResourceListRemoveWdfIoResourceListRemoveByDescriptorWdfIoResourceListUpdateDescriptorWdfIoResourceRequirementsListAppendIoResListWdfIoRequirementsListGetCountWdfIoRequirementsListGetIoResListWdfIoRequirementsListInsertIoResList WdfIoRequirementsListInsertIoResListWdfIoRequirementsListRemoveWdfIoResourceRequirementsListRemoveByIoResListWdfIoRequirementsListSetInterfaceTypeWdfIoResourceRequirementsListSetSlotNumberWdfIoTargetAllocAndQueryTargetPropertyWdfIoTargetCloseIoTargetCloseForQueryRemoveWdfIoTargetCreateWdfIoTargetFormatRequestForInternalIoctlWdfIoTargetFormatRequestForInternalIoctlOthersWdfIoTargetFormatRequestForIoctlWdfIoTargetFormatRequestForReadWdfIoTargetFormatRequestForWriteWdfIoTargetGetDeviceWdfIoTargetGetStateWdfIoTargetOpenWdfIoTargetPurgeWdfIoTargetQueryForInterfaceWdfIoTargetQueryTargetPropertyWdfIoTargetSendInternalIoctlOthersSynchronouslyWdfIoTargetSendInternalioctlSynchronouslyWdfIoTargetSendioctlSynchronouslyWdfIoTargetSendReadSynchronouslyWdfIoTargetSendWriteSynchronouslyWdfIoTargetStartWdfIoTargetStopWdfIoTargetWdmGetTargetDeviceObjectWdfIoTargetWdmGetFileHandleWdfIoTargetWdmGetTargetFileObjectWdfIoTargetWdmGetPhysicalDeviceWdfLookasideListCreateWdfMemoryAssignBufferWdfMemoryCopyFromBufferWdfMemoryCopyToBufferWdfMemoryCreateWdfMemoryCreateFromLookasideWdfMemoryCreatePreallocatedWdfMemoryGetBufferWdfObjectAcquireLockWdfObjectAllocateContextWdfObjectContextGetObjectWdfObjectCreateWdfObjectDeleteWdfObjectDereferenceWdfObjectDereferenceActualWdfObjectGetTypedContextWorkerWdfObjectQueryWdfObjectReferenceWdfObjectReferenceActualWdfObjectReleaseLockWdfPdoAddEjectionRelationsPhysicalDeviceWdfPdoClearEjectionRelationsDevicesWdfPdoGetParentWdfPdoInitAddCompatibleIDWdfPdoInitAddDeviceTextWdfPdoInitAddHardwareIDWdfPdoInitAllocateWdfPdoInitAllowForwardingRequestToParentWdfPdoInitAssignContainerIDWdfPdoInitAssignDeviceIDWdfPdoInitAssignInstanceIDWdfPdoInitAssignRawDeviceWdfPdoInitSetDefaultLocaleWdfPdoInitSetEventCallbacksWdfPdoMarkMissingWdfPdoRemoveEjectionRelAtionsPhysicalDeviceWdfPdoRequestEjectWdfPdoRetrieveAddressDescriptionWdfPdoRetrieveIdentificationDescriptionWdfPdoUpdateAddressDescriptionWdfRegistryAssignMemoryWdfRegistryAssignMultiStringWdfRegistryAssignStringWdfRegistryAssignULongWdfRegistryAssignUnicodeStringWdfRegistryAssignValueWdfRegistryCloseWdfRegistryCreateKeyWdfRegistryOpenKeyWdfRegistryQueryMemoryWdfRegistryQueryMultiStringWdfRegistryQueryStringWdfRegistryQueryULongWdfRegistryQueryUnicodeStringWdfRegistryQueryValueWdfRegistryRemoveKeyWdfRegistryRemoveValueWdfRegistryWdmGetHandleWdfRequestAllocateTimerWdfRequestCancelSentRequestWdfRequestChangeTargetWdfRequestCompleteWdfRequestCompleteWithInformationWdfRequestCompleteWithPriorityBoostWdfRequestCreateWdfRequestCreateFromIrpWdfRequestFormatRequestUsingCurrentTypeWdfRequestForwardToIoQueueWdfRequestForwardToParentDeviceIoQueueWdfRequestGetCompletIonParamsWdfRequestGetFileObjectWdfRequestGetInformationWdfRequestGetIoQueueWdfRequestGetParametersWdfRequestGetRequestorModeWdfRequestGetStatusWdfRequestIsCanceledWdfRequestIsFrom32BitProcessWdfRequestIsRequestMarkCancelableWdfRequestMarkCancelableExWdfRequestProbeAndLockUserBufferForReadWdfRequestProbeAndLockUserBufferForWriteWdfRequestRequeueWdfRequestRetrieveInputBufferWdfRequestRetrieveInputMemoryWdfRequestRetrieveInputWdmMdlWdfRequestRetrieveOutputBufferWdfRequestRetrieveOutputMemoryWdfRequestRetrieveOutputWdmMdlWdfRequestRetrieveUnsafeUserInputBufferWdfRequestRetrieveUnsafeUserOutputBufferWdfRequestRequestReuseWdfRequestSendWdfRequestSetCompletionRoutineWdfRequestSetInformationWdfRequestStopAcknowledgeWdfRequestUnmarkCancelableWdfRequestWdmFormatUsingStackLocationWdfRequestWdmGetIrpWdfSpinLockAcquireWdfSpinLockCreateWdfSpinLockReleaseWdfStringCreateWdfStringGetUnicodeStringWdfTimerCreateWdfTimerGetParentObjectWdfTimerStartWdfTimerStopWdfUsbInterfaceGetConfiguredPipeWdfUsbInterfaceGetConfiguredSettingIndexWdfUsbInterfaceGetDescriptorWdfUsbInterfaceGetEndpointInformationWdfUsbInterfaceGetInterfaceNumberWdfUsbInterfaceGetNumConfiguredPipesWdfUsbInterfaceGetNumEndpointsWdfUsbInterfaceGetNumSettingsWdfUsbInterfaceSelectSettingWdfUsbTargetDeviceAllocAndQueryStringWdfUsbTargetDeviceCreateWdfUsbTargetDeviceCreateIsochUrbWdfUsbTargetDeviceCreateUrbWdfUsbTargetDeviceCreateWithParametersWdfUsbTargetDeviceCyclePortSynchronouslyWdfUsbTargetDeviceFormatRequestForControlTransferWdfUsbTargetDevIceFormatRequestForCyclePortWdfUsbTargetDeviceFormatRequestForStringWdfUsbTargetDeviceFormatRequestForUrbWdfUsbTargetDeviceGetDeviceDescriptorWdfUsbTargetDeviceGetInterfaceWdfUsbTargetDeviceGetNumInterfacesWdfUsbTargetDeviceIsConnectedSynchronousWdfUsbTargetDeviceQueryStringWdfUsbTargetDeviceQueryUsbCapabilityWdfUsbTargetDeviceResetPortSynchronouslyWdfUsbTargetDeviceRetrieveConfigDescriptorWdfUsbTargetDeviceRetrieveCurrentFrameNumberWdfUsbTargetDeviceRetrieveInformationWdfUsbTargetDeviceSelectConfigWdfUsbTargetDeviceSendControlTransferSynchronouslyWdfUsbTargetDeviceSendUrbSynchronouslyWdfUsbTargetDeviceWdmGetConfigurationHandleWdfUsbTargetPipeAbortSynchronouslyWdfUsbTargetPipeConfigContinuousReaderWdfUsbTargetPipeFormatRequestForAbortWdfUsbTargetPipeFormatRequestForReadWdfUsbTargetPipeFormatRequestForResetWdfUsbTargetPipeFormatRequestForUrbWdfUsbTargetPipeFormatRequestForWriteWdfUsbTargetPipeGetInformationWdfUsbTargetPipeGetIoTargetWdfUsbTargetPipeGetTypeWdfUsbTargetPipeIsInEndpointWdfUsbTargetPipeIsOutEndpointWdfUsbTargetPipeReadSynchronouslyWdfUsbTargetPipeResetSynchronouslyWdfUsbTargetPipeSendUrbSynchronouslyWdfUsbTargetPipeSetNoMaximumPacketSizeCheckWdfUsbTargetPipeWdmGetPipeHandleWdfUsbTargetPipeWriteSynchronlyWdfVerifierDbgBreakPointWdfVerifierKeBuBugCheckWdfWaitLockAcquireWdfWaitLockCreateWdfWaitLockReleaseWdfWdmDeviceGetWdfDeviceHandleWdfWdmDriverGetWdfDriverHandleWdfWmiInstanceCreateWdfWmiInstanceDeregisterWdfWmiInstanceFireEventWdfWmiInstanceGetDeviceWdfWmiInstanceGetProviderWdfWmiInstanceRegisterWdfWmiProviderCreateWdfWMImiProviderGetDeviceWdfWmiProviderGetTracingHandleWdfWmiProviderIsEnabledWdfWorkItemCreateWdfWorkItemEnqueueWdfWorkItemFlushWdfWorkItemGetParentObject