DriverCreate rule (kmdf)

DriverCreate 规则指定使用内核模式驱动程序框架 (KMDF) 的驱动程序必须调用 WdfDriverCreate 方法,以便从其 DriverEntry 例程中创建框架驱动程序对象。

驱动程序模型:KMDF

如何测试

编译时

运行 静态驱动程序验证程序 并指定 DriverCreate 规则。

使用以下步骤运行代码分析:
  1. 准备代码 (使用角色类型声明) 。
  2. 运行静态驱动程序验证程序。
  3. 查看和分析结果。

有关详细信息,请参阅 使用静态驱动程序验证程序查找驱动程序中的缺陷

适用于

WdfChildListAddOrUpdateChildDescriptionAsPresentWdfChildListBeginIterationWdfChildListBeginScanWdfChildListCreateWdfChildListEndIterationWdfChildListEndScanWdfChildListGetDeviceWdfChildListRequestChildEjectWdfChildListRetrieveAddressDescriptionWdfChildListRetrieveNextDeviceWdfChildListRetrievePdoWdfChildListUpdateAllChildDescriptionsAsPresentWdfChildListUpdateChildDescriptionAsMissingWdfCmResourceListAppendDescriptorWdfCmResourceListGetCountWdfCmResourceListsourceListGetDescriptorWdfCmResourceListInsertDescriptorWdfCmResourceListRemoveWdfCmResourceListRemoveByDescriptorWdfCollectionAddWdfCollectionCreateWdfCollectionGetCountWdfCollectionGetFirstItemWdfCollectionGetItemWdfCollectionGetLastItemWdfCollectionRemoveWdfCollectionRemoveItemWdfCommonBufferCreateWdfCommonBufferCreateWithConfigWdfCommonBufferGetAlignedLogicalAddressWdfCommonBufferGetAlignedVirtualAddressWdfCommonBufferGetLengthWdfControlDeviceInitAllocateWdfControlDeviceInitSetShutdownNotificationWdfControlFinishInitializingWdfDeviceAddDependentUsageDeviceObjectWdfDeviceAddQueryInterfaceWdfDeviceAddRemovalRelationsPhysicalDeviceWdfDeviceAllocAndQueryPropertyWdfDeviceAssignMofResourceNameWdfDeviceAssignS0IdleSettingsWdfDeviceAssignSxWakeSettingsWdfDeviceClearRemovalRelationsDevicesWdfDeviceConfigureRequestDispatchingWdfDeviceConfigureWdmIrpDispatchCallbackWdfDeviceCreateWdfDeviceCreateDeviceInterfaceWdfDeviceCreateSymbolicLinkWdfDeviceEnqueueRequestWdfDeviceGetAlignmentRequirementWdfDeviceGetCharacteristicsWdfDeviceGetDefaultQueueWdfDeviceGetDevicePnpStateWdfDeviceGetDevicePowerPolicyStateWdfDeviceGetDevicePowerStateWdfDeviceGetDeviceGetDeviceGetDriverWdfDeviceGetFileObjectWdfDeviceGetIoTargetWdfDeviceGetSystemPowerActionWdfDeviceIndicateWakeStatusWdfDeviceInitAssignNameWdfDeviceInitAssignSDDLStringWdfDeviceInitAssignWdmIrpPreprocessCallbackWdfDeviceInitFreeWdfDeviceInitRegisterPnpStateChangeCallbackWdfDeviceInitRegisterPowerPolicyStateChangeCallbackWdfDeviceInitRegisterPowerStateChangeCallbackWdfDeviceInitSetCharacteristicsWdfDeviceInitSetDeviceClassWdfDeviceInitSetDeviceTypeWdfDeviceInitSetExclusiveWdfDeviceInitSetFileObjectConfigWdfDeviceInitSetIoInCallerContextCallbackWdfDeviceInitSetIoTypeWdfDeviceInitSetPnpPowerEventCallbacksWdfDeviceInitSetPowerInrushWdfDeviceInitSetPowerNotPageableWdfDeviceInitSetPowerPageableWdfDeviceInitSetPowerPolicyEventCallbacksWdfDeviceInitSetPowerPolicyOwnershipWdfDeviceInitSetReleaseHardwareOrderOnFailureWdfDeviceInitSetRemoveLockOptionsWdfDeviceInitSetRequestAttributesWdfDeviceMiniportCreateWdfDeviceOpenRegistryKeyWdfDevicePropertyWdfDeviceRemoveDependentUsageDeviceObjectWdfDeveviceRemoveRemovalRelationsPhysicalDeviceWdfDeviceResumeIdleWdfDeviceRetrieveDeviceInterfaceStringWdfDeviceRetrieveDeviceNameWdfDeviceSetAlignmentRequirementWdfDeviceSetBusInformationForChildrenWdfDeviceSetCharacteristicsWdfDeviceSetDeviceInterfaceStateWdfDeviceSetDeviceStateWdfDeviceSetFailedWdfDeviceSetPnpCapabilitiesWdfDeviceSetPowerCapabilitiesWdfDeviceSetSpecialFileSupportWdfDeviceSetStaticStopRemoveWdfDeviceStopIdleWdfDeviceWdmAssignPowerFrameworkSettingsWdfDeviceWdmDispatchIrpWdfDeviceWdmDispatchIrpToIoQueueWdfDeviceWdmDispatchPreprocessedIrpWdfDeviceWdmGetAttachedDeviceWdfDeviceWdmGetDeviceObjectWdfDeviceWdmGetPhysicalDeviceWdfDmaEnablerConfigureSystemProfileWdfDmaEnablerCreateWdfDmaEnablerGetFragmentLengthWdfDmaEnablerGetMaximumLengthWdfDmaEnablerGetMaximumScatterGatherElementsWdfDmaEnablerSetMaximumScatterGatherElementsWdfDmaEnablerWdmGetDmaAdapterWdfDmaTransactionAllocateResourcesWdfDmaTransactionCancelWdfDmaTransactionCreateWdfDmaTransactionDmaCompletedWdfDmaTransactionDmaCompletedFinalWdfDmaTransactionDmaCompletedWithLengthWdfDmaTransactionExecuteWdfDmaTransactionFreeResourcesWdfDmaTransactionGetBytesTransferredWdfDmaTransactionGetCurrentDmaTransferLengthWdfDmaTransactionGetDeviceWdfDmaTransactionGetRequestWdfDmaTransactionGetTransferInfoWdfDmaTransactionInitializeWdfDmaTransactionInitializeUsingOffsetWdfDmaTransactionInitializeUsingRequestWdfDmaTransactionReleaseWdfDmaTransactionSetChannelConfigurationCallbackWdfDmaTransactionSetDeviceAddressOffsetWdfDmaTransactionSetImmediateExecutionWdfDmaTransactionSetMaximumLengthWdfDmaTransactionSetTransferCompleteCallbackWdfDmaTransactionStopSystemTransferWdfDmaTransactionWdmGetTransferContextWdfDpcCancelWdfDpcCreateWdfDpcEnqueueWdfDpcGetParentObjectWdfDpcWdmGetDpcWdfDriverCreateWdfDriverGetRegistryPathWdfDriverIsVersionAvailableWdfDriverMiniportUnloadWdfDriverOpenParametersRegistryKeyWdfDriverRegisterTraceInfoWdfDriverRetrieveVersionStringWdfDriverWdmGetDriverObjectWdfFdoAddStaticChildWdfFdoGetDefaultChildListWdfFdoInitAllocAndQueryPropertyWdfFdoInitOpenRegistryKeyWdfFdoInitQueryPropertyWdfFdoInitSetDefaultChildListConfigWdfFdoInitSetEventCallbacksWdfFdoInitSetFilterWdfFdoInitWdmGetPhysicalDeviceWdfFdoLockStaticChildListForIterationWdfFdoQueryForInterfaceWdfFdoRetrieveNextStaticChildWdfFdoUnlockStaticChildListFromIterationWdfFileObjectGetDeviceWdfFileObjectGetFileNameWdfFileObjectGetFlagsWdfFileObjectWdmGetFileObjectWdfGetTriageInfoWdfInterruptAcquireLockWdfInterruptCreateWdfInterruptDisableWdfInterruptEnableWdfInterruptGetDeviceWdfInterruptGetInfoWdfInterruptQueueDpcForIsrWdfInterruptQueueWorkItemForIsrWdfInterruptReleaseLockWdfInterruptReportActiveWdfInterruptReportInactiveWdfInterruptSetExtendedPolicyWdfInterruptSetPolicyWdfInterruptSynchronizeWdfInterruptTryToAcquireLockWdfInterruptWdmGetInterruptWdfIoQueueAssignForwardProgressPolicyWdfIoQueueCreateWdfIoQueueDrainWdfIoQueueDrainSynchronouslyWdfIoQueueFindRequestWdfIoQueueGetDeviceWdfIoQueueGetStateWdfIoQueuePurgeWdfIoQueuePurgeSynchronouslyWdfIoQueueReadyNotifyWdfIoQueueRetrieveFoundRequestWdfIoQueueRetrieveNextRequestWdfIoQueueRetrieveRequestByFileObjectWdfIoQueueStartWdfIoQueueStopWdfIoQueueStopAndPurgeWdfIoQueueStopAndPurgeSynchronouslyWdfIoQueueStopSynchronouslyWdfIoResourceListAppendDescriptorWdfIoResourceListCreateWdfIoResourceListGetCountWdfIoResourceListGetDescriptorWdfIoResourceListInsertDescriptorWdfIoResourceListRemoveWdfIoResourceListRemoveByDescriptorWdfIoResourceListUpdateDescriptorWdfIoResourceRequirementsListAppendIoResListWdfIoResourceRequirementsListGetCountWdfIoResourceRequirementsListGetIoResListWdfIoResourceRequirementsListInsertIoResListWdfIoResourceRequirementsListRemoveWdfIoResourceRequirementsListRemoveByIoResListWdfIoResourceRequirementsListSetInterfaceTypeWdfIoResourceRequirementsListSetSlotNumberWdfIoTargetAllocAndQueryTargetPropertyWdfIoTargetCloseWdfIoTargetCloseForQueryRemoveWdfIoTargetFormatRequestForInternalIoctlWdfIoTargetFormatRequestForInternalIoctlOthersWdfIoTargetFormatRequestForIoctlWdfIoTargetFormatRequestForReadWdfIoTargetFormatRequestForWriteWdfIoTargetGetDeviceWdfIoTargetGetStateWdfIoTargetOpenWdfIoTargetPurgeWdfIoTargetQueryForInterfaceWdfIoTargetQueryTargetPropertyWdfIoTargetSendInternalIoctlOthersSynchronouslyWdfIoTargetSendInternalIoctlSynchronouslyWdfIoTargetSendIoctlSynchronouslyWdfIoTargetSendReadSynchronouslyWdfIoTargetSendWriteSynchronouslyWdfIoTargetStartWdfIoTargetStopWdfIoTargetWdmGetTargetDeviceObjectWdfIoTargetWdmGetTargetFileHandleWdfIoTargetWdmGetTargetFileObjectWdfIoTargetWdmGetTargetPhysicalDeviceWdfLookasideListCreateWdfMemoryAssignBufferWdfMemoryCopyFromBufferWdfMemoryCopyToBufferWdfMemoryCreateWdfMemoryCreateFromLookasideWdfMemoryCreatePreallocatedWdfMemoryGetBufferWdfObjectAcquireLockWdfObjectAllocateContextWdfObjectContextGetObjectWdfObjectCreateWdfObjectDeleteWdfObjectDereferenceWdfObjectDereferenceActualWdfObjectGetTypedContextWorkerWdfObjectQueryWdfObjectReferenceWdfObjectReference WdfObjectReferenceActualWdfObjectReleaseLockWdfPdoAddEjectionRelationsPhysicalDeviceWdfPdoClearEjectionRelationsDevicesWdfPdoGetParentWdfPdoInitAddCompatibleIDWdfPdoInitAddDeviceTextWdfPdoInitAddHardwareIDWdfPdoInitAllocateWdfPdoInitAllowForwardingRequestToParentWdfPdoInitAssignContainerIDWdfPdoInitAssignDeviceIDWdfPdoInitAssignInstanceIDWdfPdoInitAssignRawDeviceWdfPdoInitSetDefaultLocaleWdfPdoInitSetEventCallbacksWdfPdoMarkMissingWdfPdoRemoveEjectionRelationsPhysicalDeviceWdfPdoRequestEjectWdfPdoRetrieveAddressDescriptionWdfPdoRetrieveIdentificationDescriptionWdfPdoUpdateAddressDescriptionWdfRegistryAssignMemoryWdfRegistryAssignMultiStringWdfRegistryAssignStringWdfRegistryAssignULongWdfRegistryAssignUnicodeStringWdfRegistryAssignValueWdfRegistryCloseWdfRegistryCreateKeyWdfRegistryOpenKeyWdfRegistryQueryMemoryWdfRegistryQueryMultiStringWdfRegistryQueryULongWdfRegistryQueryUnicodeStringWdfRegistryQueryValueWdfRegistryRemoveKeyWdfRegistryRemoveValueWdfRegistryWdmGetHandleWdfRequestAllocateTimerWdfRequestCancelSentRequestWdfRequestChangeTargetWdfRequestCompleteWdfRequestCompleteWithInformationWdfRequestCompleteWithPriorityBoostWdfRequestCreateWdfRequestCreateFromIrpWdfRequestFormatRequestUsingCurrentTypeWdfRequestForwardToIoQueueWdfRequestForwardToParentDeviceIoQueueWdfRequestGetCompletionParamsWdfRequestGetFileObjectWdfRequestGetInformationWdfRequestGetIoQueueWdfRequestGetParametersWdfRequestGetRequestorModeWdfRequestGetStatusWdfRequestIsCanceledWdfRequestIsFrom32BitProcessWdfRequestIsReservedWdfRequestMarkCancelableWdfRequestMarkCancelableExWdfRequestProbeAndLockUserBufferForReadWdfRequestProbeAndLockUserBufferForWriteWdfRequestRequeueWdfRequestRetrieveInputBufferWdfRequestRetrieveInputMemoryWdfRequestRetrieveInputWdmMdlWdfRequestRetrieveOutputBufferWdfRequestRetrieveOutputMemoryWdfRequestRetrieveOutputWdmMdlWdfRequestRetrieveUnsafeUserInputBufferWdfRequestRetrieveUnsafeUserOutputBufferWdfRequestReuseWdfRequestSendWdfRequestSetCompletionRoutineWdfRequestSetInformationWdfRequestStopAcknowledgeWdfRequestUnmarkCancelableWdfRequestWdmFormatUsingStackLocationWdfRequestWdmGetIrpWdfSpinLockAcquireWdfSpinLockCreateWdfSpinLockReleaseWdfStringCreateWdfStringGetUnicodeStringWdfTimerCreateWdfTimerGetParentObjectWdfTimerStartWdfTimerStopWdfUsbInterfaceGetConfiguredPipeWdfUsbInterfaceGetConfiguredSettingIndexWdfUsbInterfaceGetDescriptorWdfUsbInterfaceGetEndpointInformationWdfUsbInterfaceGetInterfaceNumberWdfUsbInterfaceGetNumConfiguredPipesWdfUsbInterfaceGetNumEndpointsWdfUsbInterfaceGetNumSettingsWdfUsbInterfaceSelectSettingWdfUsbTargetDeviceAllocAndQueryStringWdfUsbTargetDeviceCreateWdfUsbTargetDeviceCreateIsochUrburbWdfUsbTargetDeviceCreateUrbWdfUsbTargetDeviceCreateWithParametersWdfUsbTargetDeviceCyclePortSynchronouslyWdfUsbTargetDeviceFormatRequestForControlTransferWdfUsbTargetDeviceFormatRequestForCyclePortWdfUsbTargetDeviceFormatRequestForStringWdfUsbTargetDeviceFormatRequestForUrbWdfUsbTargetDeviceGetDeviceDescriptorWdfUsbTargetDeviceGetInterfaceWdfUsbTargetDeviceGetNumInterfacesWdfUsbTargetDeviceIsConnectedSynchronousWdfUsbTargetDeviceQueryStringWdfUsbTargetDeviceQueryUsbCapabilityWdfUsbTargetDeviceResetPortSynchronouslyWdfUsbTargetDeviceRetrieveConfigDescriptorWdfUsbTargetDeviceRetrieveCurrentFrameNumberWdfUsbTargetDeviceRetrieveInformationWdfUsbTargetDeviceSelectConfigWdfUsbTargetDeviceSendControlTransferSynchronouslyWdfUsbTargetDeviceSendUrbSynchronouslyWdfUsbTargetDeviceWdmGetConfigurationHandleWdfUsbTargetPipeAbortSyncWdfUsbTargetPipeConfigContinuousReaderWdfUsbTargetPipeFormatRequestForAbortWdfUsbTargetPipeFormatRequestForReadWdfUsbTargetPipeFormatRequestForResetWdfUsbTargetPipeFormatRequestForUrbWdfUsbTargetPipeFormatRequestForWriteWdfUsbTargetPipeGetInformationWdfUsbTargetPipeGetIoTargetWdfUsbTargetPipeGetTypeWdfUsbUsbGetPipeGetTypeTargetPipeIsInEndpointWdfUsbTargetPipeIsOutEndpointWdfUsbTargetPipeReadSynchronouslyWdfUsbTargetPipeResetSynchronouslyWdfUsbTargetPipeSendUrbSynchronouslyWdfUsbTargetPipeSetNoMaximumPacketSizeCheckWdfUsbTargetPipeWdmPipeHandleWdfUsbTargetPipeWriteSynchronouslyWdfVerifierDbgBreakPointWdfVerifierKeBug 检查WdfWaitLockAcquireWdfWaitLockCreateWdfWaitLockReleaseWdfWdmDeviceGetWdfDeviceHandleWdfWdmDriverGetWdfDriverHandleWdfWmiInstanceCreateWdfWmiInstanceDeregisterWdfWmiInstanceFireEventWdfWmiInstanceGetDeviceWdfWmiInstanceGetProviderWdfWmiInstanceRegisterWdfWmiProviderCreateWdfWmiProviderGetDeviceWdfWmiProviderGetTracingHandleWdfWmiProviderIsEnabledWdfWorkItemCreateWdfWorkItemEnqueueWdfWorkItemFlushWdfWorkItemGetParentObject