/*++

    Copyright (c) Microsoft Corporation.  All rights reserved.

Rule Name:

    HwStorPortProhibitedDDIs

Domain:

    storport

Rule ID:

    Not Applicable

Description:

    This rule contains a list of WDM DDIs (excluding interlocked functions) 
    that should not be called in physical StorPort miniport drivers.
	
    Question: Do we need modifications (such as an #ifdef) that checks the driver is a physical miniport?

Help Link:

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

--*/



#include "ntddk_slic.h"

[
CmRegisterCallback,
CmUnRegisterCallback,
ExAcquireFastMutex,
ExAcquireResourceExclusiveLite,
ExAcquireResourceSharedLite,
ExAcquireSharedStarveExclusive,
ExAcquireSharedWaitForExclusive,
ExAllocatePoolWithQuota,
ExAllocatePoolWithQuotaTag,
ExAllocatePoolWithTag,
ExAllocatePoolWithTagPriority,
ExConvertExclusiveToSharedLite,
ExCreateCallback,
ExDeletePagedLookasideList,
ExDeleteResourceLite,
ExInitializePagedLookasideList,
ExIsProcessorFeaturePresent,
ExRaiseAccessViolation,
ExRaiseDatatypeMisalignment,
ExRaiseStatus,
ExRegisterCallback,
ExSetTimerResolution,
ExTryToAcquireFastMutex,
ExUnregisterCallback,
ExUuidCreate,
IoAllocateController,
IoAssignArcName,
IoAttachDevice,
IoBuildDeviceIoControlRequest,
IoCallDriver,
IofCallDriver,
IoCheckShareAccess,
IoConnectInterrupt,
IoCreateController,
IoCreateDevice,
IoCreateDeviceSecure,
IoCreateFile,
IoCreateNotificationEvent,
IoCreateSymbolicLink,
IoCreateSynchronizationEvent,
IoCreateUnprotectedSymbolicLink,
IoDeassignArcName,
IoDeleteController,
IoDeleteDevice,
IoDeleteSymbolicLink,
IoDetachDevice,
IoDisconnectInterrupt,
IoFreeController,
IoGetConfigurationInformation,
IoGetDeviceObjectPointer,
IoGetDeviceToVerify,
IoGetDmaAdapter,
IoGetFileObjectGenericMapping,
IoGetInitialStack,
IoInitializeTimer,
IoIsWdmVersionAvailable,
IoRaiseHardError,
IoRaiseInformationalHardError,
IoReadPartitionTable,
IoRegisterDeviceInterface,
IoRegisterDriverReinitialization,
IoRegisterShutdownNotification,
IoRemoveShareAccess,
IoSetDeviceInterfaceState,
IoSetPartitionInformation,
IoSetShareAccess,
IoStartNextPacket,
IoUnregisterShutdownNotification,
IoUpdateShareAccess,
IoWMIAllocateInstanceIds,
IoWMIRegistrationControl,
IoWritePartitionTable,
KeAcquireGuardedMutex,
KeAcquireGuardedMutexUnsafe,
KeAcquireSpinLock,
KfReleaseSpinLock,
KeAcquireSpinLockAtDpcLevel,
KeReleaseSpinLockFromDpcLevel,
KeAreAllApcsDisabled,
KeAreApcsDisabled,
KeCancelTimer,
KeClearEvent,
KeDelayExecutionThread,
KeDeregisterNmiCallback,
KeEnterCriticalRegion,
KeEnterGuardedRegion,
KeInitializeDeviceQueue,
KeInitializeSemaphore,
KeInitializeTimer,
KeInitializeTimerEx,
KeInsertByKeyDeviceQueue,
KeInsertDeviceQueue,
KeLeaveCriticalRegion,
KeLeaveGuardedRegion,
KfLowerIrql,
KePulseEvent,
KeQueryActiveProcessors,
KeRaiseIrql,
KeRaiseIrqlToDpcLevel,
KeReadStateEvent,
KeReadStateTimer,
KeReleaseSpinLock,
KeRegisterNmiCallback,
KeReleaseGuardedMutex,
KeReleaseGuardedMutexUnsafe,
KeReleaseMutex,
KeRemoveByKeyDeviceQueue,
KeRemoveDeviceQueue,
KeRemoveEntryDeviceQueue,
KeResetEvent,
KeSetEvent,
KeSetTimer,
KeSetTimerEx,
KeTryToAcquireGuardedMutex,
KeWaitForMutexObject,
KeWaitForMultipleObjects,
KeWaitForSingleObject,
KeLowerIrql,
MmAllocateNonCachedMemory,
MmAllocatePagesForMdl,
MmFreeContiguousMemory,
MmFreeNonCachedMemory,
MmFreePagesFromMdl,
MmLockPagableDataSection,
MmLockPagableSectionByHandle,
MmPageEntireDriver,
MmResetDriverPaging,
MmSecureVirtualMemory,
MmUnlockPagableImageSection,
MmUnsecureVirtualMemory,
ObGetObjectSecurity,
ObReferenceObjectByHandle,
ObReleaseObjectSecurity,
PoCallDriver,
ProbeForRead,
ProbeForWrite,
PsCreateSystemThread,
PsGetVersion,
PsSetCreateProcessNotifyRoutine,
PsSetCreateThreadNotifyRoutine,
PsSetLoadImageNotifyRoutine,
PsTerminateSystemThread,
RtlDeleteRegistryValue,
ZwClose,
ExReleaseFastMutex,
ExTryToAcquireFastMutex,
ExGetExclusiveWaiterCount,
ExGetSharedWaiterCount,
ExInitializeResourceLite,
ExReinitializeResourceLite,
ExIsResourceAcquiredExclusiveLite,
ExReleaseResourceForThreadLite,
ExIsResourceAcquiredSharedLite,
ExIsResourceAcquiredShared,
WdmlibIoCreateDeviceSecure,
IoWritePartitionTableEx,
ObReferenceObjectByHandleWithTag,
PsSetCreateProcessNotifyRoutineEx,
ExIsResourceAcquired,
ExIsResourceAcquiredExclusive,
ExInitializeResource,
KfRaiseIrql,
ExAcquireFastMutexUnsafe,
ExReleaseFastMutexUnsafe,
ExAcquireSpinLock,
ExAcquireSpinLockAtDpcLevel,
ExReleaseSpinLock,
ExReleaseSpinLockFromDpcLevel,
KeReleaseSpinLockFromDpcLevel,
KeAcquireSpinLockAtDpcLevel,
KeReleaseInStackQueuedSpinLock,
KeReleaseInStackQueuedSpinLockFromDpcLevel,
ExIsResourceAcquiredLite,
ExSetResourceOwnerPointer,
ExSetResourceOwnerPointerEx,
IoBuildAsynchronousFsdRequest,
IoBuildSynchronousFsdRequest,
IoCancelIrp,
IoCompleteRequest,
IoConnectInterruptEx,
IoSetCompletionRoutineEx,
FsRtlCancellableWaitForMultipleObjects,
FsRtlCancellableWaitForSingleObject,
KeGetCurrentIrql,
KeInsertQueue,
KeRemoveQueue,
KeInsertHeadQueue,
KeRemoveQueueDpc,
KeInsertQueueDpc,
KeFlushQueuedDpcs,
KeAcquireSpinLockRaiseToDpc,
KfAcquireSpinLock,
KeTryToAcquireSpinLockAtDpcLevel,
KeAcquireInStackQueuedSpinLock,
KeAcquireInStackQueuedSpinLockAtDpcLevel,
KeAcquireInStackQueuedSpinLockForDpc,
KeReleaseSpinLock,
KeAcquireInStackQueuedSpinLockAtDpcLevel,
KeAcquireInStackQueuedSpinLockForDpc,
KeTryToAcquireQueuedSpinLock,
KeAcquireSpinLockForDpc,
KeReleaseSpinLockForDpc,
KfReleaseSpinLock,
KeReleaseQueuedSpinLock,
KeReleaseMutant,
KeReleaseInStackQueuedSpinLock,
KeReleaseInStackQueuedSpinLockFromDpcLevel,
KeReleaseInStackQueuedSpinLockForDpc,
KeReadStateMutex,
KeInitializeMutex,
KeInitializeGuardedMutex,
ExReleaseFastMutexUnsafe,
KeAcquireInterruptSpinLock,
IoAcquireVpbSpinLock,
IoAcquireCancelSpinLock,
ExEnterCriticalRegionAndAcquireSharedWaitForExclusive,
ExEnterCriticalRegionAndAcquireResourceShared,
ExEnterCriticalRegionAndAcquireResourceExclusive,
KefAcquireSpinLockAtDpcLevel,
ExAcquireRundownProtectionEx,
ExAcquireRundownProtectionCacheAwareEx,
ExAcquireRundownProtectionCacheAware,
ExAcquireRundownProtection,
SeReleaseSubjectContext,
KeReleaseSemaphore,
KeReleaseInterruptSpinLock,
IoReleaseVpbSpinLock,
IoReleaseCancelSpinLock,
KefReleaseSpinLockFromDpcLevel,
ExWaitForRundownProtectionReleaseCacheAware,
ExWaitForRundownProtectionRelease,
ExReleaseRundownProtectionEx,
ExReleaseRundownProtectionCacheAwareEx,
ExReleaseRundownProtectionCacheAware,
ExReleaseRundownProtection,
ExReleaseResourceLite,
ExReleaseResourceAndLeaveCriticalRegion,
ExGetExclusiveWaiterCount,
SeLockSubjectContext,
NtLockFile,
MmUnmapLockedPages,
MmProbeAndLockProcessPages,
MmProbeAndLockPages,
MmMapLockedPagesWithReservedMapping,
MmMapLockedPagesSpecifyCache,
MmMapLockedPages,
KeInitializeSpinLock,
FsRtlUninitializeFileLock,
FsRtlProcessFileLock,
FsRtlPrivateLock,
FsRtlInitializeFileLock,
FsRtlGetNextFileLock,
FsRtlFreeFileLock,
FsRtlFastCheckLockForWrite,
FsRtlFastCheckLockForRead,
FsRtlCheckLockForWriteAccess,
FsRtlCheckLockForReadAccess,
FsRtlAllocateFileLock,
KeTestSpinLock,
SeUnlockSubjectContext,
NtUnlockFile,
MmUnlockPages,
FsRtlFastUnlockSingle,
FsRtlFastUnlockAllByKey,
FsRtlFastUnlockAll,
KeReadStateSemaphore,
ZwWaitForSingleObject,
FsRtlIncrementCcFastReadWait,
FsRtlIncrementCcFastReadNoWait,
CcWaitForCurrentLazyWriterActivity,
PsReferencePrimaryToken,
PsReferenceImpersonationToken,
ObReferenceObjectByPointer,
MmDoesFileHaveUserWritableReferences,
IoGetAttachedDeviceReference,
ObReferenceObjectByPointerWithTag,
IoAcquireRemoveLockEx,
IoReleaseRemoveLockEx,
IoReleaseRemoveLockAndWaitEx,
KeSaveFloatingPointState,
IoGetDeviceInterfaceAlias,
IoGetDeviceInterfaces,
IoGetDeviceProperty,
IoOpenDeviceInterfaceRegistryKey,
IoOpenDeviceRegistryKey,
IoRegisterBootDriverReinitialization,
IoRegisterLastChanceShutdownNotification,
IoRegisterPlugPlayNotification,
IoReportDetectedDevice,
IoReportTargetDeviceChange,
IoReportTargetDeviceChangeAsynchronous,
IoSetPartitionInformationEx,
IoUnregisterPlugPlayNotification,
SeAccessCheck,
SeAssignSecurity,
SeAssignSecurityEx,
SeDeassignSecurity,
SeSinglePrivilegeCheck,
SeValidSecurityDescriptor,
ZwCancelTimer,
ZwCreateDirectoryObject,
ZwCreateFile,
ZwCreateKey,
ZwCreateTimer,
ZwDeleteKey,
ZwDeleteValueKey,
ZwEnumerateKey,
ZwEnumerateValueKey,
ZwMakeTemporaryObject,
ZwMapViewOfSection,
ZwOpenFile,
ZwOpenKey,
ZwOpenSection,
ZwOpenSymbolicLinkObject,
ZwOpenTimer,
ZwQueryInformationFile,
ZwQueryKey,
ZwQuerySymbolicLinkObject,
ZwQueryValueKey,
ZwReadFile,
ZwSetInformationFile,
ZwSetInformationThread,
ZwSetTimer,
ZwSetValueKey,
ZwUnmapViewOfSection,
ZwWriteFile,
FsRtlAreNamesEqual,
FsRtlBalanceReads,
FsRtlCopyWrite,
FsRtlDeregisterUncProvider,
FsRtlDissectName,
FsRtlDoesNameContainWildCards,
FsRtlGetFileSize,
FsRtlIsNameInExpression,
FsRtlMdlReadCompleteDev,
FsRtlMdlWriteCompleteDev,
FsRtlNotifyFilterChangeDirectory,
FsRtlNotifyFilterReportChange,
FsRtlNotifyFullChangeDirectory,
FsRtlNotifyFullReportChange,
FsRtlRegisterUncProvider,
FsRtlRegisterUncProviderEx,
FsRtlRemoveDotsFromPath,
FsRtlValidateReparsePointBuffer,
HalExamineMBR,
HalGetAdapter,
HalGetInterruptVector,
IoGetDeviceNumaNode,
IoGetDevicePropertyData,
IoReadPartitionTableEx,
IoReplacePartitionUnit,
IoSetDevicePropertyData,
IoUnregisterPlugPlayNotificationEx,
KeQueryPriorityThread,
KeQueryRuntimeThread,
KeRevertToUserAffinityThreadEx,
KeSetSystemAffinityThread,
KeSetSystemGroupAffinityThread,
MmAddPhysicalMemory,
MmCreateMirror,
MmGetPhysicalMemoryRanges,
MmGetSystemRoutineAddress,
MmPrefetchPages,
MmRemovePhysicalMemory,
PsAssignImpersonationToken,
PsDereferenceImpersonationToken,
PsDereferencePrimaryToken,
PsDisableImpersonation,
PshedRegisterPlugin,
PsImpersonateClient,
PsRemoveLoadImageNotifyRoutine,
PsRestoreImpersonation,
PsRevertToSelf,
SeSinglePrivilegeCheck,
ZwAllocateLocallyUniqueId,
ZwAllocateVirtualMemory,
ZwCommitComplete,
ZwCommitEnlistment,
ZwCommitTransaction,
ZwCreateEnlistment,
ZwCreateEvent,
ZwCreateKeyTransacted,
ZwCreateResourceManager,
ZwCreateTransaction,
ZwCreateTransactionManager,
ZwDeleteFile,
ZwDeviceIoControlFile,
ZwDisplayString,
ZwDuplicateObject,
ZwDuplicateToken,
ZwEnumerateTransactionObject,
ZwFlushBuffersFile,
ZwFreeVirtualMemory,
ZwFsControlFile,
ZwGetNotificationResourceManager,
ZwLoadDriver,
ZwLockFile,
ZwNotifyChangeKey,
ZwNotifyChangeMultipleKeys,
ZwOpenDirectoryObject,
ZwOpenEnlistment,
ZwOpenEvent,
ZwOpenKeyEx,
ZwOpenKeyTransacted,
ZwOpenKeyTransactedEx,
ZwOpenProcess,
ZwOpenProcessTokenEx,
ZwOpenResourceManager,
ZwOpenThreadTokenEx,
ZwOpenTransaction,
ZwOpenTransactionManager,
ZwPowerInformation,
ZwPrepareComplete,
ZwPrepareEnlistment,
ZwPrePrepareComplete,
ZwPrePrepareEnlistment,
ZwQueryDirectoryFile,
ZwQueryEaFile,
ZwQueryFullAttributesFile,
ZwQueryInformationEnlistment,
ZwQueryInformationResourceManager,
ZwQueryInformationToken,
ZwQueryInformationTransaction,
ZwQueryInformationTransactionManager,
ZwQueryMultipleValueKey,
ZwQueryObject,
ZwQueryQuotaInformationFile,
ZwQuerySecurityObject,
ZwQueryVolumeInformationFile,
ZwReadOnlyEnlistment,
ZwRecoverEnlistment,
ZwRecoverTransactionManager,
ZwRenameKey,
ZwRollbackComplete,
ZwRollbackEnlistment,
ZwRollbackTransaction,
ZwRollforwardTransactionManager,
ZwSetEaFile,
ZwSetInformationEnlistment,
ZwSetInformationKey,
ZwSetInformationResourceManager,
ZwSetInformationToken,
ZwSetInformationTransaction,
ZwSetInformationTransactionManager,
ZwSetQuotaInformationFile,
ZwSetSecurityObject,
ZwSetTimerEx,
ZwSetVolumeInformationFile,
ZwSinglePhaseReject,
ZwTerminateProcess,
ZwUnloadDriver,
ZwUnlockFile,
IofCompleteRequest,
ZwFlushKey,
ObfReferenceObject,
IoAttachDeviceToDeviceStack,
IoAttachDeviceToDeviceStackSafe,
IoSetStartIoAttributes,
ExAllocatePool,
ObDereferenceObject,
ObReferenceObject,
ObDereferenceObjectWithTag,
ObReferenceObjectWithTag,
ObfDereferenceObject,
ObfDereferenceObjectWithTag,
ObfReferenceObjectWithTag,
DbgBreakPoint,
DbgBreakPointWithStatus,
IoAllocateIrp,
IoInvalidateDeviceRelations,
IoFreeIrp,
KeInitializeEvent,
KeSetEvent,
IoInitializeIrp,
IoReuseIrp,
PoRequestPowerIrp,
CmRegisterCallbackEx,
EtwRegister,
EtwUnregister
].entry 
{
    abort "$fname must not be called by physical StorPort miniport drivers.";
}
