140462c92SVictor Perevertkin /*++
240462c92SVictor Perevertkin
340462c92SVictor Perevertkin Copyright (c) Microsoft Corporation. All rights reserved.
440462c92SVictor Perevertkin
540462c92SVictor Perevertkin _WdfVersionBuild_
640462c92SVictor Perevertkin
740462c92SVictor Perevertkin Module Name:
840462c92SVictor Perevertkin
940462c92SVictor Perevertkin wdfdevice.h
1040462c92SVictor Perevertkin
1140462c92SVictor Perevertkin Abstract:
1240462c92SVictor Perevertkin
1340462c92SVictor Perevertkin
1440462c92SVictor Perevertkin Environment:
1540462c92SVictor Perevertkin
1640462c92SVictor Perevertkin kernel mode only
1740462c92SVictor Perevertkin
1840462c92SVictor Perevertkin Revision History:
1940462c92SVictor Perevertkin
2040462c92SVictor Perevertkin --*/
2140462c92SVictor Perevertkin
2240462c92SVictor Perevertkin //
2340462c92SVictor Perevertkin // NOTE: This header is generated by stubwork. Please make any
2440462c92SVictor Perevertkin // modifications to the corresponding template files
2540462c92SVictor Perevertkin // (.x or .y) and use stubwork to regenerate the header
2640462c92SVictor Perevertkin //
2740462c92SVictor Perevertkin
2840462c92SVictor Perevertkin #ifndef _WDFDEVICE_H_
2940462c92SVictor Perevertkin #define _WDFDEVICE_H_
3040462c92SVictor Perevertkin
3140462c92SVictor Perevertkin #ifndef WDF_EXTERN_C
3240462c92SVictor Perevertkin #ifdef __cplusplus
3340462c92SVictor Perevertkin #define WDF_EXTERN_C extern "C"
3440462c92SVictor Perevertkin #define WDF_EXTERN_C_START extern "C" {
3540462c92SVictor Perevertkin #define WDF_EXTERN_C_END }
3640462c92SVictor Perevertkin #else
3740462c92SVictor Perevertkin #define WDF_EXTERN_C
3840462c92SVictor Perevertkin #define WDF_EXTERN_C_START
3940462c92SVictor Perevertkin #define WDF_EXTERN_C_END
4040462c92SVictor Perevertkin #endif
4140462c92SVictor Perevertkin #endif
4240462c92SVictor Perevertkin
4340462c92SVictor Perevertkin WDF_EXTERN_C_START
4440462c92SVictor Perevertkin
4540462c92SVictor Perevertkin
4640462c92SVictor Perevertkin
4740462c92SVictor Perevertkin
4840462c92SVictor Perevertkin #include <devpropdef.h>
4940462c92SVictor Perevertkin
5040462c92SVictor Perevertkin
5140462c92SVictor Perevertkin #if (NTDDI_VERSION >= NTDDI_WIN2K)
5240462c92SVictor Perevertkin
5340462c92SVictor Perevertkin
5440462c92SVictor Perevertkin // begin_wpp enum
5540462c92SVictor Perevertkin typedef enum _WDF_DEVICE_STATE_FLAGS {
5640462c92SVictor Perevertkin WdfDevStateNP = 0x8000,
5740462c92SVictor Perevertkin } WDF_DEVICE_STATE_FLAGS;
5840462c92SVictor Perevertkin
5940462c92SVictor Perevertkin // end_wpp
6040462c92SVictor Perevertkin
6140462c92SVictor Perevertkin // begin_wpp enum
6240462c92SVictor Perevertkin typedef enum _WDF_DEVICE_PNP_STATE {
6340462c92SVictor Perevertkin WdfDevStatePnpInvalid = 0x00,
6440462c92SVictor Perevertkin WdfDevStatePnpObjectCreated = 0x100,
6540462c92SVictor Perevertkin WdfDevStatePnpCheckForDevicePresence = 0x101,
6640462c92SVictor Perevertkin WdfDevStatePnpEjectFailed = 0x102,
6740462c92SVictor Perevertkin WdfDevStatePnpEjectHardware = 0x103,
6840462c92SVictor Perevertkin WdfDevStatePnpEjectedWaitingForRemove = 0x104,
6940462c92SVictor Perevertkin WdfDevStatePnpInit = 0x105,
7040462c92SVictor Perevertkin WdfDevStatePnpInitStarting = 0x106,
7140462c92SVictor Perevertkin WdfDevStatePnpInitSurpriseRemoved = 0x107,
7240462c92SVictor Perevertkin WdfDevStatePnpHardwareAvailable = 0x108,
7340462c92SVictor Perevertkin WdfDevStatePnpEnableInterfaces = 0x109,
7440462c92SVictor Perevertkin WdfDevStatePnpHardwareAvailablePowerPolicyFailed = 0x10A,
7540462c92SVictor Perevertkin WdfDevStatePnpQueryRemoveAskDriver = 0x10B,
7640462c92SVictor Perevertkin WdfDevStatePnpQueryRemovePending = 0x10C,
7740462c92SVictor Perevertkin WdfDevStatePnpQueryRemoveStaticCheck = 0x10D,
7840462c92SVictor Perevertkin WdfDevStatePnpQueriedRemoving = 0x10E,
7940462c92SVictor Perevertkin WdfDevStatePnpQueryStopAskDriver = 0x10F,
8040462c92SVictor Perevertkin WdfDevStatePnpQueryStopPending = 0x110,
8140462c92SVictor Perevertkin WdfDevStatePnpQueryStopStaticCheck = 0x111,
8240462c92SVictor Perevertkin WdfDevStatePnpQueryCanceled = 0x112,
8340462c92SVictor Perevertkin WdfDevStatePnpRemoved = 0x113,
8440462c92SVictor Perevertkin WdfDevStatePnpPdoRemoved = 0x114,
8540462c92SVictor Perevertkin WdfDevStatePnpRemovedPdoWait = 0x115,
8640462c92SVictor Perevertkin WdfDevStatePnpRemovedPdoSurpriseRemoved = 0x116,
8740462c92SVictor Perevertkin WdfDevStatePnpRemovingDisableInterfaces = 0x117,
8840462c92SVictor Perevertkin WdfDevStatePnpRestarting = 0x118,
8940462c92SVictor Perevertkin WdfDevStatePnpStarted = 0x119,
9040462c92SVictor Perevertkin WdfDevStatePnpStartedCancelStop = 0x11A,
9140462c92SVictor Perevertkin WdfDevStatePnpStartedCancelRemove = 0x11B,
9240462c92SVictor Perevertkin WdfDevStatePnpStartedRemoving = 0x11C,
9340462c92SVictor Perevertkin WdfDevStatePnpStartingFromStopped = 0x11D,
9440462c92SVictor Perevertkin WdfDevStatePnpStopped = 0x11E,
9540462c92SVictor Perevertkin WdfDevStatePnpStoppedWaitForStartCompletion = 0x11F,
9640462c92SVictor Perevertkin WdfDevStatePnpStartedStopping = 0x120,
9740462c92SVictor Perevertkin WdfDevStatePnpSurpriseRemove = 0x121,
9840462c92SVictor Perevertkin WdfDevStatePnpInitQueryRemove = 0x122,
9940462c92SVictor Perevertkin WdfDevStatePnpInitQueryRemoveCanceled = 0x123,
10040462c92SVictor Perevertkin WdfDevStatePnpFdoRemoved = 0x124,
10140462c92SVictor Perevertkin WdfDevStatePnpRemovedWaitForChildren = 0x125,
10240462c92SVictor Perevertkin WdfDevStatePnpQueriedSurpriseRemove = 0x126,
10340462c92SVictor Perevertkin WdfDevStatePnpSurpriseRemoveIoStarted = 0x127,
10440462c92SVictor Perevertkin WdfDevStatePnpFailedPowerDown = 0x128,
10540462c92SVictor Perevertkin WdfDevStatePnpFailedIoStarting = 0x129,
10640462c92SVictor Perevertkin WdfDevStatePnpFailedOwnHardware = 0x12A,
10740462c92SVictor Perevertkin WdfDevStatePnpFailed = 0x12B,
10840462c92SVictor Perevertkin WdfDevStatePnpFailedSurpriseRemoved = 0x12C,
10940462c92SVictor Perevertkin WdfDevStatePnpFailedStarted = 0x12D,
11040462c92SVictor Perevertkin WdfDevStatePnpFailedWaitForRemove = 0x12E,
11140462c92SVictor Perevertkin WdfDevStatePnpFailedInit = 0x12F,
11240462c92SVictor Perevertkin WdfDevStatePnpPdoInitFailed = 0x130,
11340462c92SVictor Perevertkin WdfDevStatePnpRestart = 0x131,
11440462c92SVictor Perevertkin WdfDevStatePnpRestartReleaseHardware = 0x132,
11540462c92SVictor Perevertkin WdfDevStatePnpRestartHardwareAvailable = 0x133,
11640462c92SVictor Perevertkin WdfDevStatePnpPdoRestart = 0x134,
11740462c92SVictor Perevertkin WdfDevStatePnpFinal = 0x135,
11840462c92SVictor Perevertkin WdfDevStatePnpRemovedChildrenRemoved = 0x136,
11940462c92SVictor Perevertkin WdfDevStatePnpQueryRemoveEnsureDeviceAwake = 0x137,
12040462c92SVictor Perevertkin WdfDevStatePnpQueryStopEnsureDeviceAwake = 0x138,
12140462c92SVictor Perevertkin WdfDevStatePnpFailedPowerPolicyRemoved = 0x139,
12240462c92SVictor Perevertkin WdfDevStatePnpNull = 0x13A,
12340462c92SVictor Perevertkin } WDF_DEVICE_PNP_STATE, *PWDF_DEVICE_PNP_STATE;
12440462c92SVictor Perevertkin
12540462c92SVictor Perevertkin // end_wpp
12640462c92SVictor Perevertkin
12740462c92SVictor Perevertkin // begin_wpp enum
12840462c92SVictor Perevertkin typedef enum _WDF_DEVICE_POWER_STATE {
12940462c92SVictor Perevertkin WdfDevStatePowerInvalid = 0x00,
13040462c92SVictor Perevertkin WdfDevStatePowerObjectCreated = 0x300,
13140462c92SVictor Perevertkin WdfDevStatePowerCheckDeviceType = 0x301,
13240462c92SVictor Perevertkin WdfDevStatePowerCheckDeviceTypeNP = 0x302 | WdfDevStateNP,
13340462c92SVictor Perevertkin WdfDevStatePowerCheckParentState = 0x303,
13440462c92SVictor Perevertkin WdfDevStatePowerCheckParentStateNP = 0x304 | WdfDevStateNP,
13540462c92SVictor Perevertkin WdfDevStatePowerEnablingWakeAtBus = 0x305,
13640462c92SVictor Perevertkin WdfDevStatePowerEnablingWakeAtBusNP = 0x306 | WdfDevStateNP,
13740462c92SVictor Perevertkin WdfDevStatePowerD0 = 0x307,
13840462c92SVictor Perevertkin WdfDevStatePowerD0NP = 0x308 | WdfDevStateNP,
13940462c92SVictor Perevertkin WdfDevStatePowerD0BusWakeOwner = 0x309,
14040462c92SVictor Perevertkin WdfDevStatePowerD0BusWakeOwnerNP = 0x30A | WdfDevStateNP,
14140462c92SVictor Perevertkin WdfDevStatePowerD0ArmedForWake = 0x30B,
14240462c92SVictor Perevertkin WdfDevStatePowerD0ArmedForWakeNP = 0x30C | WdfDevStateNP,
14340462c92SVictor Perevertkin WdfDevStatePowerD0DisarmingWakeAtBus = 0x30D,
14440462c92SVictor Perevertkin WdfDevStatePowerD0DisarmingWakeAtBusNP = 0x30E | WdfDevStateNP,
14540462c92SVictor Perevertkin WdfDevStatePowerD0Starting = 0x30F,
14640462c92SVictor Perevertkin WdfDevStatePowerD0StartingConnectInterrupt = 0x310,
14740462c92SVictor Perevertkin WdfDevStatePowerD0StartingDmaEnable = 0x311,
14840462c92SVictor Perevertkin WdfDevStatePowerD0StartingStartSelfManagedIo = 0x312,
14940462c92SVictor Perevertkin WdfDevStatePowerDecideD0State = 0x313,
15040462c92SVictor Perevertkin WdfDevStatePowerGotoD3Stopped = 0x314,
15140462c92SVictor Perevertkin WdfDevStatePowerStopped = 0x315,
15240462c92SVictor Perevertkin WdfDevStatePowerStartingCheckDeviceType = 0x316,
15340462c92SVictor Perevertkin WdfDevStatePowerStartingChild = 0x317,
15440462c92SVictor Perevertkin WdfDevStatePowerDxDisablingWakeAtBus = 0x318,
15540462c92SVictor Perevertkin WdfDevStatePowerDxDisablingWakeAtBusNP = 0x319 | WdfDevStateNP,
15640462c92SVictor Perevertkin WdfDevStatePowerGotoDx = 0x31A,
15740462c92SVictor Perevertkin WdfDevStatePowerGotoDxNP = 0x31B | WdfDevStateNP,
15840462c92SVictor Perevertkin WdfDevStatePowerGotoDxIoStopped = 0x31C,
15940462c92SVictor Perevertkin WdfDevStatePowerGotoDxIoStoppedNP = 0x31D | WdfDevStateNP,
16040462c92SVictor Perevertkin WdfDevStatePowerGotoDxNPFailed = 0x31E | WdfDevStateNP,
16140462c92SVictor Perevertkin WdfDevStatePowerDx = 0x31F,
16240462c92SVictor Perevertkin WdfDevStatePowerDxNP = 0x320 | WdfDevStateNP,
16340462c92SVictor Perevertkin WdfDevStatePowerGotoDxArmedForWake = 0x321,
16440462c92SVictor Perevertkin WdfDevStatePowerGotoDxArmedForWakeNP = 0x322 | WdfDevStateNP,
16540462c92SVictor Perevertkin WdfDevStatePowerGotoDxIoStoppedArmedForWake = 0x323,
16640462c92SVictor Perevertkin WdfDevStatePowerGotoDxIoStoppedArmedForWakeNP = 0x324 | WdfDevStateNP,
16740462c92SVictor Perevertkin WdfDevStatePowerDxArmedForWake = 0x325,
16840462c92SVictor Perevertkin WdfDevStatePowerDxArmedForWakeNP = 0x326 | WdfDevStateNP,
16940462c92SVictor Perevertkin WdfDevStatePowerCheckParentStateArmedForWake = 0x327,
17040462c92SVictor Perevertkin WdfDevStatePowerCheckParentStateArmedForWakeNP = 0x328 | WdfDevStateNP,
17140462c92SVictor Perevertkin WdfDevStatePowerWaitForParentArmedForWake = 0x329,
17240462c92SVictor Perevertkin WdfDevStatePowerWaitForParentArmedForWakeNP = 0x32A | WdfDevStateNP,
17340462c92SVictor Perevertkin WdfDevStatePowerStartSelfManagedIo = 0x32B,
17440462c92SVictor Perevertkin WdfDevStatePowerStartSelfManagedIoNP = 0x32C | WdfDevStateNP,
17540462c92SVictor Perevertkin WdfDevStatePowerStartSelfManagedIoFailed = 0x32D,
17640462c92SVictor Perevertkin WdfDevStatePowerStartSelfManagedIoFailedNP = 0x32E | WdfDevStateNP,
17740462c92SVictor Perevertkin WdfDevStatePowerWaitForParent = 0x32F,
17840462c92SVictor Perevertkin WdfDevStatePowerWaitForParentNP = 0x330 | WdfDevStateNP,
17940462c92SVictor Perevertkin WdfDevStatePowerWakePending = 0x331,
18040462c92SVictor Perevertkin WdfDevStatePowerWakePendingNP = 0x332 | WdfDevStateNP,
18140462c92SVictor Perevertkin WdfDevStatePowerWaking = 0x333,
18240462c92SVictor Perevertkin WdfDevStatePowerWakingNP = 0x334 | WdfDevStateNP,
18340462c92SVictor Perevertkin WdfDevStatePowerWakingConnectInterrupt = 0x335,
18440462c92SVictor Perevertkin WdfDevStatePowerWakingConnectInterruptNP = 0x336 | WdfDevStateNP,
18540462c92SVictor Perevertkin WdfDevStatePowerWakingConnectInterruptFailed = 0x337,
18640462c92SVictor Perevertkin WdfDevStatePowerWakingConnectInterruptFailedNP = 0x338 | WdfDevStateNP,
18740462c92SVictor Perevertkin WdfDevStatePowerWakingDmaEnable = 0x339,
18840462c92SVictor Perevertkin WdfDevStatePowerWakingDmaEnableNP = 0x33A | WdfDevStateNP,
18940462c92SVictor Perevertkin WdfDevStatePowerWakingDmaEnableFailed = 0x33B,
19040462c92SVictor Perevertkin WdfDevStatePowerWakingDmaEnableFailedNP = 0x33C | WdfDevStateNP,
19140462c92SVictor Perevertkin WdfDevStatePowerReportPowerUpFailedDerefParent = 0x33D,
19240462c92SVictor Perevertkin WdfDevStatePowerReportPowerUpFailed = 0x33E,
19340462c92SVictor Perevertkin WdfDevStatePowerPowerFailedPowerDown = 0x33F,
19440462c92SVictor Perevertkin WdfDevStatePowerReportPowerDownFailed = 0x340,
19540462c92SVictor Perevertkin WdfDevStatePowerInitialConnectInterruptFailed = 0x341,
19640462c92SVictor Perevertkin WdfDevStatePowerInitialDmaEnableFailed = 0x342,
19740462c92SVictor Perevertkin WdfDevStatePowerInitialSelfManagedIoFailed = 0x343,
19840462c92SVictor Perevertkin WdfDevStatePowerInitialPowerUpFailedDerefParent = 0x344,
19940462c92SVictor Perevertkin WdfDevStatePowerInitialPowerUpFailed = 0x345,
20040462c92SVictor Perevertkin WdfDevStatePowerDxStoppedDisarmWake = 0x346,
20140462c92SVictor Perevertkin WdfDevStatePowerDxStoppedDisarmWakeNP = 0x347 | WdfDevStateNP,
20240462c92SVictor Perevertkin WdfDevStatePowerGotoDxStoppedDisableInterruptNP = 0x348 | WdfDevStateNP,
20340462c92SVictor Perevertkin WdfDevStatePowerGotoDxStopped = 0x349,
20440462c92SVictor Perevertkin WdfDevStatePowerDxStopped = 0x34A,
20540462c92SVictor Perevertkin WdfDevStatePowerGotoStopped = 0x34B,
20640462c92SVictor Perevertkin WdfDevStatePowerStoppedCompleteDx = 0x34C,
20740462c92SVictor Perevertkin WdfDevStatePowerDxStoppedDecideDxState = 0x34D,
20840462c92SVictor Perevertkin WdfDevStatePowerDxStoppedArmForWake = 0x34E,
20940462c92SVictor Perevertkin WdfDevStatePowerDxStoppedArmForWakeNP = 0x34F | WdfDevStateNP,
21040462c92SVictor Perevertkin WdfDevStatePowerFinalPowerDownFailed = 0x350,
21140462c92SVictor Perevertkin WdfDevStatePowerFinal = 0x351,
21240462c92SVictor Perevertkin WdfDevStatePowerGotoImplicitD3DisarmWakeAtBus = 0x352,
21340462c92SVictor Perevertkin WdfDevStatePowerUpFailed = 0x353,
21440462c92SVictor Perevertkin WdfDevStatePowerUpFailedDerefParent = 0x354,
21540462c92SVictor Perevertkin WdfDevStatePowerGotoDxFailed = 0x355,
21640462c92SVictor Perevertkin WdfDevStatePowerGotoDxStoppedDisableInterrupt = 0x356,
21740462c92SVictor Perevertkin WdfDevStatePowerUpFailedNP = 0x357 | WdfDevStateNP,
21840462c92SVictor Perevertkin WdfDevStatePowerUpFailedDerefParentNP = 0x358 | WdfDevStateNP,
21940462c92SVictor Perevertkin WdfDevStatePowerNotifyingD0ExitToWakeInterrupts = 0x359,
22040462c92SVictor Perevertkin WdfDevStatePowerNotifyingD0EntryToWakeInterrupts = 0x35A,
22140462c92SVictor Perevertkin WdfDevStatePowerNotifyingD0ExitToWakeInterruptsNP = 0x35B | WdfDevStateNP,
22240462c92SVictor Perevertkin WdfDevStatePowerNotifyingD0EntryToWakeInterruptsNP = 0x35C | WdfDevStateNP,
22340462c92SVictor Perevertkin WdfDevStatePowerNull = 0x35D,
22440462c92SVictor Perevertkin } WDF_DEVICE_POWER_STATE, *PWDF_DEVICE_POWER_STATE;
22540462c92SVictor Perevertkin
22640462c92SVictor Perevertkin // end_wpp
22740462c92SVictor Perevertkin
22840462c92SVictor Perevertkin
22940462c92SVictor Perevertkin // begin_wpp enum
23040462c92SVictor Perevertkin typedef enum _WDF_DEVICE_POWER_POLICY_STATE {
23140462c92SVictor Perevertkin WdfDevStatePwrPolInvalid = 0x00,
23240462c92SVictor Perevertkin WdfDevStatePwrPolObjectCreated = 0x500,
23340462c92SVictor Perevertkin WdfDevStatePwrPolStarting = 0x501,
23440462c92SVictor Perevertkin WdfDevStatePwrPolStartingSucceeded = 0x502,
23540462c92SVictor Perevertkin WdfDevStatePwrPolStartingFailed = 0x503,
23640462c92SVictor Perevertkin WdfDevStatePwrPolStartingDecideS0Wake = 0x504,
23740462c92SVictor Perevertkin WdfDevStatePwrPolStartedIdleCapable = 0x505,
23840462c92SVictor Perevertkin WdfDevStatePwrPolTimerExpiredNoWake = 0x506,
23940462c92SVictor Perevertkin WdfDevStatePwrPolTimerExpiredNoWakeCompletePowerDown = 0x507,
24040462c92SVictor Perevertkin WdfDevStatePwrPolWaitingUnarmed = 0x508,
24140462c92SVictor Perevertkin WdfDevStatePwrPolWaitingUnarmedQueryIdle = 0x509,
24240462c92SVictor Perevertkin WdfDevStatePwrPolS0NoWakePowerUp = 0x50A,
24340462c92SVictor Perevertkin WdfDevStatePwrPolS0NoWakeCompletePowerUp = 0x50B,
24440462c92SVictor Perevertkin WdfDevStatePwrPolSystemSleepFromDeviceWaitingUnarmed = 0x50C,
24540462c92SVictor Perevertkin WdfDevStatePwrPolSystemSleepNeedWake = 0x50D,
24640462c92SVictor Perevertkin WdfDevStatePwrPolSystemSleepNeedWakeCompletePowerUp = 0x50E,
24740462c92SVictor Perevertkin WdfDevStatePwrPolSystemSleepPowerRequestFailed = 0x50F,
24840462c92SVictor Perevertkin WdfDevStatePwrPolCheckPowerPageable = 0x510,
24940462c92SVictor Perevertkin WdfDevStatePwrPolSleepingWakeWakeArrived = 0x511,
25040462c92SVictor Perevertkin WdfDevStatePwrPolSleepingWakeRevertArmWake = 0x512,
25140462c92SVictor Perevertkin WdfDevStatePwrPolSystemAsleepWakeArmed = 0x513,
25240462c92SVictor Perevertkin WdfDevStatePwrPolSystemWakeDeviceWakeEnabled = 0x514,
25340462c92SVictor Perevertkin WdfDevStatePwrPolSystemWakeDeviceWakeEnabledWakeCanceled = 0x515,
25440462c92SVictor Perevertkin WdfDevStatePwrPolSystemWakeDeviceWakeDisarm = 0x516,
25540462c92SVictor Perevertkin WdfDevStatePwrPolSystemWakeDeviceWakeTriggered = 0x517,
25640462c92SVictor Perevertkin WdfDevStatePwrPolSystemWakeDeviceWakeTriggeredS0 = 0x518,
25740462c92SVictor Perevertkin WdfDevStatePwrPolSystemWakeDeviceWokeDisarm = 0x519,
25840462c92SVictor Perevertkin WdfDevStatePwrPolSleepingWakeWakeArrivedNP = 0x51A | WdfDevStateNP,
25940462c92SVictor Perevertkin WdfDevStatePwrPolSleepingWakeRevertArmWakeNP = 0x51B | WdfDevStateNP,
26040462c92SVictor Perevertkin WdfDevStatePwrPolSleepingWakePowerDownFailed = 0x51C,
26140462c92SVictor Perevertkin WdfDevStatePwrPolSleepingWakePowerDownFailedWakeCanceled = 0x51D,
26240462c92SVictor Perevertkin WdfDevStatePwrPolSystemAsleepWakeArmedNP = 0x51E | WdfDevStateNP,
26340462c92SVictor Perevertkin WdfDevStatePwrPolSystemWakeDeviceWakeEnabledNP = 0x51F | WdfDevStateNP,
26440462c92SVictor Perevertkin WdfDevStatePwrPolSystemWakeDeviceWakeEnabledWakeCanceledNP = 0x520 | WdfDevStateNP,
26540462c92SVictor Perevertkin WdfDevStatePwrPolSystemWakeDeviceWakeDisarmNP = 0x521 | WdfDevStateNP,
26640462c92SVictor Perevertkin WdfDevStatePwrPolSystemWakeDeviceWakeTriggeredNP = 0x522 | WdfDevStateNP,
26740462c92SVictor Perevertkin WdfDevStatePwrPolSystemWakeDeviceWakeTriggeredS0NP = 0x523 | WdfDevStateNP,
26840462c92SVictor Perevertkin WdfDevStatePwrPolSystemWakeDeviceWokeDisarmNP = 0x524 | WdfDevStateNP,
26940462c92SVictor Perevertkin WdfDevStatePwrPolSystemWakeDeviceWakeCompletePowerUp = 0x525,
27040462c92SVictor Perevertkin WdfDevStatePwrPolSleeping = 0x526,
27140462c92SVictor Perevertkin WdfDevStatePwrPolSleepingNoWakePowerDown = 0x527,
27240462c92SVictor Perevertkin WdfDevStatePwrPolSleepingNoWakeCompletePowerDown = 0x528,
27340462c92SVictor Perevertkin WdfDevStatePwrPolSleepingNoWakeDxRequestFailed = 0x529,
27440462c92SVictor Perevertkin WdfDevStatePwrPolSleepingWakePowerDown = 0x52A,
27540462c92SVictor Perevertkin WdfDevStatePwrPolSleepingSendWake = 0x52B,
27640462c92SVictor Perevertkin WdfDevStatePwrPolSystemAsleepNoWake = 0x52C,
27740462c92SVictor Perevertkin WdfDevStatePwrPolSystemWakeDeviceWakeDisabled = 0x52D,
27840462c92SVictor Perevertkin WdfDevStatePwrPolSystemWakeDeviceToD0 = 0x52E,
27940462c92SVictor Perevertkin WdfDevStatePwrPolSystemWakeDeviceToD0CompletePowerUp = 0x52F,
28040462c92SVictor Perevertkin WdfDevStatePwrPolSystemWakeQueryIdle = 0x530,
28140462c92SVictor Perevertkin WdfDevStatePwrPolStartedWakeCapable = 0x531,
28240462c92SVictor Perevertkin WdfDevStatePwrPolTimerExpiredDecideUsbSS = 0x532,
28340462c92SVictor Perevertkin WdfDevStatePwrPolTimerExpiredWakeCapablePowerDown = 0x533,
28440462c92SVictor Perevertkin WdfDevStatePwrPolTimerExpiredWakeCapableSendWake = 0x534,
28540462c92SVictor Perevertkin WdfDevStatePwrPolTimerExpiredWakeCapableUsbSS = 0x535,
28640462c92SVictor Perevertkin WdfDevStatePwrPolTimerExpiredWakeCapableWakeArrived = 0x536,
28740462c92SVictor Perevertkin WdfDevStatePwrPolTimerExpiredWakeCapableCancelWake = 0x537,
28840462c92SVictor Perevertkin WdfDevStatePwrPolTimerExpiredWakeCapableWakeCanceled = 0x538,
28940462c92SVictor Perevertkin WdfDevStatePwrPolTimerExpiredWakeCapableCleanup = 0x539,
29040462c92SVictor Perevertkin WdfDevStatePwrPolTimerExpiredWakeCapableDxAllocFailed = 0x53A,
29140462c92SVictor Perevertkin WdfDevStatePwrPolTimerExpiredWakeCompletedPowerDown = 0x53B,
29240462c92SVictor Perevertkin WdfDevStatePwrPolTimerExpiredWakeCompletedPowerUp = 0x53C,
29340462c92SVictor Perevertkin WdfDevStatePwrPolWaitingArmedUsbSS = 0x53D,
29440462c92SVictor Perevertkin WdfDevStatePwrPolWaitingArmed = 0x53E,
29540462c92SVictor Perevertkin WdfDevStatePwrPolWaitingArmedQueryIdle = 0x53F,
29640462c92SVictor Perevertkin WdfDevStatePwrPolIoPresentArmed = 0x540,
29740462c92SVictor Perevertkin WdfDevStatePwrPolIoPresentArmedWakeCanceled = 0x541,
29840462c92SVictor Perevertkin WdfDevStatePwrPolS0WakeDisarm = 0x542,
29940462c92SVictor Perevertkin WdfDevStatePwrPolS0WakeCompletePowerUp = 0x543,
30040462c92SVictor Perevertkin WdfDevStatePwrPolTimerExpiredWakeSucceeded = 0x544,
30140462c92SVictor Perevertkin WdfDevStatePwrPolTimerExpiredWakeCompletedDisarm = 0x545,
30240462c92SVictor Perevertkin WdfDevStatePwrPolTimerExpiredWakeCapableWakeSucceeded = 0x546,
30340462c92SVictor Perevertkin WdfDevStatePwrPolTimerExpiredWakeCapableWakeFailed = 0x547,
30440462c92SVictor Perevertkin WdfDevStatePwrPolWakeFailedUsbSS = 0x548,
30540462c92SVictor Perevertkin WdfDevStatePwrPolTimerExpiredWakeCapablePowerDownFailedCancelWake = 0x549,
30640462c92SVictor Perevertkin WdfDevStatePwrPolTimerExpiredWakeCapablePowerDownFailedWakeCanceled = 0x54A,
30740462c92SVictor Perevertkin WdfDevStatePwrPolTimerExpiredWakeCapablePowerDownFailedUsbSS = 0x54B,
30840462c92SVictor Perevertkin WdfDevStatePwrPolCancelingWakeForSystemSleep = 0x54C,
30940462c92SVictor Perevertkin WdfDevStatePwrPolCancelingWakeForSystemSleepWakeCanceled = 0x54D,
31040462c92SVictor Perevertkin WdfDevStatePwrPolDisarmingWakeForSystemSleepCompletePowerUp = 0x54E,
31140462c92SVictor Perevertkin WdfDevStatePwrPolPowerUpForSystemSleepFailed = 0x54F,
31240462c92SVictor Perevertkin WdfDevStatePwrPolWokeFromS0UsbSS = 0x550,
31340462c92SVictor Perevertkin WdfDevStatePwrPolWokeFromS0 = 0x551,
31440462c92SVictor Perevertkin WdfDevStatePwrPolWokeFromS0NotifyDriver = 0x552,
31540462c92SVictor Perevertkin WdfDevStatePwrPolStoppingResetDevice = 0x553,
31640462c92SVictor Perevertkin WdfDevStatePwrPolStoppingResetDeviceCompletePowerUp = 0x554,
31740462c92SVictor Perevertkin WdfDevStatePwrPolStoppingResetDeviceFailed = 0x555,
31840462c92SVictor Perevertkin WdfDevStatePwrPolStoppingD0 = 0x556,
31940462c92SVictor Perevertkin WdfDevStatePwrPolStoppingD0Failed = 0x557,
32040462c92SVictor Perevertkin WdfDevStatePwrPolStoppingDisarmWake = 0x558,
32140462c92SVictor Perevertkin WdfDevStatePwrPolStoppingDisarmWakeCancelWake = 0x559,
32240462c92SVictor Perevertkin WdfDevStatePwrPolStoppingDisarmWakeWakeCanceled = 0x55A,
32340462c92SVictor Perevertkin WdfDevStatePwrPolStopping = 0x55B,
32440462c92SVictor Perevertkin WdfDevStatePwrPolStoppingFailed = 0x55C,
32540462c92SVictor Perevertkin WdfDevStatePwrPolStoppingSendStatus = 0x55D,
32640462c92SVictor Perevertkin WdfDevStatePwrPolStoppingCancelTimer = 0x55E,
32740462c92SVictor Perevertkin WdfDevStatePwrPolStoppingWaitForIdleTimeout = 0x55F,
32840462c92SVictor Perevertkin WdfDevStatePwrPolStoppingCancelUsbSS = 0x560,
32940462c92SVictor Perevertkin WdfDevStatePwrPolStoppingWaitForUsbSSCompletion = 0x561,
33040462c92SVictor Perevertkin WdfDevStatePwrPolStoppingCancelWake = 0x562,
33140462c92SVictor Perevertkin WdfDevStatePwrPolStopped = 0x563,
33240462c92SVictor Perevertkin WdfDevStatePwrPolCancelUsbSS = 0x564,
33340462c92SVictor Perevertkin WdfDevStatePwrPolStarted = 0x565,
33440462c92SVictor Perevertkin WdfDevStatePwrPolStartedCancelTimer = 0x566,
33540462c92SVictor Perevertkin WdfDevStatePwrPolStartedWaitForIdleTimeout = 0x567,
33640462c92SVictor Perevertkin WdfDevStatePwrPolStartedWakeCapableCancelTimerForSleep = 0x568,
33740462c92SVictor Perevertkin WdfDevStatePwrPolStartedWakeCapableWaitForIdleTimeout = 0x569,
33840462c92SVictor Perevertkin WdfDevStatePwrPolStartedWakeCapableSleepingUsbSS = 0x56A,
33940462c92SVictor Perevertkin WdfDevStatePwrPolStartedIdleCapableCancelTimerForSleep = 0x56B,
34040462c92SVictor Perevertkin WdfDevStatePwrPolStartedIdleCapableWaitForIdleTimeout = 0x56C,
34140462c92SVictor Perevertkin WdfDevStatePwrPolDeviceD0PowerRequestFailed = 0x56D,
34240462c92SVictor Perevertkin WdfDevStatePwrPolDevicePowerRequestFailed = 0x56E,
34340462c92SVictor Perevertkin WdfDevStatePwrPolGotoDx = 0x56F,
34440462c92SVictor Perevertkin WdfDevStatePwrPolGotoDxInDx = 0x570,
34540462c92SVictor Perevertkin WdfDevStatePwrPolDx = 0x571,
34640462c92SVictor Perevertkin WdfDevStatePwrPolGotoD0 = 0x572,
34740462c92SVictor Perevertkin WdfDevStatePwrPolGotoD0InD0 = 0x573,
34840462c92SVictor Perevertkin WdfDevStatePwrPolFinal = 0x574,
34940462c92SVictor Perevertkin WdfDevStatePwrPolSleepingPowerDownNotProcessed = 0x575,
35040462c92SVictor Perevertkin WdfDevStatePwrPolTimerExpiredWakeCapablePowerDownNotProcessed = 0x576,
35140462c92SVictor Perevertkin WdfDevStatePwrPolTimerExpiredNoWakePowerDownNotProcessed = 0x577,
35240462c92SVictor Perevertkin WdfDevStatePwrPolTimerExpiredNoWakePoweredDownDisableIdleTimer = 0x578,
35340462c92SVictor Perevertkin WdfDevStatePwrPolStoppingWaitingForImplicitPowerDown = 0x579,
35440462c92SVictor Perevertkin WdfDevStatePwrPolStoppingPoweringUp = 0x57A,
35540462c92SVictor Perevertkin WdfDevStatePwrPolStoppingPoweringDown = 0x57B,
35640462c92SVictor Perevertkin WdfDevStatePwrPolPowerUpForSystemSleepNotSeen = 0x57C,
35740462c92SVictor Perevertkin WdfDevStatePwrPolWaitingArmedStoppingCancelUsbSS = 0x57D,
35840462c92SVictor Perevertkin WdfDevStatePwrPolWaitingArmedWakeFailedCancelUsbSS = 0x57E,
35940462c92SVictor Perevertkin WdfDevStatePwrPolWaitingArmedIoPresentCancelUsbSS = 0x57F,
36040462c92SVictor Perevertkin WdfDevStatePwrPolWaitingArmedWakeSucceededCancelUsbSS = 0x580,
36140462c92SVictor Perevertkin WdfDevStatePwrPolCancelingUsbSSForSystemSleep = 0x581,
36240462c92SVictor Perevertkin WdfDevStatePwrPolStoppingD0CancelUsbSS = 0x582,
36340462c92SVictor Perevertkin WdfDevStatePwrPolStartingPoweredUp = 0x583,
36440462c92SVictor Perevertkin WdfDevStatePwrPolIdleCapableDeviceIdle = 0x584,
36540462c92SVictor Perevertkin WdfDevStatePwrPolDeviceIdleReturnToActive = 0x585,
36640462c92SVictor Perevertkin WdfDevStatePwrPolDeviceIdleSleeping = 0x586,
36740462c92SVictor Perevertkin WdfDevStatePwrPolDeviceIdleStopping = 0x587,
36840462c92SVictor Perevertkin WdfDevStatePwrPolTimerExpiredNoWakeUndoPowerDown = 0x588,
36940462c92SVictor Perevertkin WdfDevStatePwrPolWakeCapableDeviceIdle = 0x589,
37040462c92SVictor Perevertkin WdfDevStatePwrPolWakeCapableUsbSSCompleted = 0x58A,
37140462c92SVictor Perevertkin WdfDevStatePwrPolTimerExpiredWakeCapableUndoPowerDown = 0x58B,
37240462c92SVictor Perevertkin WdfDevStatePwrPolTimerExpiredWakeCompletedHardwareStarted = 0x58C,
37340462c92SVictor Perevertkin WdfDevStatePwrPolStoppedRemoving = 0x58D,
37440462c92SVictor Perevertkin WdfDevStatePwrPolRemoved = 0x58E,
37540462c92SVictor Perevertkin WdfDevStatePwrPolRestarting = 0x58F,
37640462c92SVictor Perevertkin WdfDevStatePwrPolRestartingFailed = 0x590,
37740462c92SVictor Perevertkin WdfDevStatePwrPolStartingPoweredUpFailed = 0x591,
37840462c92SVictor Perevertkin WdfDevStatePwrPolTimerExpiredNoWakeReturnToActive = 0x592,
37940462c92SVictor Perevertkin WdfDevStatePwrPolWaitingArmedWakeInterruptFired = 0x593,
38040462c92SVictor Perevertkin WdfDevStatePwrPolSystemWakeDeviceWakeInterruptFired = 0x594,
38140462c92SVictor Perevertkin WdfDevStatePwrPolSystemWakeDeviceWakeInterruptFiredNP = 0x595 | WdfDevStateNP,
38240462c92SVictor Perevertkin WdfDevStatePwrPolTimerExpiredWakeCapableWakeInterruptArrived = 0x596,
38340462c92SVictor Perevertkin WdfDevStatePwrPolTimerExpiredWakeCapablePowerDownFailedWakeInterruptArrived = 0x597,
38440462c92SVictor Perevertkin WdfDevStatePwrPolWaitingArmedWakeInterruptFiredDuringPowerDown = 0x598,
38540462c92SVictor Perevertkin WdfDevStatePwrPolNull = 0x599,
38640462c92SVictor Perevertkin } WDF_DEVICE_POWER_POLICY_STATE, *PWDF_DEVICE_POWER_POLICY_STATE;
38740462c92SVictor Perevertkin
38840462c92SVictor Perevertkin // end_wpp
38940462c92SVictor Perevertkin
39040462c92SVictor Perevertkin typedef enum _WDF_STATE_NOTIFICATION_TYPE {
39140462c92SVictor Perevertkin StateNotificationInvalid = 0x0000,
39240462c92SVictor Perevertkin StateNotificationEnterState = 0x0001,
39340462c92SVictor Perevertkin StateNotificationPostProcessState = 0x0002,
39440462c92SVictor Perevertkin StateNotificationLeaveState = 0x0004,
39540462c92SVictor Perevertkin StateNotificationAllStates = StateNotificationEnterState | StateNotificationPostProcessState | StateNotificationLeaveState,
39640462c92SVictor Perevertkin } WDF_STATE_NOTIFICATION_TYPE;
39740462c92SVictor Perevertkin
39840462c92SVictor Perevertkin typedef enum _WDF_POWER_POLICY_S0_IDLE_CAPABILITIES {
39940462c92SVictor Perevertkin IdleCapsInvalid = 0,
40040462c92SVictor Perevertkin IdleCannotWakeFromS0,
40140462c92SVictor Perevertkin IdleCanWakeFromS0,
40240462c92SVictor Perevertkin IdleUsbSelectiveSuspend,
40340462c92SVictor Perevertkin } WDF_POWER_POLICY_S0_IDLE_CAPABILITIES;
40440462c92SVictor Perevertkin
40540462c92SVictor Perevertkin typedef enum _WDF_POWER_POLICY_S0_IDLE_USER_CONTROL {
40640462c92SVictor Perevertkin IdleUserControlInvalid = 0,
40740462c92SVictor Perevertkin IdleDoNotAllowUserControl,
40840462c92SVictor Perevertkin IdleAllowUserControl,
40940462c92SVictor Perevertkin } WDF_POWER_POLICY_S0_IDLE_USER_CONTROL;
41040462c92SVictor Perevertkin
41140462c92SVictor Perevertkin typedef enum _WDF_POWER_POLICY_IDLE_TIMEOUT_CONSTANTS {
41240462c92SVictor Perevertkin IdleTimeoutDefaultConstant = 0,
41340462c92SVictor Perevertkin } WDF_POWER_POLICY_IDLE_TIMEOUT_CONSTANTS;
41440462c92SVictor Perevertkin
41540462c92SVictor Perevertkin typedef enum _WDF_POWER_POLICY_SX_WAKE_USER_CONTROL {
41640462c92SVictor Perevertkin WakeUserControlInvalid = 0,
41740462c92SVictor Perevertkin WakeDoNotAllowUserControl,
41840462c92SVictor Perevertkin WakeAllowUserControl,
41940462c92SVictor Perevertkin } WDF_POWER_POLICY_SX_WAKE_USER_CONTROL;
42040462c92SVictor Perevertkin
42140462c92SVictor Perevertkin typedef enum _WDF_POWER_DEVICE_STATE {
42240462c92SVictor Perevertkin WdfPowerDeviceInvalid = 0,
42340462c92SVictor Perevertkin WdfPowerDeviceD0,
42440462c92SVictor Perevertkin WdfPowerDeviceD1,
42540462c92SVictor Perevertkin WdfPowerDeviceD2,
42640462c92SVictor Perevertkin WdfPowerDeviceD3,
42740462c92SVictor Perevertkin WdfPowerDeviceD3Final,
42840462c92SVictor Perevertkin WdfPowerDevicePrepareForHibernation,
42940462c92SVictor Perevertkin WdfPowerDeviceMaximum,
43040462c92SVictor Perevertkin } WDF_POWER_DEVICE_STATE, *PWDF_POWER_DEVICE_STATE;
43140462c92SVictor Perevertkin
43240462c92SVictor Perevertkin
43340462c92SVictor Perevertkin
43440462c92SVictor Perevertkin typedef enum _WDF_DISPATCH_IRP_TO_IO_QUEUE_FLAGS {
43540462c92SVictor Perevertkin WDF_DISPATCH_IRP_TO_IO_QUEUE_NO_FLAGS = 0x00000000,
43640462c92SVictor Perevertkin WDF_DISPATCH_IRP_TO_IO_QUEUE_INVOKE_INCALLERCTX_CALLBACK = 0x00000001,
43740462c92SVictor Perevertkin WDF_DISPATCH_IRP_TO_IO_QUEUE_PREPROCESSED_IRP = 0x00000002,
43840462c92SVictor Perevertkin } WDF_DISPATCH_IRP_TO_IO_QUEUE_FLAGS;
43940462c92SVictor Perevertkin
44040462c92SVictor Perevertkin typedef enum _WDF_SPECIAL_FILE_TYPE {
44140462c92SVictor Perevertkin WdfSpecialFileUndefined = 0,
44240462c92SVictor Perevertkin WdfSpecialFilePaging = 1,
44340462c92SVictor Perevertkin WdfSpecialFileHibernation,
44440462c92SVictor Perevertkin WdfSpecialFileDump,
44540462c92SVictor Perevertkin WdfSpecialFileBoot,
44640462c92SVictor Perevertkin WdfSpecialFileMax,
44740462c92SVictor Perevertkin } WDF_SPECIAL_FILE_TYPE, *PWDF_SPECIAL_FILE_TYPE;
44840462c92SVictor Perevertkin
44940462c92SVictor Perevertkin typedef enum _WDF_DEVICE_IO_TYPE {
45040462c92SVictor Perevertkin WdfDeviceIoUndefined = 0,
45140462c92SVictor Perevertkin WdfDeviceIoNeither,
45240462c92SVictor Perevertkin WdfDeviceIoBuffered,
45340462c92SVictor Perevertkin WdfDeviceIoDirect,
45440462c92SVictor Perevertkin WdfDeviceIoBufferedOrDirect = 4,
45540462c92SVictor Perevertkin WdfDeviceIoMaximum,
45640462c92SVictor Perevertkin } WDF_DEVICE_IO_TYPE, *PWDF_DEVICE_IO_TYPE;
45740462c92SVictor Perevertkin
45840462c92SVictor Perevertkin typedef enum _WDF_FILEOBJECT_CLASS {
45940462c92SVictor Perevertkin WdfFileObjectInvalid = 0,
46040462c92SVictor Perevertkin WdfFileObjectNotRequired = 1,
46140462c92SVictor Perevertkin WdfFileObjectWdfCanUseFsContext = 2,
46240462c92SVictor Perevertkin WdfFileObjectWdfCanUseFsContext2 = 3,
46340462c92SVictor Perevertkin WdfFileObjectWdfCannotUseFsContexts = 4,
46440462c92SVictor Perevertkin WdfFileObjectCanBeOptional = 0x80000000,
46540462c92SVictor Perevertkin } WDF_FILEOBJECT_CLASS, *PWDF_FILEOBJECT_CLASS;
46640462c92SVictor Perevertkin
46740462c92SVictor Perevertkin typedef enum _WDF_DEVICE_FAILED_ACTION {
46840462c92SVictor Perevertkin WdfDeviceFailedUndefined = 0,
46940462c92SVictor Perevertkin WdfDeviceFailedAttemptRestart,
47040462c92SVictor Perevertkin WdfDeviceFailedNoRestart,
47140462c92SVictor Perevertkin } WDF_DEVICE_FAILED_ACTION;
47240462c92SVictor Perevertkin
47340462c92SVictor Perevertkin typedef enum _WDF_RELEASE_HARDWARE_ORDER_ON_FAILURE {
47440462c92SVictor Perevertkin WdfReleaseHardwareOrderOnFailureInvalid = 0,
47540462c92SVictor Perevertkin WdfReleaseHardwareOrderOnFailureEarly,
47640462c92SVictor Perevertkin WdfReleaseHardwareOrderOnFailureAfterDescendants,
47740462c92SVictor Perevertkin } WDF_RELEASE_HARDWARE_ORDER_ON_FAILURE, *PWDF_RELEASE_HARDWARE_ORDER_ON_FAILURE;
47840462c92SVictor Perevertkin
47940462c92SVictor Perevertkin
48040462c92SVictor Perevertkin
48140462c92SVictor Perevertkin //
48240462c92SVictor Perevertkin // If you do not want the auto inclusion of wdmsec.h, define
48340462c92SVictor Perevertkin // WDF_DEVICE_NO_WDMSEC_H before including this file (or wdf.h)
48440462c92SVictor Perevertkin //
48540462c92SVictor Perevertkin #ifndef WDF_DEVICE_NO_WDMSEC_H
48640462c92SVictor Perevertkin #include <wdmsec.h>
48740462c92SVictor Perevertkin #endif // WDF_DEVICE_NO_WDMSEC_H
48840462c92SVictor Perevertkin
48940462c92SVictor Perevertkin
49040462c92SVictor Perevertkin #define WDF_S0_IDLE_ENABLED_VALUE_NAME L"IdleInWorkingState"
49140462c92SVictor Perevertkin #define WDF_SX_WAKE_ENABLED_VALUE_NAME L"WakeFromSleepState"
49240462c92SVictor Perevertkin #define WDF_S0_IDLE_DEFAULT_VALUE_NAME L"WdfDefaultIdleInWorkingState"
49340462c92SVictor Perevertkin #define WDF_SX_WAKE_DEFAULT_VALUE_NAME L"WdfDefaultWakeFromSleepState"
49440462c92SVictor Perevertkin //
49540462c92SVictor Perevertkin // Declare empty definitions so that they may be referenced by
49640462c92SVictor Perevertkin // routines before they are defined.
49740462c92SVictor Perevertkin //
49840462c92SVictor Perevertkin
499*545df815SVictor Perevertkin // enum _WDF_REQUEST_TYPE;
500*545df815SVictor Perevertkin // typedef enum _WDF_REQUEST_TYPE WDF_REQUEST_TYPE;
501*545df815SVictor Perevertkin
502*545df815SVictor Perevertkin typedef enum _WDF_REQUEST_TYPE { // taken from wdfrequest.h
503*545df815SVictor Perevertkin WdfRequestTypeCreate = 0x0,
504*545df815SVictor Perevertkin WdfRequestTypeCreateNamedPipe = 0x1,
505*545df815SVictor Perevertkin WdfRequestTypeClose = 0x2,
506*545df815SVictor Perevertkin WdfRequestTypeRead = 0x3,
507*545df815SVictor Perevertkin WdfRequestTypeWrite = 0x4,
508*545df815SVictor Perevertkin WdfRequestTypeQueryInformation = 0x5,
509*545df815SVictor Perevertkin WdfRequestTypeSetInformation = 0x6,
510*545df815SVictor Perevertkin WdfRequestTypeQueryEA = 0x7,
511*545df815SVictor Perevertkin WdfRequestTypeSetEA = 0x8,
512*545df815SVictor Perevertkin WdfRequestTypeFlushBuffers = 0x9,
513*545df815SVictor Perevertkin WdfRequestTypeQueryVolumeInformation = 0xa,
514*545df815SVictor Perevertkin WdfRequestTypeSetVolumeInformation = 0xb,
515*545df815SVictor Perevertkin WdfRequestTypeDirectoryControl = 0xc,
516*545df815SVictor Perevertkin WdfRequestTypeFileSystemControl = 0xd,
517*545df815SVictor Perevertkin WdfRequestTypeDeviceControl = 0xe,
518*545df815SVictor Perevertkin WdfRequestTypeDeviceControlInternal = 0xf,
519*545df815SVictor Perevertkin WdfRequestTypeShutdown = 0x10,
520*545df815SVictor Perevertkin WdfRequestTypeLockControl = 0x11,
521*545df815SVictor Perevertkin WdfRequestTypeCleanup = 0x12,
522*545df815SVictor Perevertkin WdfRequestTypeCreateMailSlot = 0x13,
523*545df815SVictor Perevertkin WdfRequestTypeQuerySecurity = 0x14,
524*545df815SVictor Perevertkin WdfRequestTypeSetSecurity = 0x15,
525*545df815SVictor Perevertkin WdfRequestTypePower = 0x16,
526*545df815SVictor Perevertkin WdfRequestTypeSystemControl = 0x17,
527*545df815SVictor Perevertkin WdfRequestTypeDeviceChange = 0x18,
528*545df815SVictor Perevertkin WdfRequestTypeQueryQuota = 0x19,
529*545df815SVictor Perevertkin WdfRequestTypeSetQuota = 0x1A,
530*545df815SVictor Perevertkin WdfRequestTypePnp = 0x1B,
531*545df815SVictor Perevertkin WdfRequestTypeOther =0x1C,
532*545df815SVictor Perevertkin WdfRequestTypeUsb = 0x40,
533*545df815SVictor Perevertkin WdfRequestTypeNoFormat = 0xFF,
534*545df815SVictor Perevertkin WdfRequestTypeMax,
535*545df815SVictor Perevertkin } WDF_REQUEST_TYPE;
53640462c92SVictor Perevertkin
53740462c92SVictor Perevertkin typedef
53840462c92SVictor Perevertkin _Function_class_(EVT_WDF_DEVICE_FILE_CREATE)
53940462c92SVictor Perevertkin _IRQL_requires_same_
54040462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
54140462c92SVictor Perevertkin VOID
542*545df815SVictor Perevertkin STDCALL
54340462c92SVictor Perevertkin EVT_WDF_DEVICE_FILE_CREATE(
54440462c92SVictor Perevertkin _In_
54540462c92SVictor Perevertkin WDFDEVICE Device,
54640462c92SVictor Perevertkin _In_
54740462c92SVictor Perevertkin WDFREQUEST Request,
54840462c92SVictor Perevertkin _In_
54940462c92SVictor Perevertkin WDFFILEOBJECT FileObject
55040462c92SVictor Perevertkin );
55140462c92SVictor Perevertkin
55240462c92SVictor Perevertkin typedef EVT_WDF_DEVICE_FILE_CREATE *PFN_WDF_DEVICE_FILE_CREATE;
55340462c92SVictor Perevertkin
55440462c92SVictor Perevertkin typedef
55540462c92SVictor Perevertkin _Function_class_(EVT_WDF_FILE_CLOSE)
55640462c92SVictor Perevertkin _IRQL_requires_same_
55740462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
55840462c92SVictor Perevertkin VOID
559*545df815SVictor Perevertkin STDCALL
56040462c92SVictor Perevertkin EVT_WDF_FILE_CLOSE(
56140462c92SVictor Perevertkin _In_
56240462c92SVictor Perevertkin WDFFILEOBJECT FileObject
56340462c92SVictor Perevertkin );
56440462c92SVictor Perevertkin
56540462c92SVictor Perevertkin typedef EVT_WDF_FILE_CLOSE *PFN_WDF_FILE_CLOSE;
56640462c92SVictor Perevertkin
56740462c92SVictor Perevertkin typedef
56840462c92SVictor Perevertkin _Function_class_(EVT_WDF_FILE_CLEANUP)
56940462c92SVictor Perevertkin _IRQL_requires_same_
57040462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
57140462c92SVictor Perevertkin VOID
572*545df815SVictor Perevertkin STDCALL
57340462c92SVictor Perevertkin EVT_WDF_FILE_CLEANUP(
57440462c92SVictor Perevertkin _In_
57540462c92SVictor Perevertkin WDFFILEOBJECT FileObject
57640462c92SVictor Perevertkin );
57740462c92SVictor Perevertkin
57840462c92SVictor Perevertkin typedef EVT_WDF_FILE_CLEANUP *PFN_WDF_FILE_CLEANUP;
57940462c92SVictor Perevertkin
58040462c92SVictor Perevertkin typedef struct _WDF_FILEOBJECT_CONFIG {
58140462c92SVictor Perevertkin //
58240462c92SVictor Perevertkin // Size of this structure in bytes
58340462c92SVictor Perevertkin //
58440462c92SVictor Perevertkin ULONG Size;
58540462c92SVictor Perevertkin
58640462c92SVictor Perevertkin //
58740462c92SVictor Perevertkin // Event callback for create requests
58840462c92SVictor Perevertkin //
58940462c92SVictor Perevertkin PFN_WDF_DEVICE_FILE_CREATE EvtDeviceFileCreate;
59040462c92SVictor Perevertkin
59140462c92SVictor Perevertkin //
59240462c92SVictor Perevertkin // Event callback for close requests
59340462c92SVictor Perevertkin //
59440462c92SVictor Perevertkin PFN_WDF_FILE_CLOSE EvtFileClose;
59540462c92SVictor Perevertkin
59640462c92SVictor Perevertkin //
59740462c92SVictor Perevertkin // Event callback for cleanup requests
59840462c92SVictor Perevertkin //
59940462c92SVictor Perevertkin PFN_WDF_FILE_CLEANUP EvtFileCleanup;
60040462c92SVictor Perevertkin
60140462c92SVictor Perevertkin //
60240462c92SVictor Perevertkin // If WdfTrue, create/cleanup/close file object related requests will be
60340462c92SVictor Perevertkin // sent down the stack.
60440462c92SVictor Perevertkin //
60540462c92SVictor Perevertkin // If WdfFalse, create/cleanup/close will be completed at this location in
60640462c92SVictor Perevertkin // the device stack.
60740462c92SVictor Perevertkin //
60840462c92SVictor Perevertkin // If WdfDefault, behavior depends on device type
60940462c92SVictor Perevertkin // FDO, PDO, Control: use the WdfFalse behavior
61040462c92SVictor Perevertkin // Filter: use the WdfTrue behavior
61140462c92SVictor Perevertkin //
61240462c92SVictor Perevertkin WDF_TRI_STATE AutoForwardCleanupClose;
61340462c92SVictor Perevertkin
61440462c92SVictor Perevertkin //
61540462c92SVictor Perevertkin // Specify whether framework should create WDFFILEOBJECT and also
61640462c92SVictor Perevertkin // whether it can FsContexts fields in the WDM fileobject to store
61740462c92SVictor Perevertkin // WDFFILEOBJECT so that it can avoid table look up and improve perf.
61840462c92SVictor Perevertkin //
61940462c92SVictor Perevertkin WDF_FILEOBJECT_CLASS FileObjectClass;
62040462c92SVictor Perevertkin
62140462c92SVictor Perevertkin } WDF_FILEOBJECT_CONFIG, *PWDF_FILEOBJECT_CONFIG;
62240462c92SVictor Perevertkin
62340462c92SVictor Perevertkin FORCEINLINE
624*545df815SVictor Perevertkin VOID
WDF_FILEOBJECT_CONFIG_INIT(_Out_ PWDF_FILEOBJECT_CONFIG FileEventCallbacks,_In_opt_ PFN_WDF_DEVICE_FILE_CREATE EvtDeviceFileCreate,_In_opt_ PFN_WDF_FILE_CLOSE EvtFileClose,_In_opt_ PFN_WDF_FILE_CLEANUP EvtFileCleanup)62540462c92SVictor Perevertkin WDF_FILEOBJECT_CONFIG_INIT(
62640462c92SVictor Perevertkin _Out_ PWDF_FILEOBJECT_CONFIG FileEventCallbacks,
62740462c92SVictor Perevertkin _In_opt_ PFN_WDF_DEVICE_FILE_CREATE EvtDeviceFileCreate,
62840462c92SVictor Perevertkin _In_opt_ PFN_WDF_FILE_CLOSE EvtFileClose,
62940462c92SVictor Perevertkin _In_opt_ PFN_WDF_FILE_CLEANUP EvtFileCleanup
63040462c92SVictor Perevertkin )
63140462c92SVictor Perevertkin {
63240462c92SVictor Perevertkin FileEventCallbacks->Size = sizeof(WDF_FILEOBJECT_CONFIG);
63340462c92SVictor Perevertkin
63440462c92SVictor Perevertkin FileEventCallbacks->EvtDeviceFileCreate = EvtDeviceFileCreate;
63540462c92SVictor Perevertkin FileEventCallbacks->EvtFileClose = EvtFileClose;
63640462c92SVictor Perevertkin FileEventCallbacks->EvtFileCleanup = EvtFileCleanup;
63740462c92SVictor Perevertkin
63840462c92SVictor Perevertkin FileEventCallbacks->FileObjectClass = WdfFileObjectWdfCannotUseFsContexts;
63940462c92SVictor Perevertkin FileEventCallbacks->AutoForwardCleanupClose = WdfUseDefault;
64040462c92SVictor Perevertkin }
64140462c92SVictor Perevertkin
64240462c92SVictor Perevertkin typedef struct _WDF_DEVICE_PNP_NOTIFICATION_DATA {
64340462c92SVictor Perevertkin //
64440462c92SVictor Perevertkin // Type of data
64540462c92SVictor Perevertkin //
64640462c92SVictor Perevertkin WDF_STATE_NOTIFICATION_TYPE Type;
64740462c92SVictor Perevertkin
64840462c92SVictor Perevertkin union {
64940462c92SVictor Perevertkin struct {
65040462c92SVictor Perevertkin //
65140462c92SVictor Perevertkin // The current state that is about to be exited
65240462c92SVictor Perevertkin //
65340462c92SVictor Perevertkin WDF_DEVICE_PNP_STATE CurrentState;
65440462c92SVictor Perevertkin
65540462c92SVictor Perevertkin //
65640462c92SVictor Perevertkin // The new state that is about to be entered
65740462c92SVictor Perevertkin //
65840462c92SVictor Perevertkin WDF_DEVICE_PNP_STATE NewState;
65940462c92SVictor Perevertkin } EnterState;
66040462c92SVictor Perevertkin
66140462c92SVictor Perevertkin struct {
66240462c92SVictor Perevertkin //
66340462c92SVictor Perevertkin // The current state
66440462c92SVictor Perevertkin //
66540462c92SVictor Perevertkin WDF_DEVICE_PNP_STATE CurrentState;
66640462c92SVictor Perevertkin } PostProcessState;
66740462c92SVictor Perevertkin
66840462c92SVictor Perevertkin
66940462c92SVictor Perevertkin struct {
67040462c92SVictor Perevertkin //
67140462c92SVictor Perevertkin // The current state that is about to be exitted
67240462c92SVictor Perevertkin //
67340462c92SVictor Perevertkin WDF_DEVICE_PNP_STATE CurrentState;
67440462c92SVictor Perevertkin
67540462c92SVictor Perevertkin //
67640462c92SVictor Perevertkin // The state that is about to be entered
67740462c92SVictor Perevertkin //
67840462c92SVictor Perevertkin WDF_DEVICE_PNP_STATE NewState;
67940462c92SVictor Perevertkin } LeaveState;
68040462c92SVictor Perevertkin } Data;
68140462c92SVictor Perevertkin } WDF_DEVICE_PNP_NOTIFICATION_DATA;
68240462c92SVictor Perevertkin
68340462c92SVictor Perevertkin typedef const WDF_DEVICE_PNP_NOTIFICATION_DATA* PCWDF_DEVICE_PNP_NOTIFICATION_DATA;
68440462c92SVictor Perevertkin
68540462c92SVictor Perevertkin typedef struct _WDF_DEVICE_POWER_NOTIFICATION_DATA {
68640462c92SVictor Perevertkin //
68740462c92SVictor Perevertkin // Type of data
68840462c92SVictor Perevertkin //
68940462c92SVictor Perevertkin WDF_STATE_NOTIFICATION_TYPE Type;
69040462c92SVictor Perevertkin
69140462c92SVictor Perevertkin union {
69240462c92SVictor Perevertkin struct {
69340462c92SVictor Perevertkin //
69440462c92SVictor Perevertkin // The current state that is about to be exitted
69540462c92SVictor Perevertkin //
69640462c92SVictor Perevertkin WDF_DEVICE_POWER_STATE CurrentState;
69740462c92SVictor Perevertkin
69840462c92SVictor Perevertkin //
69940462c92SVictor Perevertkin // The new state that is about to be entered
70040462c92SVictor Perevertkin //
70140462c92SVictor Perevertkin WDF_DEVICE_POWER_STATE NewState;
70240462c92SVictor Perevertkin } EnterState;
70340462c92SVictor Perevertkin
70440462c92SVictor Perevertkin struct {
70540462c92SVictor Perevertkin //
70640462c92SVictor Perevertkin // The current state
70740462c92SVictor Perevertkin //
70840462c92SVictor Perevertkin WDF_DEVICE_POWER_STATE CurrentState;
70940462c92SVictor Perevertkin } PostProcessState;
71040462c92SVictor Perevertkin
71140462c92SVictor Perevertkin
71240462c92SVictor Perevertkin struct {
71340462c92SVictor Perevertkin //
71440462c92SVictor Perevertkin // The current state that is about to be exitted
71540462c92SVictor Perevertkin //
71640462c92SVictor Perevertkin WDF_DEVICE_POWER_STATE CurrentState;
71740462c92SVictor Perevertkin
71840462c92SVictor Perevertkin //
71940462c92SVictor Perevertkin // The state that is about to be entered
72040462c92SVictor Perevertkin //
72140462c92SVictor Perevertkin WDF_DEVICE_POWER_STATE NewState;
72240462c92SVictor Perevertkin } LeaveState;
72340462c92SVictor Perevertkin } Data;
72440462c92SVictor Perevertkin } WDF_DEVICE_POWER_NOTIFICATION_DATA;
72540462c92SVictor Perevertkin
72640462c92SVictor Perevertkin typedef const WDF_DEVICE_POWER_NOTIFICATION_DATA* PCWDF_DEVICE_POWER_NOTIFICATION_DATA;
72740462c92SVictor Perevertkin
72840462c92SVictor Perevertkin typedef struct _WDF_DEVICE_POWER_POLICY_NOTIFICATION_DATA {
72940462c92SVictor Perevertkin //
73040462c92SVictor Perevertkin // Type of data
73140462c92SVictor Perevertkin //
73240462c92SVictor Perevertkin WDF_STATE_NOTIFICATION_TYPE Type;
73340462c92SVictor Perevertkin
73440462c92SVictor Perevertkin union {
73540462c92SVictor Perevertkin struct {
73640462c92SVictor Perevertkin //
73740462c92SVictor Perevertkin // The current state that is about to be exitted
73840462c92SVictor Perevertkin //
73940462c92SVictor Perevertkin WDF_DEVICE_POWER_POLICY_STATE CurrentState;
74040462c92SVictor Perevertkin
74140462c92SVictor Perevertkin //
74240462c92SVictor Perevertkin // The new state that is about to be entered
74340462c92SVictor Perevertkin //
74440462c92SVictor Perevertkin WDF_DEVICE_POWER_POLICY_STATE NewState;
74540462c92SVictor Perevertkin } EnterState;
74640462c92SVictor Perevertkin
74740462c92SVictor Perevertkin struct {
74840462c92SVictor Perevertkin //
74940462c92SVictor Perevertkin // The current state
75040462c92SVictor Perevertkin //
75140462c92SVictor Perevertkin WDF_DEVICE_POWER_POLICY_STATE CurrentState;
75240462c92SVictor Perevertkin } PostProcessState;
75340462c92SVictor Perevertkin
75440462c92SVictor Perevertkin
75540462c92SVictor Perevertkin struct {
75640462c92SVictor Perevertkin //
75740462c92SVictor Perevertkin // The current state that is about to be exitted
75840462c92SVictor Perevertkin //
75940462c92SVictor Perevertkin WDF_DEVICE_POWER_POLICY_STATE CurrentState;
76040462c92SVictor Perevertkin
76140462c92SVictor Perevertkin //
76240462c92SVictor Perevertkin // The state that is about to be entered
76340462c92SVictor Perevertkin //
76440462c92SVictor Perevertkin WDF_DEVICE_POWER_POLICY_STATE NewState;
76540462c92SVictor Perevertkin } LeaveState;
76640462c92SVictor Perevertkin } Data;
76740462c92SVictor Perevertkin } WDF_DEVICE_POWER_POLICY_NOTIFICATION_DATA;
76840462c92SVictor Perevertkin
76940462c92SVictor Perevertkin typedef const WDF_DEVICE_POWER_POLICY_NOTIFICATION_DATA* PCWDF_DEVICE_POWER_POLICY_NOTIFICATION_DATA;
77040462c92SVictor Perevertkin
77140462c92SVictor Perevertkin typedef
77240462c92SVictor Perevertkin _Function_class_(EVT_WDF_DEVICE_PNP_STATE_CHANGE_NOTIFICATION)
77340462c92SVictor Perevertkin _IRQL_requires_same_
77440462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
77540462c92SVictor Perevertkin VOID
776*545df815SVictor Perevertkin STDCALL
77740462c92SVictor Perevertkin EVT_WDF_DEVICE_PNP_STATE_CHANGE_NOTIFICATION(
77840462c92SVictor Perevertkin _In_
77940462c92SVictor Perevertkin WDFDEVICE Device,
78040462c92SVictor Perevertkin _In_
78140462c92SVictor Perevertkin PCWDF_DEVICE_PNP_NOTIFICATION_DATA NotificationData
78240462c92SVictor Perevertkin );
78340462c92SVictor Perevertkin
78440462c92SVictor Perevertkin typedef EVT_WDF_DEVICE_PNP_STATE_CHANGE_NOTIFICATION *PFN_WDF_DEVICE_PNP_STATE_CHANGE_NOTIFICATION;
78540462c92SVictor Perevertkin
78640462c92SVictor Perevertkin typedef
78740462c92SVictor Perevertkin _Function_class_(EVT_WDF_DEVICE_POWER_STATE_CHANGE_NOTIFICATION)
78840462c92SVictor Perevertkin _IRQL_requires_same_
78940462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
79040462c92SVictor Perevertkin VOID
791*545df815SVictor Perevertkin STDCALL
79240462c92SVictor Perevertkin EVT_WDF_DEVICE_POWER_STATE_CHANGE_NOTIFICATION(
79340462c92SVictor Perevertkin _In_
79440462c92SVictor Perevertkin WDFDEVICE Device,
79540462c92SVictor Perevertkin _In_
79640462c92SVictor Perevertkin PCWDF_DEVICE_POWER_NOTIFICATION_DATA NotificationData
79740462c92SVictor Perevertkin );
79840462c92SVictor Perevertkin
79940462c92SVictor Perevertkin typedef EVT_WDF_DEVICE_POWER_STATE_CHANGE_NOTIFICATION *PFN_WDF_DEVICE_POWER_STATE_CHANGE_NOTIFICATION;
80040462c92SVictor Perevertkin
80140462c92SVictor Perevertkin typedef
80240462c92SVictor Perevertkin _Function_class_(EVT_WDF_DEVICE_POWER_POLICY_STATE_CHANGE_NOTIFICATION)
80340462c92SVictor Perevertkin _IRQL_requires_same_
80440462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
80540462c92SVictor Perevertkin VOID
806*545df815SVictor Perevertkin STDCALL
80740462c92SVictor Perevertkin EVT_WDF_DEVICE_POWER_POLICY_STATE_CHANGE_NOTIFICATION(
80840462c92SVictor Perevertkin _In_
80940462c92SVictor Perevertkin WDFDEVICE Device,
81040462c92SVictor Perevertkin _In_
81140462c92SVictor Perevertkin PCWDF_DEVICE_POWER_POLICY_NOTIFICATION_DATA NotificationData
81240462c92SVictor Perevertkin );
81340462c92SVictor Perevertkin
81440462c92SVictor Perevertkin typedef EVT_WDF_DEVICE_POWER_POLICY_STATE_CHANGE_NOTIFICATION *PFN_WDF_DEVICE_POWER_POLICY_STATE_CHANGE_NOTIFICATION;
81540462c92SVictor Perevertkin
81640462c92SVictor Perevertkin #define IdleTimeoutDefaultValue ((ULONG) IdleTimeoutDefaultConstant)
81740462c92SVictor Perevertkin
81840462c92SVictor Perevertkin typedef
81940462c92SVictor Perevertkin _Function_class_(EVT_WDF_DEVICE_D0_ENTRY)
82040462c92SVictor Perevertkin _IRQL_requires_same_
82140462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
82240462c92SVictor Perevertkin NTSTATUS
823*545df815SVictor Perevertkin STDCALL
82440462c92SVictor Perevertkin EVT_WDF_DEVICE_D0_ENTRY(
82540462c92SVictor Perevertkin _In_
82640462c92SVictor Perevertkin WDFDEVICE Device,
82740462c92SVictor Perevertkin _In_
82840462c92SVictor Perevertkin WDF_POWER_DEVICE_STATE PreviousState
82940462c92SVictor Perevertkin );
83040462c92SVictor Perevertkin
83140462c92SVictor Perevertkin typedef EVT_WDF_DEVICE_D0_ENTRY *PFN_WDF_DEVICE_D0_ENTRY;
83240462c92SVictor Perevertkin
83340462c92SVictor Perevertkin typedef
83440462c92SVictor Perevertkin _Function_class_(EVT_WDF_DEVICE_D0_ENTRY_POST_INTERRUPTS_ENABLED)
83540462c92SVictor Perevertkin _IRQL_requires_same_
83640462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
83740462c92SVictor Perevertkin NTSTATUS
838*545df815SVictor Perevertkin STDCALL
83940462c92SVictor Perevertkin EVT_WDF_DEVICE_D0_ENTRY_POST_INTERRUPTS_ENABLED(
84040462c92SVictor Perevertkin _In_
84140462c92SVictor Perevertkin WDFDEVICE Device,
84240462c92SVictor Perevertkin _In_
84340462c92SVictor Perevertkin WDF_POWER_DEVICE_STATE PreviousState
84440462c92SVictor Perevertkin );
84540462c92SVictor Perevertkin
84640462c92SVictor Perevertkin typedef EVT_WDF_DEVICE_D0_ENTRY_POST_INTERRUPTS_ENABLED *PFN_WDF_DEVICE_D0_ENTRY_POST_INTERRUPTS_ENABLED;
84740462c92SVictor Perevertkin
84840462c92SVictor Perevertkin typedef
84940462c92SVictor Perevertkin _Function_class_(EVT_WDF_DEVICE_D0_EXIT)
85040462c92SVictor Perevertkin _IRQL_requires_same_
85140462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
85240462c92SVictor Perevertkin NTSTATUS
853*545df815SVictor Perevertkin STDCALL
85440462c92SVictor Perevertkin EVT_WDF_DEVICE_D0_EXIT(
85540462c92SVictor Perevertkin _In_
85640462c92SVictor Perevertkin WDFDEVICE Device,
85740462c92SVictor Perevertkin _In_
85840462c92SVictor Perevertkin WDF_POWER_DEVICE_STATE TargetState
85940462c92SVictor Perevertkin );
86040462c92SVictor Perevertkin
86140462c92SVictor Perevertkin typedef EVT_WDF_DEVICE_D0_EXIT *PFN_WDF_DEVICE_D0_EXIT;
86240462c92SVictor Perevertkin
86340462c92SVictor Perevertkin typedef
86440462c92SVictor Perevertkin _Function_class_(EVT_WDF_DEVICE_D0_EXIT_PRE_INTERRUPTS_DISABLED)
86540462c92SVictor Perevertkin _IRQL_requires_same_
86640462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
86740462c92SVictor Perevertkin NTSTATUS
868*545df815SVictor Perevertkin STDCALL
86940462c92SVictor Perevertkin EVT_WDF_DEVICE_D0_EXIT_PRE_INTERRUPTS_DISABLED(
87040462c92SVictor Perevertkin _In_
87140462c92SVictor Perevertkin WDFDEVICE Device,
87240462c92SVictor Perevertkin _In_
87340462c92SVictor Perevertkin WDF_POWER_DEVICE_STATE TargetState
87440462c92SVictor Perevertkin );
87540462c92SVictor Perevertkin
87640462c92SVictor Perevertkin typedef EVT_WDF_DEVICE_D0_EXIT_PRE_INTERRUPTS_DISABLED *PFN_WDF_DEVICE_D0_EXIT_PRE_INTERRUPTS_DISABLED;
87740462c92SVictor Perevertkin
87840462c92SVictor Perevertkin typedef
87940462c92SVictor Perevertkin _Function_class_(EVT_WDF_DEVICE_PREPARE_HARDWARE)
88040462c92SVictor Perevertkin _IRQL_requires_same_
88140462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
88240462c92SVictor Perevertkin NTSTATUS
883*545df815SVictor Perevertkin STDCALL
88440462c92SVictor Perevertkin EVT_WDF_DEVICE_PREPARE_HARDWARE(
88540462c92SVictor Perevertkin _In_
88640462c92SVictor Perevertkin WDFDEVICE Device,
88740462c92SVictor Perevertkin _In_
88840462c92SVictor Perevertkin WDFCMRESLIST ResourcesRaw,
88940462c92SVictor Perevertkin _In_
89040462c92SVictor Perevertkin WDFCMRESLIST ResourcesTranslated
89140462c92SVictor Perevertkin );
89240462c92SVictor Perevertkin
89340462c92SVictor Perevertkin typedef EVT_WDF_DEVICE_PREPARE_HARDWARE *PFN_WDF_DEVICE_PREPARE_HARDWARE;
89440462c92SVictor Perevertkin
89540462c92SVictor Perevertkin typedef
89640462c92SVictor Perevertkin _Function_class_(EVT_WDF_DEVICE_RELEASE_HARDWARE)
89740462c92SVictor Perevertkin _IRQL_requires_same_
89840462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
89940462c92SVictor Perevertkin NTSTATUS
900*545df815SVictor Perevertkin STDCALL
90140462c92SVictor Perevertkin EVT_WDF_DEVICE_RELEASE_HARDWARE(
90240462c92SVictor Perevertkin _In_
90340462c92SVictor Perevertkin WDFDEVICE Device,
90440462c92SVictor Perevertkin _In_
90540462c92SVictor Perevertkin WDFCMRESLIST ResourcesTranslated
90640462c92SVictor Perevertkin );
90740462c92SVictor Perevertkin
90840462c92SVictor Perevertkin typedef EVT_WDF_DEVICE_RELEASE_HARDWARE *PFN_WDF_DEVICE_RELEASE_HARDWARE;
90940462c92SVictor Perevertkin
91040462c92SVictor Perevertkin typedef
91140462c92SVictor Perevertkin _Function_class_(EVT_WDF_DEVICE_SELF_MANAGED_IO_CLEANUP)
91240462c92SVictor Perevertkin _IRQL_requires_same_
91340462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
91440462c92SVictor Perevertkin VOID
915*545df815SVictor Perevertkin STDCALL
91640462c92SVictor Perevertkin EVT_WDF_DEVICE_SELF_MANAGED_IO_CLEANUP(
91740462c92SVictor Perevertkin _In_
91840462c92SVictor Perevertkin WDFDEVICE Device
91940462c92SVictor Perevertkin );
92040462c92SVictor Perevertkin
92140462c92SVictor Perevertkin typedef EVT_WDF_DEVICE_SELF_MANAGED_IO_CLEANUP *PFN_WDF_DEVICE_SELF_MANAGED_IO_CLEANUP;
92240462c92SVictor Perevertkin
92340462c92SVictor Perevertkin typedef
92440462c92SVictor Perevertkin _Function_class_(EVT_WDF_DEVICE_SELF_MANAGED_IO_FLUSH)
92540462c92SVictor Perevertkin _IRQL_requires_same_
92640462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
92740462c92SVictor Perevertkin VOID
928*545df815SVictor Perevertkin STDCALL
92940462c92SVictor Perevertkin EVT_WDF_DEVICE_SELF_MANAGED_IO_FLUSH(
93040462c92SVictor Perevertkin _In_
93140462c92SVictor Perevertkin WDFDEVICE Device
93240462c92SVictor Perevertkin );
93340462c92SVictor Perevertkin
93440462c92SVictor Perevertkin typedef EVT_WDF_DEVICE_SELF_MANAGED_IO_FLUSH *PFN_WDF_DEVICE_SELF_MANAGED_IO_FLUSH;
93540462c92SVictor Perevertkin
93640462c92SVictor Perevertkin typedef
93740462c92SVictor Perevertkin _Function_class_(EVT_WDF_DEVICE_SELF_MANAGED_IO_INIT)
93840462c92SVictor Perevertkin _IRQL_requires_same_
93940462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
94040462c92SVictor Perevertkin NTSTATUS
941*545df815SVictor Perevertkin STDCALL
94240462c92SVictor Perevertkin EVT_WDF_DEVICE_SELF_MANAGED_IO_INIT(
94340462c92SVictor Perevertkin _In_
94440462c92SVictor Perevertkin WDFDEVICE Device
94540462c92SVictor Perevertkin );
94640462c92SVictor Perevertkin
94740462c92SVictor Perevertkin typedef EVT_WDF_DEVICE_SELF_MANAGED_IO_INIT *PFN_WDF_DEVICE_SELF_MANAGED_IO_INIT;
94840462c92SVictor Perevertkin
94940462c92SVictor Perevertkin typedef
95040462c92SVictor Perevertkin _Function_class_(EVT_WDF_DEVICE_SELF_MANAGED_IO_SUSPEND)
95140462c92SVictor Perevertkin _IRQL_requires_same_
95240462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
95340462c92SVictor Perevertkin NTSTATUS
954*545df815SVictor Perevertkin STDCALL
95540462c92SVictor Perevertkin EVT_WDF_DEVICE_SELF_MANAGED_IO_SUSPEND(
95640462c92SVictor Perevertkin _In_
95740462c92SVictor Perevertkin WDFDEVICE Device
95840462c92SVictor Perevertkin );
95940462c92SVictor Perevertkin
96040462c92SVictor Perevertkin typedef EVT_WDF_DEVICE_SELF_MANAGED_IO_SUSPEND *PFN_WDF_DEVICE_SELF_MANAGED_IO_SUSPEND;
96140462c92SVictor Perevertkin
96240462c92SVictor Perevertkin typedef
96340462c92SVictor Perevertkin _Function_class_(EVT_WDF_DEVICE_SELF_MANAGED_IO_RESTART)
96440462c92SVictor Perevertkin _IRQL_requires_same_
96540462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
96640462c92SVictor Perevertkin NTSTATUS
967*545df815SVictor Perevertkin STDCALL
96840462c92SVictor Perevertkin EVT_WDF_DEVICE_SELF_MANAGED_IO_RESTART(
96940462c92SVictor Perevertkin _In_
97040462c92SVictor Perevertkin WDFDEVICE Device
97140462c92SVictor Perevertkin );
97240462c92SVictor Perevertkin
97340462c92SVictor Perevertkin typedef EVT_WDF_DEVICE_SELF_MANAGED_IO_RESTART *PFN_WDF_DEVICE_SELF_MANAGED_IO_RESTART;
97440462c92SVictor Perevertkin
97540462c92SVictor Perevertkin typedef
97640462c92SVictor Perevertkin _Function_class_(EVT_WDF_DEVICE_QUERY_STOP)
97740462c92SVictor Perevertkin _IRQL_requires_same_
97840462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
97940462c92SVictor Perevertkin NTSTATUS
980*545df815SVictor Perevertkin STDCALL
98140462c92SVictor Perevertkin EVT_WDF_DEVICE_QUERY_STOP(
98240462c92SVictor Perevertkin _In_
98340462c92SVictor Perevertkin WDFDEVICE Device
98440462c92SVictor Perevertkin );
98540462c92SVictor Perevertkin
98640462c92SVictor Perevertkin typedef EVT_WDF_DEVICE_QUERY_STOP *PFN_WDF_DEVICE_QUERY_STOP;
98740462c92SVictor Perevertkin
98840462c92SVictor Perevertkin typedef
98940462c92SVictor Perevertkin _Function_class_(EVT_WDF_DEVICE_QUERY_REMOVE)
99040462c92SVictor Perevertkin _IRQL_requires_same_
99140462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
99240462c92SVictor Perevertkin NTSTATUS
993*545df815SVictor Perevertkin STDCALL
99440462c92SVictor Perevertkin EVT_WDF_DEVICE_QUERY_REMOVE(
99540462c92SVictor Perevertkin _In_
99640462c92SVictor Perevertkin WDFDEVICE Device
99740462c92SVictor Perevertkin );
99840462c92SVictor Perevertkin
99940462c92SVictor Perevertkin typedef EVT_WDF_DEVICE_QUERY_REMOVE *PFN_WDF_DEVICE_QUERY_REMOVE;
100040462c92SVictor Perevertkin
100140462c92SVictor Perevertkin typedef
100240462c92SVictor Perevertkin _Function_class_(EVT_WDF_DEVICE_SURPRISE_REMOVAL)
100340462c92SVictor Perevertkin _IRQL_requires_same_
100440462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
100540462c92SVictor Perevertkin VOID
1006*545df815SVictor Perevertkin STDCALL
100740462c92SVictor Perevertkin EVT_WDF_DEVICE_SURPRISE_REMOVAL(
100840462c92SVictor Perevertkin _In_
100940462c92SVictor Perevertkin WDFDEVICE Device
101040462c92SVictor Perevertkin );
101140462c92SVictor Perevertkin
101240462c92SVictor Perevertkin typedef EVT_WDF_DEVICE_SURPRISE_REMOVAL *PFN_WDF_DEVICE_SURPRISE_REMOVAL;
101340462c92SVictor Perevertkin
101440462c92SVictor Perevertkin typedef
101540462c92SVictor Perevertkin _Function_class_(EVT_WDF_DEVICE_USAGE_NOTIFICATION)
101640462c92SVictor Perevertkin _IRQL_requires_same_
101740462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
101840462c92SVictor Perevertkin VOID
1019*545df815SVictor Perevertkin STDCALL
102040462c92SVictor Perevertkin EVT_WDF_DEVICE_USAGE_NOTIFICATION(
102140462c92SVictor Perevertkin _In_
102240462c92SVictor Perevertkin WDFDEVICE Device,
102340462c92SVictor Perevertkin _In_
102440462c92SVictor Perevertkin WDF_SPECIAL_FILE_TYPE NotificationType,
102540462c92SVictor Perevertkin _In_
102640462c92SVictor Perevertkin BOOLEAN IsInNotificationPath
102740462c92SVictor Perevertkin );
102840462c92SVictor Perevertkin
102940462c92SVictor Perevertkin typedef EVT_WDF_DEVICE_USAGE_NOTIFICATION *PFN_WDF_DEVICE_USAGE_NOTIFICATION;
103040462c92SVictor Perevertkin
103140462c92SVictor Perevertkin typedef
103240462c92SVictor Perevertkin _Function_class_(EVT_WDF_DEVICE_USAGE_NOTIFICATION_EX)
103340462c92SVictor Perevertkin _IRQL_requires_same_
103440462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
103540462c92SVictor Perevertkin NTSTATUS
1036*545df815SVictor Perevertkin STDCALL
103740462c92SVictor Perevertkin EVT_WDF_DEVICE_USAGE_NOTIFICATION_EX(
103840462c92SVictor Perevertkin _In_
103940462c92SVictor Perevertkin WDFDEVICE Device,
104040462c92SVictor Perevertkin _In_
104140462c92SVictor Perevertkin WDF_SPECIAL_FILE_TYPE NotificationType,
104240462c92SVictor Perevertkin _In_
104340462c92SVictor Perevertkin BOOLEAN IsInNotificationPath
104440462c92SVictor Perevertkin );
104540462c92SVictor Perevertkin
104640462c92SVictor Perevertkin typedef EVT_WDF_DEVICE_USAGE_NOTIFICATION_EX *PFN_WDF_DEVICE_USAGE_NOTIFICATION_EX;
104740462c92SVictor Perevertkin
104840462c92SVictor Perevertkin typedef
104940462c92SVictor Perevertkin _Function_class_(EVT_WDF_DEVICE_RELATIONS_QUERY)
105040462c92SVictor Perevertkin _IRQL_requires_same_
105140462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
105240462c92SVictor Perevertkin VOID
1053*545df815SVictor Perevertkin STDCALL
105440462c92SVictor Perevertkin EVT_WDF_DEVICE_RELATIONS_QUERY(
105540462c92SVictor Perevertkin _In_
105640462c92SVictor Perevertkin WDFDEVICE Device,
105740462c92SVictor Perevertkin _In_
105840462c92SVictor Perevertkin DEVICE_RELATION_TYPE RelationType
105940462c92SVictor Perevertkin );
106040462c92SVictor Perevertkin
106140462c92SVictor Perevertkin typedef EVT_WDF_DEVICE_RELATIONS_QUERY *PFN_WDF_DEVICE_RELATIONS_QUERY;
106240462c92SVictor Perevertkin
106340462c92SVictor Perevertkin typedef
106440462c92SVictor Perevertkin _Function_class_(EVT_WDF_DEVICE_ARM_WAKE_FROM_S0)
106540462c92SVictor Perevertkin _IRQL_requires_same_
106640462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
106740462c92SVictor Perevertkin NTSTATUS
1068*545df815SVictor Perevertkin STDCALL
106940462c92SVictor Perevertkin EVT_WDF_DEVICE_ARM_WAKE_FROM_S0(
107040462c92SVictor Perevertkin _In_
107140462c92SVictor Perevertkin WDFDEVICE Device
107240462c92SVictor Perevertkin );
107340462c92SVictor Perevertkin
107440462c92SVictor Perevertkin typedef EVT_WDF_DEVICE_ARM_WAKE_FROM_S0 *PFN_WDF_DEVICE_ARM_WAKE_FROM_S0;
107540462c92SVictor Perevertkin
107640462c92SVictor Perevertkin typedef
107740462c92SVictor Perevertkin _Function_class_(EVT_WDF_DEVICE_ARM_WAKE_FROM_SX)
107840462c92SVictor Perevertkin _IRQL_requires_same_
107940462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
108040462c92SVictor Perevertkin NTSTATUS
1081*545df815SVictor Perevertkin STDCALL
108240462c92SVictor Perevertkin EVT_WDF_DEVICE_ARM_WAKE_FROM_SX(
108340462c92SVictor Perevertkin _In_
108440462c92SVictor Perevertkin WDFDEVICE Device
108540462c92SVictor Perevertkin );
108640462c92SVictor Perevertkin
108740462c92SVictor Perevertkin typedef EVT_WDF_DEVICE_ARM_WAKE_FROM_SX *PFN_WDF_DEVICE_ARM_WAKE_FROM_SX;
108840462c92SVictor Perevertkin
108940462c92SVictor Perevertkin typedef
109040462c92SVictor Perevertkin _Function_class_(EVT_WDF_DEVICE_ARM_WAKE_FROM_SX_WITH_REASON)
109140462c92SVictor Perevertkin _IRQL_requires_same_
109240462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
109340462c92SVictor Perevertkin NTSTATUS
1094*545df815SVictor Perevertkin STDCALL
109540462c92SVictor Perevertkin EVT_WDF_DEVICE_ARM_WAKE_FROM_SX_WITH_REASON(
109640462c92SVictor Perevertkin _In_
109740462c92SVictor Perevertkin WDFDEVICE Device,
109840462c92SVictor Perevertkin _In_
109940462c92SVictor Perevertkin BOOLEAN DeviceWakeEnabled,
110040462c92SVictor Perevertkin _In_
110140462c92SVictor Perevertkin BOOLEAN ChildrenArmedForWake
110240462c92SVictor Perevertkin );
110340462c92SVictor Perevertkin
110440462c92SVictor Perevertkin typedef EVT_WDF_DEVICE_ARM_WAKE_FROM_SX_WITH_REASON *PFN_WDF_DEVICE_ARM_WAKE_FROM_SX_WITH_REASON;
110540462c92SVictor Perevertkin
110640462c92SVictor Perevertkin typedef
110740462c92SVictor Perevertkin _Function_class_(EVT_WDF_DEVICE_DISARM_WAKE_FROM_S0)
110840462c92SVictor Perevertkin _IRQL_requires_same_
110940462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
111040462c92SVictor Perevertkin VOID
1111*545df815SVictor Perevertkin STDCALL
111240462c92SVictor Perevertkin EVT_WDF_DEVICE_DISARM_WAKE_FROM_S0(
111340462c92SVictor Perevertkin _In_
111440462c92SVictor Perevertkin WDFDEVICE Device
111540462c92SVictor Perevertkin );
111640462c92SVictor Perevertkin
111740462c92SVictor Perevertkin typedef EVT_WDF_DEVICE_DISARM_WAKE_FROM_S0 *PFN_WDF_DEVICE_DISARM_WAKE_FROM_S0;
111840462c92SVictor Perevertkin
111940462c92SVictor Perevertkin typedef
112040462c92SVictor Perevertkin _Function_class_(EVT_WDF_DEVICE_DISARM_WAKE_FROM_SX)
112140462c92SVictor Perevertkin _IRQL_requires_same_
112240462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
112340462c92SVictor Perevertkin VOID
1124*545df815SVictor Perevertkin STDCALL
112540462c92SVictor Perevertkin EVT_WDF_DEVICE_DISARM_WAKE_FROM_SX(
112640462c92SVictor Perevertkin _In_
112740462c92SVictor Perevertkin WDFDEVICE Device
112840462c92SVictor Perevertkin );
112940462c92SVictor Perevertkin
113040462c92SVictor Perevertkin typedef EVT_WDF_DEVICE_DISARM_WAKE_FROM_SX *PFN_WDF_DEVICE_DISARM_WAKE_FROM_SX;
113140462c92SVictor Perevertkin
113240462c92SVictor Perevertkin typedef
113340462c92SVictor Perevertkin _Function_class_(EVT_WDF_DEVICE_WAKE_FROM_S0_TRIGGERED)
113440462c92SVictor Perevertkin _IRQL_requires_same_
113540462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
113640462c92SVictor Perevertkin VOID
1137*545df815SVictor Perevertkin STDCALL
113840462c92SVictor Perevertkin EVT_WDF_DEVICE_WAKE_FROM_S0_TRIGGERED(
113940462c92SVictor Perevertkin _In_
114040462c92SVictor Perevertkin WDFDEVICE Device
114140462c92SVictor Perevertkin );
114240462c92SVictor Perevertkin
114340462c92SVictor Perevertkin typedef EVT_WDF_DEVICE_WAKE_FROM_S0_TRIGGERED *PFN_WDF_DEVICE_WAKE_FROM_S0_TRIGGERED;
114440462c92SVictor Perevertkin
114540462c92SVictor Perevertkin typedef
114640462c92SVictor Perevertkin _Function_class_(EVT_WDF_DEVICE_WAKE_FROM_SX_TRIGGERED)
114740462c92SVictor Perevertkin _IRQL_requires_same_
114840462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
114940462c92SVictor Perevertkin VOID
1150*545df815SVictor Perevertkin STDCALL
115140462c92SVictor Perevertkin EVT_WDF_DEVICE_WAKE_FROM_SX_TRIGGERED(
115240462c92SVictor Perevertkin _In_
115340462c92SVictor Perevertkin WDFDEVICE Device
115440462c92SVictor Perevertkin );
115540462c92SVictor Perevertkin
115640462c92SVictor Perevertkin typedef EVT_WDF_DEVICE_WAKE_FROM_SX_TRIGGERED *PFN_WDF_DEVICE_WAKE_FROM_SX_TRIGGERED;
115740462c92SVictor Perevertkin
115840462c92SVictor Perevertkin typedef struct _WDF_PNPPOWER_EVENT_CALLBACKS {
115940462c92SVictor Perevertkin //
116040462c92SVictor Perevertkin // Size of this structure in bytes
116140462c92SVictor Perevertkin //
116240462c92SVictor Perevertkin ULONG Size;
116340462c92SVictor Perevertkin
116440462c92SVictor Perevertkin PFN_WDF_DEVICE_D0_ENTRY EvtDeviceD0Entry;
116540462c92SVictor Perevertkin PFN_WDF_DEVICE_D0_ENTRY_POST_INTERRUPTS_ENABLED EvtDeviceD0EntryPostInterruptsEnabled;
116640462c92SVictor Perevertkin PFN_WDF_DEVICE_D0_EXIT EvtDeviceD0Exit;
116740462c92SVictor Perevertkin PFN_WDF_DEVICE_D0_EXIT_PRE_INTERRUPTS_DISABLED EvtDeviceD0ExitPreInterruptsDisabled;
116840462c92SVictor Perevertkin PFN_WDF_DEVICE_PREPARE_HARDWARE EvtDevicePrepareHardware;
116940462c92SVictor Perevertkin PFN_WDF_DEVICE_RELEASE_HARDWARE EvtDeviceReleaseHardware;
117040462c92SVictor Perevertkin PFN_WDF_DEVICE_SELF_MANAGED_IO_CLEANUP EvtDeviceSelfManagedIoCleanup;
117140462c92SVictor Perevertkin PFN_WDF_DEVICE_SELF_MANAGED_IO_FLUSH EvtDeviceSelfManagedIoFlush;
117240462c92SVictor Perevertkin PFN_WDF_DEVICE_SELF_MANAGED_IO_INIT EvtDeviceSelfManagedIoInit;
117340462c92SVictor Perevertkin PFN_WDF_DEVICE_SELF_MANAGED_IO_SUSPEND EvtDeviceSelfManagedIoSuspend;
117440462c92SVictor Perevertkin PFN_WDF_DEVICE_SELF_MANAGED_IO_RESTART EvtDeviceSelfManagedIoRestart;
117540462c92SVictor Perevertkin PFN_WDF_DEVICE_SURPRISE_REMOVAL EvtDeviceSurpriseRemoval;
117640462c92SVictor Perevertkin PFN_WDF_DEVICE_QUERY_REMOVE EvtDeviceQueryRemove;
117740462c92SVictor Perevertkin PFN_WDF_DEVICE_QUERY_STOP EvtDeviceQueryStop;
117840462c92SVictor Perevertkin PFN_WDF_DEVICE_USAGE_NOTIFICATION EvtDeviceUsageNotification;
117940462c92SVictor Perevertkin PFN_WDF_DEVICE_RELATIONS_QUERY EvtDeviceRelationsQuery;
118040462c92SVictor Perevertkin PFN_WDF_DEVICE_USAGE_NOTIFICATION_EX EvtDeviceUsageNotificationEx;
118140462c92SVictor Perevertkin } WDF_PNPPOWER_EVENT_CALLBACKS, *PWDF_PNPPOWER_EVENT_CALLBACKS;
118240462c92SVictor Perevertkin
118340462c92SVictor Perevertkin typedef struct _WDF_POWER_POLICY_EVENT_CALLBACKS {
118440462c92SVictor Perevertkin //
118540462c92SVictor Perevertkin // Size of this structure in bytes
118640462c92SVictor Perevertkin //
118740462c92SVictor Perevertkin ULONG Size;
118840462c92SVictor Perevertkin
118940462c92SVictor Perevertkin PFN_WDF_DEVICE_ARM_WAKE_FROM_S0 EvtDeviceArmWakeFromS0;
119040462c92SVictor Perevertkin PFN_WDF_DEVICE_DISARM_WAKE_FROM_S0 EvtDeviceDisarmWakeFromS0;
119140462c92SVictor Perevertkin PFN_WDF_DEVICE_WAKE_FROM_S0_TRIGGERED EvtDeviceWakeFromS0Triggered;
119240462c92SVictor Perevertkin
119340462c92SVictor Perevertkin PFN_WDF_DEVICE_ARM_WAKE_FROM_SX EvtDeviceArmWakeFromSx;
119440462c92SVictor Perevertkin PFN_WDF_DEVICE_DISARM_WAKE_FROM_SX EvtDeviceDisarmWakeFromSx;
119540462c92SVictor Perevertkin PFN_WDF_DEVICE_WAKE_FROM_SX_TRIGGERED EvtDeviceWakeFromSxTriggered;
119640462c92SVictor Perevertkin
119740462c92SVictor Perevertkin PFN_WDF_DEVICE_ARM_WAKE_FROM_SX_WITH_REASON EvtDeviceArmWakeFromSxWithReason;
119840462c92SVictor Perevertkin
119940462c92SVictor Perevertkin } WDF_POWER_POLICY_EVENT_CALLBACKS, *PWDF_POWER_POLICY_EVENT_CALLBACKS;
120040462c92SVictor Perevertkin
120140462c92SVictor Perevertkin FORCEINLINE
1202*545df815SVictor Perevertkin VOID
WDF_POWER_POLICY_EVENT_CALLBACKS_INIT(_Out_ PWDF_POWER_POLICY_EVENT_CALLBACKS Callbacks)120340462c92SVictor Perevertkin WDF_POWER_POLICY_EVENT_CALLBACKS_INIT(
120440462c92SVictor Perevertkin _Out_ PWDF_POWER_POLICY_EVENT_CALLBACKS Callbacks
120540462c92SVictor Perevertkin )
120640462c92SVictor Perevertkin {
120740462c92SVictor Perevertkin RtlZeroMemory(Callbacks, sizeof(WDF_POWER_POLICY_EVENT_CALLBACKS));
120840462c92SVictor Perevertkin
120940462c92SVictor Perevertkin Callbacks->Size = sizeof(WDF_POWER_POLICY_EVENT_CALLBACKS);
121040462c92SVictor Perevertkin }
121140462c92SVictor Perevertkin
121240462c92SVictor Perevertkin FORCEINLINE
1213*545df815SVictor Perevertkin VOID
WDF_PNPPOWER_EVENT_CALLBACKS_INIT(_Out_ PWDF_PNPPOWER_EVENT_CALLBACKS Callbacks)121440462c92SVictor Perevertkin WDF_PNPPOWER_EVENT_CALLBACKS_INIT(
121540462c92SVictor Perevertkin _Out_ PWDF_PNPPOWER_EVENT_CALLBACKS Callbacks
121640462c92SVictor Perevertkin )
121740462c92SVictor Perevertkin {
121840462c92SVictor Perevertkin RtlZeroMemory(Callbacks, sizeof(WDF_PNPPOWER_EVENT_CALLBACKS));
121940462c92SVictor Perevertkin Callbacks->Size = sizeof(WDF_PNPPOWER_EVENT_CALLBACKS);
122040462c92SVictor Perevertkin }
122140462c92SVictor Perevertkin
122240462c92SVictor Perevertkin
122340462c92SVictor Perevertkin FORCEINLINE
1224*545df815SVictor Perevertkin ULONG
WdfDevStateNormalize(_In_ ULONG State)122540462c92SVictor Perevertkin WdfDevStateNormalize(
122640462c92SVictor Perevertkin _In_ ULONG State
122740462c92SVictor Perevertkin )
122840462c92SVictor Perevertkin {
122940462c92SVictor Perevertkin return State & ~WdfDevStateNP;
123040462c92SVictor Perevertkin }
123140462c92SVictor Perevertkin
123240462c92SVictor Perevertkin
123340462c92SVictor Perevertkin FORCEINLINE
1234*545df815SVictor Perevertkin BOOLEAN
WdfDevStateIsNP(_In_ ULONG State)123540462c92SVictor Perevertkin WdfDevStateIsNP(
123640462c92SVictor Perevertkin _In_ ULONG State
123740462c92SVictor Perevertkin )
123840462c92SVictor Perevertkin {
123940462c92SVictor Perevertkin return (State & WdfDevStateNP) ? TRUE : FALSE;
124040462c92SVictor Perevertkin }
124140462c92SVictor Perevertkin
124240462c92SVictor Perevertkin typedef enum _WDF_POWER_POLICY_IDLE_TIMEOUT_TYPE {
124340462c92SVictor Perevertkin DriverManagedIdleTimeout = 0,
124440462c92SVictor Perevertkin SystemManagedIdleTimeout = 1,
124540462c92SVictor Perevertkin SystemManagedIdleTimeoutWithHint = 2
124640462c92SVictor Perevertkin } WDF_POWER_POLICY_IDLE_TIMEOUT_TYPE, *PWDF_POWER_POLICY_IDLE_TIMEOUT_TYPE;
124740462c92SVictor Perevertkin
124840462c92SVictor Perevertkin typedef struct _WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS {
124940462c92SVictor Perevertkin //
125040462c92SVictor Perevertkin // Size of this structure in bytes
125140462c92SVictor Perevertkin //
125240462c92SVictor Perevertkin ULONG Size;
125340462c92SVictor Perevertkin
125440462c92SVictor Perevertkin //
125540462c92SVictor Perevertkin // Indicates whether the device can wake itself up while the machine is in
125640462c92SVictor Perevertkin // S0.
125740462c92SVictor Perevertkin //
125840462c92SVictor Perevertkin WDF_POWER_POLICY_S0_IDLE_CAPABILITIES IdleCaps;
125940462c92SVictor Perevertkin
126040462c92SVictor Perevertkin //
126140462c92SVictor Perevertkin // The low power state in which the device will be placed when it is idled
126240462c92SVictor Perevertkin // out while the machine is in S0.
126340462c92SVictor Perevertkin //
126440462c92SVictor Perevertkin DEVICE_POWER_STATE DxState;
126540462c92SVictor Perevertkin
126640462c92SVictor Perevertkin //
126740462c92SVictor Perevertkin // Amount of time the device must be idle before idling out. Timeout is in
126840462c92SVictor Perevertkin // milliseconds.
126940462c92SVictor Perevertkin //
127040462c92SVictor Perevertkin ULONG IdleTimeout;
127140462c92SVictor Perevertkin
127240462c92SVictor Perevertkin //
127340462c92SVictor Perevertkin // Inidcates whether a user can control the idle policy of the device.
127440462c92SVictor Perevertkin // By default, a user is allowed to change the policy.
127540462c92SVictor Perevertkin //
127640462c92SVictor Perevertkin WDF_POWER_POLICY_S0_IDLE_USER_CONTROL UserControlOfIdleSettings;
127740462c92SVictor Perevertkin
127840462c92SVictor Perevertkin //
127940462c92SVictor Perevertkin // If WdfTrue, idling out while the machine is in S0 will be enabled.
128040462c92SVictor Perevertkin //
128140462c92SVictor Perevertkin // If WdfFalse, idling out will be disabled.
128240462c92SVictor Perevertkin //
128340462c92SVictor Perevertkin // If WdfUseDefault, the idling out will be enabled. If
128440462c92SVictor Perevertkin // UserControlOfIdleSettings is set to IdleAllowUserControl, the user's
128540462c92SVictor Perevertkin // settings will override the default.
128640462c92SVictor Perevertkin //
128740462c92SVictor Perevertkin WDF_TRI_STATE Enabled;
128840462c92SVictor Perevertkin
128940462c92SVictor Perevertkin //
129040462c92SVictor Perevertkin // This field is applicable only when IdleCaps == IdleCannotWakeFromS0
129140462c92SVictor Perevertkin // If WdfTrue,device is powered up on System Wake even if device is idle
129240462c92SVictor Perevertkin // If WdfFalse, device is not powered up on system wake if it is idle
129340462c92SVictor Perevertkin // If WdfUseDefault, the behavior is same as WdfFalse
129440462c92SVictor Perevertkin //
129540462c92SVictor Perevertkin WDF_TRI_STATE PowerUpIdleDeviceOnSystemWake;
129640462c92SVictor Perevertkin
129740462c92SVictor Perevertkin //
129840462c92SVictor Perevertkin // This field determines how the IdleTimeout field is used.
129940462c92SVictor Perevertkin //
130040462c92SVictor Perevertkin // If the value is DriverManagedIdleTimeout, then the idle timeout value
130140462c92SVictor Perevertkin // is determined by the IdleTimeout field of this structure.
130240462c92SVictor Perevertkin //
130340462c92SVictor Perevertkin // If the value is SystemManagedIdleTimeout, then the timeout value is
130440462c92SVictor Perevertkin // determined by the power framework (PoFx) on operating systems where
130540462c92SVictor Perevertkin // the PoFx is available (i.e. Windows 8 and later). The IdleTimeout field
130640462c92SVictor Perevertkin // is ignored on these operating systems. On operating systems where the
130740462c92SVictor Perevertkin // PoFx is not available, the behavior is same as DriverManagedIdleTimeout.
130840462c92SVictor Perevertkin //
130940462c92SVictor Perevertkin // If the value is SystemManagedIdleTimeoutWithHint, then the timeout value
131040462c92SVictor Perevertkin // is determined by the power framework (PoFx) on operating systems where
131140462c92SVictor Perevertkin // the PoFx is available (i.e. Windows 8 and later). In addition, the value
131240462c92SVictor Perevertkin // specified in the IdleTimeout field is provided as a hint to the PoFx in
131340462c92SVictor Perevertkin // determining when the device should be allowed to enter a low-power state.
131440462c92SVictor Perevertkin // Since it is only a hint, the actual duration after which the PoFx allows
131540462c92SVictor Perevertkin // the device to enter a low-power state might be greater than or less than
131640462c92SVictor Perevertkin // the IdleTimeout value. On operating systems where the PoFx is not
131740462c92SVictor Perevertkin // available, the behavior is same as DriverManagedIdleTimeout.
131840462c92SVictor Perevertkin //
131940462c92SVictor Perevertkin WDF_POWER_POLICY_IDLE_TIMEOUT_TYPE IdleTimeoutType;
132040462c92SVictor Perevertkin
132140462c92SVictor Perevertkin //
132240462c92SVictor Perevertkin // This field forces the device to avoid idling in the D3cold power state.
132340462c92SVictor Perevertkin // WDF will ensure, with help from the bus drivers, that the device will
132440462c92SVictor Perevertkin // idle in a D-state that can successfully generate a wake signal, if
132540462c92SVictor Perevertkin // necessary. If the client specifies that DxState == PowerDeviceD3, this
132640462c92SVictor Perevertkin // setting allows the client to distinguish betwen D3hot and D3cold. If
132740462c92SVictor Perevertkin // the client sets DxState == PowerDeviceMaximum, then WDF will pick the
132840462c92SVictor Perevertkin // deepest idle state identified by the bus driver. If that deepest state
132940462c92SVictor Perevertkin // is D3cold, this field allows the client to override that and choose
133040462c92SVictor Perevertkin // D3hot.
133140462c92SVictor Perevertkin //
133240462c92SVictor Perevertkin // If WdfTrue, device will not use D3cold in S0.
133340462c92SVictor Perevertkin // If WdfFalse, device will use D3cold in S0 if the ACPI firmware indicates
133440462c92SVictor Perevertkin // that the device can enter that state, if DxState above does not
133540462c92SVictor Perevertkin // specify some other D-state and, if the device is armed for
133640462c92SVictor Perevertkin // wake, that it can generate its wake signal from D3cold.
133740462c92SVictor Perevertkin // If WdfUseDefault, this setting will be derived from the driver's INF,
133840462c92SVictor Perevertkin // specifically the presence or absence of the following two lines in
133940462c92SVictor Perevertkin // the DDInstall.HW section:
134040462c92SVictor Perevertkin // Include=machine.inf
134140462c92SVictor Perevertkin // Needs=PciD3ColdSupported
134240462c92SVictor Perevertkin //
134340462c92SVictor Perevertkin WDF_TRI_STATE ExcludeD3Cold;
134440462c92SVictor Perevertkin
134540462c92SVictor Perevertkin } WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS, *PWDF_DEVICE_POWER_POLICY_IDLE_SETTINGS;
134640462c92SVictor Perevertkin
134740462c92SVictor Perevertkin FORCEINLINE
1348*545df815SVictor Perevertkin VOID
WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS_INIT(_Out_ PWDF_DEVICE_POWER_POLICY_IDLE_SETTINGS Settings,_In_ WDF_POWER_POLICY_S0_IDLE_CAPABILITIES IdleCaps)134940462c92SVictor Perevertkin WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS_INIT(
135040462c92SVictor Perevertkin _Out_ PWDF_DEVICE_POWER_POLICY_IDLE_SETTINGS Settings,
135140462c92SVictor Perevertkin _In_ WDF_POWER_POLICY_S0_IDLE_CAPABILITIES IdleCaps
135240462c92SVictor Perevertkin )
135340462c92SVictor Perevertkin {
135440462c92SVictor Perevertkin RtlZeroMemory(Settings, sizeof(WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS));
135540462c92SVictor Perevertkin
135640462c92SVictor Perevertkin Settings->Size = sizeof(WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS);
135740462c92SVictor Perevertkin
135840462c92SVictor Perevertkin Settings->IdleTimeout = IdleTimeoutDefaultValue;
135940462c92SVictor Perevertkin Settings->UserControlOfIdleSettings = IdleAllowUserControl;
136040462c92SVictor Perevertkin Settings->Enabled = WdfUseDefault;
136140462c92SVictor Perevertkin Settings->PowerUpIdleDeviceOnSystemWake = WdfUseDefault;
136240462c92SVictor Perevertkin Settings->IdleTimeoutType = DriverManagedIdleTimeout;
136340462c92SVictor Perevertkin Settings->ExcludeD3Cold = WdfUseDefault;
136440462c92SVictor Perevertkin
136540462c92SVictor Perevertkin Settings->IdleCaps = IdleCaps;
136640462c92SVictor Perevertkin
136740462c92SVictor Perevertkin switch (IdleCaps) {
136840462c92SVictor Perevertkin case IdleUsbSelectiveSuspend:
136940462c92SVictor Perevertkin case IdleCanWakeFromS0:
137040462c92SVictor Perevertkin Settings->DxState = PowerDeviceMaximum;
137140462c92SVictor Perevertkin break;
137240462c92SVictor Perevertkin
137340462c92SVictor Perevertkin case IdleCannotWakeFromS0:
137440462c92SVictor Perevertkin Settings->DxState = PowerDeviceD3;
137540462c92SVictor Perevertkin break;
137640462c92SVictor Perevertkin }
137740462c92SVictor Perevertkin }
137840462c92SVictor Perevertkin
137940462c92SVictor Perevertkin typedef struct _WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS {
138040462c92SVictor Perevertkin //
138140462c92SVictor Perevertkin // Size of this structure in bytes
138240462c92SVictor Perevertkin //
138340462c92SVictor Perevertkin ULONG Size;
138440462c92SVictor Perevertkin
138540462c92SVictor Perevertkin //
138640462c92SVictor Perevertkin // The low power state in which the device will be placed when it is armed
138740462c92SVictor Perevertkin // for wake from Sx.
138840462c92SVictor Perevertkin //
138940462c92SVictor Perevertkin DEVICE_POWER_STATE DxState;
139040462c92SVictor Perevertkin
139140462c92SVictor Perevertkin //
139240462c92SVictor Perevertkin // Inidcates whether a user can control the idle policy of the device.
139340462c92SVictor Perevertkin // By default, a user is allowed to change the policy.
139440462c92SVictor Perevertkin //
139540462c92SVictor Perevertkin WDF_POWER_POLICY_SX_WAKE_USER_CONTROL UserControlOfWakeSettings;
139640462c92SVictor Perevertkin
139740462c92SVictor Perevertkin //
139840462c92SVictor Perevertkin // If WdfTrue, arming the device for wake while the machine is in Sx is
139940462c92SVictor Perevertkin // enabled.
140040462c92SVictor Perevertkin //
140140462c92SVictor Perevertkin // If WdfFalse, arming the device for wake while the machine is in Sx is
140240462c92SVictor Perevertkin // disabled.
140340462c92SVictor Perevertkin //
140440462c92SVictor Perevertkin // If WdfUseDefault, arming will be enabled. If UserControlOfWakeSettings
140540462c92SVictor Perevertkin // is set to WakeAllowUserControl, the user's settings will override the
140640462c92SVictor Perevertkin // default.
140740462c92SVictor Perevertkin //
140840462c92SVictor Perevertkin WDF_TRI_STATE Enabled;
140940462c92SVictor Perevertkin
141040462c92SVictor Perevertkin //
141140462c92SVictor Perevertkin // If set to TRUE, arming the parent device can depend on whether there
141240462c92SVictor Perevertkin // is atleast one child device armed for wake.
141340462c92SVictor Perevertkin //
141440462c92SVictor Perevertkin // If set to FALSE, arming of the parent device will be independent of
141540462c92SVictor Perevertkin // whether any of the child devices are armed for wake.
141640462c92SVictor Perevertkin //
141740462c92SVictor Perevertkin BOOLEAN ArmForWakeIfChildrenAreArmedForWake;
141840462c92SVictor Perevertkin
141940462c92SVictor Perevertkin //
142040462c92SVictor Perevertkin // Indicates that whenever the parent device completes the wake irp
142140462c92SVictor Perevertkin // successfully, the status needs to be also propagated to the child
142240462c92SVictor Perevertkin // devices. This helps in tracking which devices were responsible for
142340462c92SVictor Perevertkin // waking the system.
142440462c92SVictor Perevertkin //
142540462c92SVictor Perevertkin BOOLEAN IndicateChildWakeOnParentWake;
142640462c92SVictor Perevertkin
142740462c92SVictor Perevertkin } WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS, *PWDF_DEVICE_POWER_POLICY_WAKE_SETTINGS;
142840462c92SVictor Perevertkin
142940462c92SVictor Perevertkin FORCEINLINE
1430*545df815SVictor Perevertkin VOID
WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS_INIT(_Out_ PWDF_DEVICE_POWER_POLICY_WAKE_SETTINGS Settings)143140462c92SVictor Perevertkin WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS_INIT(
143240462c92SVictor Perevertkin _Out_ PWDF_DEVICE_POWER_POLICY_WAKE_SETTINGS Settings
143340462c92SVictor Perevertkin )
143440462c92SVictor Perevertkin {
143540462c92SVictor Perevertkin RtlZeroMemory(Settings, sizeof(WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS));
143640462c92SVictor Perevertkin
143740462c92SVictor Perevertkin Settings->Size = sizeof(WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS);
143840462c92SVictor Perevertkin
143940462c92SVictor Perevertkin Settings->Enabled = WdfUseDefault;
144040462c92SVictor Perevertkin Settings->DxState = PowerDeviceMaximum;
144140462c92SVictor Perevertkin Settings->UserControlOfWakeSettings = WakeAllowUserControl;
144240462c92SVictor Perevertkin }
144340462c92SVictor Perevertkin
144440462c92SVictor Perevertkin typedef struct _WDF_DEVICE_STATE {
144540462c92SVictor Perevertkin //
144640462c92SVictor Perevertkin // Size of this structure in bytes
144740462c92SVictor Perevertkin //
144840462c92SVictor Perevertkin ULONG Size;
144940462c92SVictor Perevertkin
145040462c92SVictor Perevertkin //
145140462c92SVictor Perevertkin // If set to WdfTrue, the device will be disabled
145240462c92SVictor Perevertkin //
145340462c92SVictor Perevertkin WDF_TRI_STATE Disabled;
145440462c92SVictor Perevertkin
145540462c92SVictor Perevertkin //
145640462c92SVictor Perevertkin // If set to WdfTrue, the device will not be displayed in device manager.
145740462c92SVictor Perevertkin // Once hidden, the device cannot be unhidden.
145840462c92SVictor Perevertkin //
145940462c92SVictor Perevertkin WDF_TRI_STATE DontDisplayInUI;
146040462c92SVictor Perevertkin
146140462c92SVictor Perevertkin //
146240462c92SVictor Perevertkin // If set to WdfTrue, the device is reporting itself as failed. If set
146340462c92SVictor Perevertkin // in conjuction with ResourcesChanged to WdfTrue, the device will receive
146440462c92SVictor Perevertkin // a PnP stop and then a new PnP start device.
146540462c92SVictor Perevertkin //
146640462c92SVictor Perevertkin WDF_TRI_STATE Failed;
146740462c92SVictor Perevertkin
146840462c92SVictor Perevertkin //
146940462c92SVictor Perevertkin // If set to WdfTrue, the device cannot be subsequently disabled.
147040462c92SVictor Perevertkin //
147140462c92SVictor Perevertkin WDF_TRI_STATE NotDisableable;
147240462c92SVictor Perevertkin
147340462c92SVictor Perevertkin
147440462c92SVictor Perevertkin //
147540462c92SVictor Perevertkin // If set to WdfTrue, the device stack will be torn down.
147640462c92SVictor Perevertkin //
147740462c92SVictor Perevertkin WDF_TRI_STATE Removed;
147840462c92SVictor Perevertkin
147940462c92SVictor Perevertkin //
148040462c92SVictor Perevertkin // If set to WdfTrue, the device will be sent another PnP start. If the
148140462c92SVictor Perevertkin // Failed field is set to WdfTrue as well, a PnP stop will be sent before
148240462c92SVictor Perevertkin // the start.
148340462c92SVictor Perevertkin //
148440462c92SVictor Perevertkin WDF_TRI_STATE ResourcesChanged;
148540462c92SVictor Perevertkin
148640462c92SVictor Perevertkin } WDF_DEVICE_STATE, *PWDF_DEVICE_STATE;
148740462c92SVictor Perevertkin
148840462c92SVictor Perevertkin FORCEINLINE
1489*545df815SVictor Perevertkin VOID
WDF_DEVICE_STATE_INIT(_Out_ PWDF_DEVICE_STATE PnpDeviceState)149040462c92SVictor Perevertkin WDF_DEVICE_STATE_INIT(
149140462c92SVictor Perevertkin _Out_ PWDF_DEVICE_STATE PnpDeviceState
149240462c92SVictor Perevertkin )
149340462c92SVictor Perevertkin {
149440462c92SVictor Perevertkin RtlZeroMemory(PnpDeviceState, sizeof(WDF_DEVICE_STATE));
149540462c92SVictor Perevertkin
149640462c92SVictor Perevertkin PnpDeviceState->Size = sizeof(WDF_DEVICE_STATE);
149740462c92SVictor Perevertkin
149840462c92SVictor Perevertkin //
149940462c92SVictor Perevertkin // Initializes all of the fields to the WdfUseDefault enum value
150040462c92SVictor Perevertkin //
150140462c92SVictor Perevertkin PnpDeviceState->Disabled = WdfUseDefault;
150240462c92SVictor Perevertkin PnpDeviceState->DontDisplayInUI = WdfUseDefault;
150340462c92SVictor Perevertkin PnpDeviceState->Failed = WdfUseDefault;
150440462c92SVictor Perevertkin PnpDeviceState->NotDisableable = WdfUseDefault;
150540462c92SVictor Perevertkin PnpDeviceState->Removed = WdfUseDefault;
150640462c92SVictor Perevertkin PnpDeviceState->ResourcesChanged = WdfUseDefault;
150740462c92SVictor Perevertkin }
150840462c92SVictor Perevertkin
150940462c92SVictor Perevertkin typedef struct _WDF_DEVICE_PNP_CAPABILITIES {
151040462c92SVictor Perevertkin //
151140462c92SVictor Perevertkin // Size of the structure in bytes
151240462c92SVictor Perevertkin //
151340462c92SVictor Perevertkin ULONG Size;
151440462c92SVictor Perevertkin
151540462c92SVictor Perevertkin //
151640462c92SVictor Perevertkin // NOTE: To mark a PDO as raw, call WdfPdoInitAssignRawDevice
151740462c92SVictor Perevertkin //
151840462c92SVictor Perevertkin
151940462c92SVictor Perevertkin WDF_TRI_STATE LockSupported;
152040462c92SVictor Perevertkin WDF_TRI_STATE EjectSupported;
152140462c92SVictor Perevertkin WDF_TRI_STATE Removable;
152240462c92SVictor Perevertkin WDF_TRI_STATE DockDevice;
152340462c92SVictor Perevertkin WDF_TRI_STATE UniqueID;
152440462c92SVictor Perevertkin WDF_TRI_STATE SilentInstall;
152540462c92SVictor Perevertkin WDF_TRI_STATE SurpriseRemovalOK;
152640462c92SVictor Perevertkin WDF_TRI_STATE HardwareDisabled;
152740462c92SVictor Perevertkin WDF_TRI_STATE NoDisplayInUI;
152840462c92SVictor Perevertkin
152940462c92SVictor Perevertkin //
153040462c92SVictor Perevertkin // Default values of -1 indicate not to set this value
153140462c92SVictor Perevertkin //
153240462c92SVictor Perevertkin ULONG Address;
153340462c92SVictor Perevertkin ULONG UINumber;
153440462c92SVictor Perevertkin
153540462c92SVictor Perevertkin } WDF_DEVICE_PNP_CAPABILITIES, *PWDF_DEVICE_PNP_CAPABILITIES;
153640462c92SVictor Perevertkin
153740462c92SVictor Perevertkin FORCEINLINE
1538*545df815SVictor Perevertkin VOID
WDF_DEVICE_PNP_CAPABILITIES_INIT(_Out_ PWDF_DEVICE_PNP_CAPABILITIES Caps)153940462c92SVictor Perevertkin WDF_DEVICE_PNP_CAPABILITIES_INIT(
154040462c92SVictor Perevertkin _Out_ PWDF_DEVICE_PNP_CAPABILITIES Caps
154140462c92SVictor Perevertkin )
154240462c92SVictor Perevertkin {
154340462c92SVictor Perevertkin RtlZeroMemory(Caps, sizeof(WDF_DEVICE_PNP_CAPABILITIES));
154440462c92SVictor Perevertkin
154540462c92SVictor Perevertkin Caps->Size = sizeof(WDF_DEVICE_PNP_CAPABILITIES);
154640462c92SVictor Perevertkin
154740462c92SVictor Perevertkin Caps->LockSupported = WdfUseDefault;
154840462c92SVictor Perevertkin Caps->EjectSupported = WdfUseDefault;
154940462c92SVictor Perevertkin Caps->Removable = WdfUseDefault;
155040462c92SVictor Perevertkin Caps->DockDevice = WdfUseDefault;
155140462c92SVictor Perevertkin Caps->UniqueID = WdfUseDefault;
155240462c92SVictor Perevertkin Caps->SilentInstall = WdfUseDefault;
155340462c92SVictor Perevertkin Caps->SurpriseRemovalOK = WdfUseDefault;
155440462c92SVictor Perevertkin Caps->HardwareDisabled = WdfUseDefault;
155540462c92SVictor Perevertkin Caps->NoDisplayInUI = WdfUseDefault;
155640462c92SVictor Perevertkin
155740462c92SVictor Perevertkin Caps->Address = (ULONG) -1;
155840462c92SVictor Perevertkin Caps->UINumber = (ULONG) -1;
155940462c92SVictor Perevertkin }
156040462c92SVictor Perevertkin
156140462c92SVictor Perevertkin typedef struct _WDF_DEVICE_POWER_CAPABILITIES {
156240462c92SVictor Perevertkin //
156340462c92SVictor Perevertkin // Size of the structure in bytes
156440462c92SVictor Perevertkin //
156540462c92SVictor Perevertkin ULONG Size;
156640462c92SVictor Perevertkin
156740462c92SVictor Perevertkin WDF_TRI_STATE DeviceD1;
156840462c92SVictor Perevertkin WDF_TRI_STATE DeviceD2;
156940462c92SVictor Perevertkin
157040462c92SVictor Perevertkin WDF_TRI_STATE WakeFromD0;
157140462c92SVictor Perevertkin WDF_TRI_STATE WakeFromD1;
157240462c92SVictor Perevertkin WDF_TRI_STATE WakeFromD2;
157340462c92SVictor Perevertkin WDF_TRI_STATE WakeFromD3;
157440462c92SVictor Perevertkin
157540462c92SVictor Perevertkin //
157640462c92SVictor Perevertkin // Default value PowerDeviceMaximum indicates not to set this value
157740462c92SVictor Perevertkin //
157840462c92SVictor Perevertkin DEVICE_POWER_STATE DeviceState[PowerSystemMaximum];
157940462c92SVictor Perevertkin
158040462c92SVictor Perevertkin //
158140462c92SVictor Perevertkin // Default value PowerDeviceMaximum, PowerSystemMaximum indicates not to
158240462c92SVictor Perevertkin // set this value.
158340462c92SVictor Perevertkin //
158440462c92SVictor Perevertkin DEVICE_POWER_STATE DeviceWake;
158540462c92SVictor Perevertkin SYSTEM_POWER_STATE SystemWake;
158640462c92SVictor Perevertkin
158740462c92SVictor Perevertkin //
158840462c92SVictor Perevertkin // Default values of -1 indicate not to set this value
158940462c92SVictor Perevertkin //
159040462c92SVictor Perevertkin ULONG D1Latency;
159140462c92SVictor Perevertkin ULONG D2Latency;
159240462c92SVictor Perevertkin ULONG D3Latency;
159340462c92SVictor Perevertkin
159440462c92SVictor Perevertkin //
159540462c92SVictor Perevertkin // Ideal Dx state for the device to be put into when the machine moves into
159640462c92SVictor Perevertkin // Sx and the device is not armed for wake. By default, the default will be
159740462c92SVictor Perevertkin // placed into D3. If IdealDxStateForSx is lighter then
159840462c92SVictor Perevertkin // DeviceState[Sx], then DeviceState[Sx] will be used as the Dx state.
159940462c92SVictor Perevertkin //
160040462c92SVictor Perevertkin DEVICE_POWER_STATE IdealDxStateForSx;
160140462c92SVictor Perevertkin
160240462c92SVictor Perevertkin } WDF_DEVICE_POWER_CAPABILITIES, *PWDF_DEVICE_POWER_CAPABILITIES;
160340462c92SVictor Perevertkin
160440462c92SVictor Perevertkin FORCEINLINE
1605*545df815SVictor Perevertkin VOID
WDF_DEVICE_POWER_CAPABILITIES_INIT(_Out_ PWDF_DEVICE_POWER_CAPABILITIES Caps)160640462c92SVictor Perevertkin WDF_DEVICE_POWER_CAPABILITIES_INIT(
160740462c92SVictor Perevertkin _Out_ PWDF_DEVICE_POWER_CAPABILITIES Caps
160840462c92SVictor Perevertkin )
160940462c92SVictor Perevertkin {
161040462c92SVictor Perevertkin ULONG i;
161140462c92SVictor Perevertkin
161240462c92SVictor Perevertkin RtlZeroMemory(Caps, sizeof(WDF_DEVICE_POWER_CAPABILITIES));
161340462c92SVictor Perevertkin
161440462c92SVictor Perevertkin Caps->Size = sizeof(WDF_DEVICE_POWER_CAPABILITIES);
161540462c92SVictor Perevertkin
161640462c92SVictor Perevertkin Caps->DeviceD1 = WdfUseDefault;
161740462c92SVictor Perevertkin Caps->DeviceD2 = WdfUseDefault;
161840462c92SVictor Perevertkin
161940462c92SVictor Perevertkin Caps->WakeFromD0 = WdfUseDefault;
162040462c92SVictor Perevertkin Caps->WakeFromD1 = WdfUseDefault;
162140462c92SVictor Perevertkin Caps->WakeFromD2 = WdfUseDefault;
162240462c92SVictor Perevertkin Caps->WakeFromD3 = WdfUseDefault;
162340462c92SVictor Perevertkin
162440462c92SVictor Perevertkin for (i = 0; i < sizeof(Caps->DeviceState)/sizeof(Caps->DeviceState[1]); i++) {
162540462c92SVictor Perevertkin Caps->DeviceState[i] = PowerDeviceMaximum;
162640462c92SVictor Perevertkin }
162740462c92SVictor Perevertkin
162840462c92SVictor Perevertkin Caps->DeviceWake = PowerDeviceMaximum;
162940462c92SVictor Perevertkin Caps->SystemWake = PowerSystemMaximum;
163040462c92SVictor Perevertkin
163140462c92SVictor Perevertkin Caps->D1Latency = (ULONG) -1;
163240462c92SVictor Perevertkin Caps->D2Latency = (ULONG) -1;
163340462c92SVictor Perevertkin Caps->D3Latency = (ULONG) -1;
163440462c92SVictor Perevertkin
163540462c92SVictor Perevertkin Caps->IdealDxStateForSx = PowerDeviceMaximum;
163640462c92SVictor Perevertkin }
163740462c92SVictor Perevertkin
163840462c92SVictor Perevertkin typedef enum _WDF_REMOVE_LOCK_OPTIONS_FLAGS {
163940462c92SVictor Perevertkin WDF_REMOVE_LOCK_OPTION_ACQUIRE_FOR_IO = 0x00000001
164040462c92SVictor Perevertkin } WDF_REMOVE_LOCK_OPTIONS_FLAGS;
164140462c92SVictor Perevertkin
164240462c92SVictor Perevertkin typedef struct _WDF_REMOVE_LOCK_OPTIONS {
164340462c92SVictor Perevertkin //
164440462c92SVictor Perevertkin // Size of the structure in bytes
164540462c92SVictor Perevertkin //
164640462c92SVictor Perevertkin ULONG Size;
164740462c92SVictor Perevertkin
164840462c92SVictor Perevertkin //
164940462c92SVictor Perevertkin // Bit field combination of values from the WDF_REMOVE_LOCK_OPTIONS_FLAGS
165040462c92SVictor Perevertkin // enumeration
165140462c92SVictor Perevertkin //
165240462c92SVictor Perevertkin ULONG Flags;
165340462c92SVictor Perevertkin } WDF_REMOVE_LOCK_OPTIONS, *PWDF_REMOVE_LOCK_OPTIONS;
165440462c92SVictor Perevertkin
165540462c92SVictor Perevertkin
165640462c92SVictor Perevertkin //
165740462c92SVictor Perevertkin // Default remove lock options initialization macro
165840462c92SVictor Perevertkin //
165940462c92SVictor Perevertkin FORCEINLINE
1660*545df815SVictor Perevertkin VOID
WDF_REMOVE_LOCK_OPTIONS_INIT(_Out_ PWDF_REMOVE_LOCK_OPTIONS RemoveLockOptions,_In_ ULONG Flags)166140462c92SVictor Perevertkin WDF_REMOVE_LOCK_OPTIONS_INIT(
166240462c92SVictor Perevertkin _Out_ PWDF_REMOVE_LOCK_OPTIONS RemoveLockOptions,
166340462c92SVictor Perevertkin _In_ ULONG Flags
166440462c92SVictor Perevertkin )
166540462c92SVictor Perevertkin {
166640462c92SVictor Perevertkin RtlZeroMemory(RemoveLockOptions, sizeof(WDF_REMOVE_LOCK_OPTIONS));
166740462c92SVictor Perevertkin
166840462c92SVictor Perevertkin RemoveLockOptions->Size = sizeof(WDF_REMOVE_LOCK_OPTIONS);
166940462c92SVictor Perevertkin RemoveLockOptions->Flags = Flags;
167040462c92SVictor Perevertkin }
167140462c92SVictor Perevertkin
167240462c92SVictor Perevertkin typedef
167340462c92SVictor Perevertkin _Function_class_(EVT_WDFDEVICE_WDM_IRP_PREPROCESS)
167440462c92SVictor Perevertkin _IRQL_requires_same_
167540462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
167640462c92SVictor Perevertkin NTSTATUS
1677*545df815SVictor Perevertkin STDCALL
167840462c92SVictor Perevertkin EVT_WDFDEVICE_WDM_IRP_PREPROCESS(
167940462c92SVictor Perevertkin _In_
168040462c92SVictor Perevertkin WDFDEVICE Device,
168140462c92SVictor Perevertkin _Inout_
168240462c92SVictor Perevertkin PIRP Irp
168340462c92SVictor Perevertkin );
168440462c92SVictor Perevertkin
168540462c92SVictor Perevertkin typedef EVT_WDFDEVICE_WDM_IRP_PREPROCESS *PFN_WDFDEVICE_WDM_IRP_PREPROCESS;
168640462c92SVictor Perevertkin
168740462c92SVictor Perevertkin typedef
168840462c92SVictor Perevertkin _Function_class_(EVT_WDFDEVICE_WDM_IRP_DISPATCH)
168940462c92SVictor Perevertkin _IRQL_requires_same_
169040462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
169140462c92SVictor Perevertkin NTSTATUS
1692*545df815SVictor Perevertkin STDCALL
169340462c92SVictor Perevertkin EVT_WDFDEVICE_WDM_IRP_DISPATCH(
169440462c92SVictor Perevertkin _In_
169540462c92SVictor Perevertkin WDFDEVICE Device,
169640462c92SVictor Perevertkin _In_
169740462c92SVictor Perevertkin UCHAR MajorFunction,
169840462c92SVictor Perevertkin _In_
169940462c92SVictor Perevertkin UCHAR MinorFunction,
170040462c92SVictor Perevertkin _In_
170140462c92SVictor Perevertkin ULONG Code,
170240462c92SVictor Perevertkin _In_
170340462c92SVictor Perevertkin WDFCONTEXT DriverContext,
170440462c92SVictor Perevertkin _Inout_
170540462c92SVictor Perevertkin PIRP Irp,
170640462c92SVictor Perevertkin _In_
170740462c92SVictor Perevertkin WDFCONTEXT DispatchContext
170840462c92SVictor Perevertkin );
170940462c92SVictor Perevertkin
171040462c92SVictor Perevertkin typedef EVT_WDFDEVICE_WDM_IRP_DISPATCH *PFN_WDFDEVICE_WDM_IRP_DISPATCH;
171140462c92SVictor Perevertkin
171240462c92SVictor Perevertkin //
171340462c92SVictor Perevertkin // This is called to pre-process a request using METHOD_NEITHER
171440462c92SVictor Perevertkin //
171540462c92SVictor Perevertkin typedef
171640462c92SVictor Perevertkin _Function_class_(EVT_WDF_IO_IN_CALLER_CONTEXT)
171740462c92SVictor Perevertkin _IRQL_requires_same_
171840462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
171940462c92SVictor Perevertkin VOID
1720*545df815SVictor Perevertkin STDCALL
172140462c92SVictor Perevertkin EVT_WDF_IO_IN_CALLER_CONTEXT(
172240462c92SVictor Perevertkin _In_
172340462c92SVictor Perevertkin WDFDEVICE Device,
172440462c92SVictor Perevertkin _In_
172540462c92SVictor Perevertkin WDFREQUEST Request
172640462c92SVictor Perevertkin );
172740462c92SVictor Perevertkin
172840462c92SVictor Perevertkin typedef EVT_WDF_IO_IN_CALLER_CONTEXT *PFN_WDF_IO_IN_CALLER_CONTEXT;
172940462c92SVictor Perevertkin
173040462c92SVictor Perevertkin typedef
173140462c92SVictor Perevertkin _Function_class_(EVT_WDFDEVICE_WDM_POST_PO_FX_REGISTER_DEVICE)
173240462c92SVictor Perevertkin _IRQL_requires_same_
173340462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
173440462c92SVictor Perevertkin NTSTATUS
1735*545df815SVictor Perevertkin STDCALL
173640462c92SVictor Perevertkin EVT_WDFDEVICE_WDM_POST_PO_FX_REGISTER_DEVICE(
173740462c92SVictor Perevertkin _In_
173840462c92SVictor Perevertkin WDFDEVICE Device,
173940462c92SVictor Perevertkin _In_
174040462c92SVictor Perevertkin POHANDLE PoHandle
174140462c92SVictor Perevertkin );
174240462c92SVictor Perevertkin
174340462c92SVictor Perevertkin typedef EVT_WDFDEVICE_WDM_POST_PO_FX_REGISTER_DEVICE *PFN_WDFDEVICE_WDM_POST_PO_FX_REGISTER_DEVICE;
174440462c92SVictor Perevertkin
174540462c92SVictor Perevertkin typedef
174640462c92SVictor Perevertkin _Function_class_(EVT_WDFDEVICE_WDM_PRE_PO_FX_UNREGISTER_DEVICE)
174740462c92SVictor Perevertkin _IRQL_requires_same_
174840462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
174940462c92SVictor Perevertkin VOID
1750*545df815SVictor Perevertkin STDCALL
175140462c92SVictor Perevertkin EVT_WDFDEVICE_WDM_PRE_PO_FX_UNREGISTER_DEVICE(
175240462c92SVictor Perevertkin _In_
175340462c92SVictor Perevertkin WDFDEVICE Device,
175440462c92SVictor Perevertkin _In_
175540462c92SVictor Perevertkin POHANDLE PoHandle
175640462c92SVictor Perevertkin );
175740462c92SVictor Perevertkin
175840462c92SVictor Perevertkin typedef EVT_WDFDEVICE_WDM_PRE_PO_FX_UNREGISTER_DEVICE *PFN_WDFDEVICE_WDM_PRE_PO_FX_UNREGISTER_DEVICE;
175940462c92SVictor Perevertkin
176040462c92SVictor Perevertkin typedef struct _WDF_POWER_FRAMEWORK_SETTINGS {
176140462c92SVictor Perevertkin //
176240462c92SVictor Perevertkin // Size of the structure, in bytes.
176340462c92SVictor Perevertkin //
176440462c92SVictor Perevertkin ULONG Size;
176540462c92SVictor Perevertkin
176640462c92SVictor Perevertkin //
176740462c92SVictor Perevertkin // Client driver's callback function that is invoked after KMDF has
176840462c92SVictor Perevertkin // registered with the power framework. This field can be NULL if the
176940462c92SVictor Perevertkin // client driver does not wish to specify this callback.
177040462c92SVictor Perevertkin //
177140462c92SVictor Perevertkin PFN_WDFDEVICE_WDM_POST_PO_FX_REGISTER_DEVICE EvtDeviceWdmPostPoFxRegisterDevice;
177240462c92SVictor Perevertkin
177340462c92SVictor Perevertkin //
177440462c92SVictor Perevertkin // Client driver's callback function that is invoked before KMDF
177540462c92SVictor Perevertkin // unregisters with the power framework. This field can be NULL if the
177640462c92SVictor Perevertkin // client driver does not wish to specify this callback.
177740462c92SVictor Perevertkin //
177840462c92SVictor Perevertkin PFN_WDFDEVICE_WDM_PRE_PO_FX_UNREGISTER_DEVICE EvtDeviceWdmPrePoFxUnregisterDevice;
177940462c92SVictor Perevertkin
178040462c92SVictor Perevertkin //
178140462c92SVictor Perevertkin // Pointer to a PO_FX_COMPONENT structure that describes the only component
178240462c92SVictor Perevertkin // in the single-component device. This field can be NULL if the client
178340462c92SVictor Perevertkin // driver wants KMDF to use the default specification for this component
178440462c92SVictor Perevertkin // (i.e. support for F0 only).
178540462c92SVictor Perevertkin //
178640462c92SVictor Perevertkin PPO_FX_COMPONENT Component;
178740462c92SVictor Perevertkin
178840462c92SVictor Perevertkin //
178940462c92SVictor Perevertkin // Client driver's PO_FX_COMPONENT_ACTIVE_CONDITION_CALLBACK callback
179040462c92SVictor Perevertkin // function. This field can be NULL if the client driver does not wish to
179140462c92SVictor Perevertkin // specify this callback.
179240462c92SVictor Perevertkin //
179340462c92SVictor Perevertkin PPO_FX_COMPONENT_ACTIVE_CONDITION_CALLBACK ComponentActiveConditionCallback;
179440462c92SVictor Perevertkin
179540462c92SVictor Perevertkin //
179640462c92SVictor Perevertkin // Client driver's PO_FX_COMPONENT_IDLE_CONDITION_CALLBACK callback
179740462c92SVictor Perevertkin // function. This field can be NULL if the client driver does not wish to
179840462c92SVictor Perevertkin // specify this callback.
179940462c92SVictor Perevertkin //
180040462c92SVictor Perevertkin PPO_FX_COMPONENT_IDLE_CONDITION_CALLBACK ComponentIdleConditionCallback;
180140462c92SVictor Perevertkin
180240462c92SVictor Perevertkin //
180340462c92SVictor Perevertkin // Client driver's PO_FX_COMPONENT_IDLE_STATE_CALLBACK callback function.
180440462c92SVictor Perevertkin // This field can be NULL if the client driver does not wish to specify
180540462c92SVictor Perevertkin // this callback.
180640462c92SVictor Perevertkin //
180740462c92SVictor Perevertkin PPO_FX_COMPONENT_IDLE_STATE_CALLBACK ComponentIdleStateCallback;
180840462c92SVictor Perevertkin
180940462c92SVictor Perevertkin //
181040462c92SVictor Perevertkin // Client driver's PO_FX_POWER_CONTROL_CALLBACK callback function. This
181140462c92SVictor Perevertkin // field can be NULL if the client driver does not wish to specify this
181240462c92SVictor Perevertkin // callback.
181340462c92SVictor Perevertkin //
181440462c92SVictor Perevertkin PPO_FX_POWER_CONTROL_CALLBACK PowerControlCallback;
181540462c92SVictor Perevertkin
181640462c92SVictor Perevertkin //
181740462c92SVictor Perevertkin // Context value that is passed in to the ComponentIdleStateCallback and
181840462c92SVictor Perevertkin // PowerControlCallback callback functions.
181940462c92SVictor Perevertkin //
182040462c92SVictor Perevertkin PVOID PoFxDeviceContext;
182140462c92SVictor Perevertkin } WDF_POWER_FRAMEWORK_SETTINGS, *PWDF_POWER_FRAMEWORK_SETTINGS;
182240462c92SVictor Perevertkin
182340462c92SVictor Perevertkin FORCEINLINE
1824*545df815SVictor Perevertkin VOID
WDF_POWER_FRAMEWORK_SETTINGS_INIT(_Out_ PWDF_POWER_FRAMEWORK_SETTINGS PowerFrameworkSettings)182540462c92SVictor Perevertkin WDF_POWER_FRAMEWORK_SETTINGS_INIT(
182640462c92SVictor Perevertkin _Out_ PWDF_POWER_FRAMEWORK_SETTINGS PowerFrameworkSettings
182740462c92SVictor Perevertkin )
182840462c92SVictor Perevertkin {
182940462c92SVictor Perevertkin RtlZeroMemory(PowerFrameworkSettings,
183040462c92SVictor Perevertkin sizeof(WDF_POWER_FRAMEWORK_SETTINGS));
183140462c92SVictor Perevertkin PowerFrameworkSettings->Size = sizeof(WDF_POWER_FRAMEWORK_SETTINGS);
183240462c92SVictor Perevertkin }
183340462c92SVictor Perevertkin
183440462c92SVictor Perevertkin
183540462c92SVictor Perevertkin typedef struct _WDF_IO_TYPE_CONFIG {
183640462c92SVictor Perevertkin //
183740462c92SVictor Perevertkin // Size of this structure in bytes
183840462c92SVictor Perevertkin //
183940462c92SVictor Perevertkin ULONG Size;
184040462c92SVictor Perevertkin
184140462c92SVictor Perevertkin //
184240462c92SVictor Perevertkin // <KMDF_DOC/>
184340462c92SVictor Perevertkin // Identifies the method that the driver will use to access data buffers
184440462c92SVictor Perevertkin // that it receives for read and write requests.
184540462c92SVictor Perevertkin //
184640462c92SVictor Perevertkin // <UMDF_DOC/>
184740462c92SVictor Perevertkin // Identifies the method that the driver will "prefer" to use to access data
184840462c92SVictor Perevertkin // buffers that it receives for read and write requests. Note that UMDF
184940462c92SVictor Perevertkin // driver provides just a preference, and not a guarantee.Therefore,
185040462c92SVictor Perevertkin // even if a driver specified direct access method, UMDF might use the
185140462c92SVictor Perevertkin // buffered access method for one or more of the device's requests to
185240462c92SVictor Perevertkin // improve performance. For example, UMDF uses buffered access for small
185340462c92SVictor Perevertkin // buffers, if it can copy the data to the driver's buffer faster than it
185440462c92SVictor Perevertkin // can map the buffers for direct access.
185540462c92SVictor Perevertkin //
185640462c92SVictor Perevertkin WDF_DEVICE_IO_TYPE ReadWriteIoType;
185740462c92SVictor Perevertkin
185840462c92SVictor Perevertkin //
185940462c92SVictor Perevertkin // <UMDF_ONLY/>
186040462c92SVictor Perevertkin // Identifies the method that the driver will "prefer" to use to access data
186140462c92SVictor Perevertkin // buffers that it receives for IOCTL requests. Note that UMDF
186240462c92SVictor Perevertkin // driver provides just a preference, and not a guarantee. Therefore,
186340462c92SVictor Perevertkin // even if a driver specified direct access method, UMDF might use the
186440462c92SVictor Perevertkin // buffered access method for one or more of the device's requests to
186540462c92SVictor Perevertkin // improve performance. For example, UMDF uses buffered access for small
186640462c92SVictor Perevertkin // buffers, if it can copy the data to the driver's buffer faster than it
186740462c92SVictor Perevertkin // can map the buffers for direct access.
186840462c92SVictor Perevertkin //
186940462c92SVictor Perevertkin WDF_DEVICE_IO_TYPE DeviceControlIoType;
187040462c92SVictor Perevertkin
187140462c92SVictor Perevertkin //
187240462c92SVictor Perevertkin // <UMDF_ONLY/>
187340462c92SVictor Perevertkin // Optional, Provides the smallest buffer size (in bytes) for which
187440462c92SVictor Perevertkin // UMDF will use direct access for the buffers. For example, set
187540462c92SVictor Perevertkin // DirectTransferThreshold to "12288" to indicate that UMDF should use buffered
187640462c92SVictor Perevertkin // access for all buffers that are smaller than 12 kilobytes, and direct
187740462c92SVictor Perevertkin // access for buffers equal to or greater than that. Typically, you
187840462c92SVictor Perevertkin // do not need to provide this value because UMDF uses a value that provides
187940462c92SVictor Perevertkin // the best performance. Note that there are other requirements that must be
188040462c92SVictor Perevertkin // met in order to get direct access of buffers. See Docs for details.
188140462c92SVictor Perevertkin //
188240462c92SVictor Perevertkin ULONG DirectTransferThreshold;
188340462c92SVictor Perevertkin
188440462c92SVictor Perevertkin } WDF_IO_TYPE_CONFIG, *PWDF_IO_TYPE_CONFIG;
188540462c92SVictor Perevertkin
188640462c92SVictor Perevertkin FORCEINLINE
1887*545df815SVictor Perevertkin VOID
WDF_IO_TYPE_CONFIG_INIT(_Out_ PWDF_IO_TYPE_CONFIG IoTypeConfig)188840462c92SVictor Perevertkin WDF_IO_TYPE_CONFIG_INIT(
188940462c92SVictor Perevertkin _Out_ PWDF_IO_TYPE_CONFIG IoTypeConfig
189040462c92SVictor Perevertkin )
189140462c92SVictor Perevertkin {
189240462c92SVictor Perevertkin RtlZeroMemory(IoTypeConfig, sizeof(WDF_IO_TYPE_CONFIG));
189340462c92SVictor Perevertkin IoTypeConfig->Size = sizeof(WDF_IO_TYPE_CONFIG);
189440462c92SVictor Perevertkin IoTypeConfig->ReadWriteIoType = WdfDeviceIoBuffered;
189540462c92SVictor Perevertkin IoTypeConfig->DeviceControlIoType = WdfDeviceIoBuffered;
189640462c92SVictor Perevertkin }
189740462c92SVictor Perevertkin
189840462c92SVictor Perevertkin
189940462c92SVictor Perevertkin
190040462c92SVictor Perevertkin
190140462c92SVictor Perevertkin
190240462c92SVictor Perevertkin typedef struct _WDF_DEVICE_PROPERTY_DATA {
190340462c92SVictor Perevertkin //
190440462c92SVictor Perevertkin // Size of this structure
190540462c92SVictor Perevertkin //
190640462c92SVictor Perevertkin _In_ ULONG Size;
190740462c92SVictor Perevertkin
190840462c92SVictor Perevertkin //
190940462c92SVictor Perevertkin // A pointer to a DEVPROPKEY structure that specifies the device
191040462c92SVictor Perevertkin // property key.
191140462c92SVictor Perevertkin //
191240462c92SVictor Perevertkin _In_ const DEVPROPKEY * PropertyKey;
191340462c92SVictor Perevertkin
191440462c92SVictor Perevertkin //
191540462c92SVictor Perevertkin // A locale identifier. Set this parameter either to a language-specific
191640462c92SVictor Perevertkin // LCID value or to LOCALE_NEUTRAL. The LOCALE_NEUTRAL LCID specifies
191740462c92SVictor Perevertkin // that the property is language-neutral (that is, not specific to any
191840462c92SVictor Perevertkin // language). Do not set this parameter to LOCALE_SYSTEM_DEFAULT or
191940462c92SVictor Perevertkin // LOCALE_USER_DEFAULT. For more information about language-specific
192040462c92SVictor Perevertkin // LCID values, see LCID Structure.
192140462c92SVictor Perevertkin //
192240462c92SVictor Perevertkin _In_ LCID Lcid;
192340462c92SVictor Perevertkin
192440462c92SVictor Perevertkin //
192540462c92SVictor Perevertkin // Set this parameter to PLUGPLAY_PROPERTY_PERSISTENT if the property
192640462c92SVictor Perevertkin // value set by this routine should persist across computer restarts.
192740462c92SVictor Perevertkin // Otherwise, set Flags to zero. Ignored for Query DDIs.
192840462c92SVictor Perevertkin //
192940462c92SVictor Perevertkin _In_ ULONG Flags;
193040462c92SVictor Perevertkin
193140462c92SVictor Perevertkin } WDF_DEVICE_PROPERTY_DATA, *PWDF_DEVICE_PROPERTY_DATA;
193240462c92SVictor Perevertkin
193340462c92SVictor Perevertkin FORCEINLINE
193440462c92SVictor Perevertkin VOID
WDF_DEVICE_PROPERTY_DATA_INIT(_Out_ PWDF_DEVICE_PROPERTY_DATA PropertyData,_In_ const DEVPROPKEY * PropertyKey)193540462c92SVictor Perevertkin WDF_DEVICE_PROPERTY_DATA_INIT (
193640462c92SVictor Perevertkin _Out_ PWDF_DEVICE_PROPERTY_DATA PropertyData,
193740462c92SVictor Perevertkin _In_ const DEVPROPKEY* PropertyKey
193840462c92SVictor Perevertkin )
193940462c92SVictor Perevertkin {
194040462c92SVictor Perevertkin RtlZeroMemory(PropertyData, sizeof(* PropertyData));
194140462c92SVictor Perevertkin
194240462c92SVictor Perevertkin PropertyData->Size = sizeof(*PropertyData);
194340462c92SVictor Perevertkin PropertyData->PropertyKey = PropertyKey;
194440462c92SVictor Perevertkin }
194540462c92SVictor Perevertkin
194640462c92SVictor Perevertkin //
194740462c92SVictor Perevertkin // VOID
194840462c92SVictor Perevertkin // WdfDeviceStopIdle(
194940462c92SVictor Perevertkin // _In_ WDFDEVICE Device,
195040462c92SVictor Perevertkin // _In_ BOOLEAN WaitForD0
195140462c92SVictor Perevertkin // );
195240462c92SVictor Perevertkin //
195340462c92SVictor Perevertkin // VOID
195440462c92SVictor Perevertkin // WdfDeviceStopIdleWithTag(
195540462c92SVictor Perevertkin // _In_ WDFDEVICE Device,
195640462c92SVictor Perevertkin // _In_ BOOLEAN WaitForD0,
195740462c92SVictor Perevertkin // _In_ PVOID Tag
195840462c92SVictor Perevertkin // );
195940462c92SVictor Perevertkin //
196040462c92SVictor Perevertkin // VOID
196140462c92SVictor Perevertkin // WdfDeviceResumeIdle(
196240462c92SVictor Perevertkin // _In_ WDFDEVICE Device
196340462c92SVictor Perevertkin // );
196440462c92SVictor Perevertkin //
196540462c92SVictor Perevertkin // VOID
196640462c92SVictor Perevertkin // WdfDeviceResumeIdleWithTag(
196740462c92SVictor Perevertkin // _In_ WDFDEVICE Device
196840462c92SVictor Perevertkin // _In_ PVOID Tag
196940462c92SVictor Perevertkin // );
197040462c92SVictor Perevertkin //
197140462c92SVictor Perevertkin #define WdfDeviceStopIdle(Device, WaitForD0) \
197240462c92SVictor Perevertkin WdfDeviceStopIdleWithTag(Device, WaitForD0, NULL)
197340462c92SVictor Perevertkin
197440462c92SVictor Perevertkin #define WdfDeviceStopIdleWithTag(Device, WaitForD0, Tag) \
197540462c92SVictor Perevertkin WdfDeviceStopIdleActual(Device, WaitForD0, Tag, __LINE__, __FILE__)
197640462c92SVictor Perevertkin
197740462c92SVictor Perevertkin #define WdfDeviceResumeIdle(Device) \
197840462c92SVictor Perevertkin WdfDeviceResumeIdleWithTag(Device, NULL)
197940462c92SVictor Perevertkin
198040462c92SVictor Perevertkin #define WdfDeviceResumeIdleWithTag(Device, Tag) \
198140462c92SVictor Perevertkin WdfDeviceResumeIdleActual(Device, Tag, __LINE__, __FILE__)
198240462c92SVictor Perevertkin
198340462c92SVictor Perevertkin
198440462c92SVictor Perevertkin
198540462c92SVictor Perevertkin //
198640462c92SVictor Perevertkin // WDF Function: WdfDeviceGetDeviceState
198740462c92SVictor Perevertkin //
198840462c92SVictor Perevertkin typedef
198940462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
199040462c92SVictor Perevertkin WDFAPI
199140462c92SVictor Perevertkin VOID
1992*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEGETDEVICESTATE)(
199340462c92SVictor Perevertkin _In_
199440462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
199540462c92SVictor Perevertkin _In_
199640462c92SVictor Perevertkin WDFDEVICE Device,
199740462c92SVictor Perevertkin _Out_
199840462c92SVictor Perevertkin PWDF_DEVICE_STATE DeviceState
199940462c92SVictor Perevertkin );
200040462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)200140462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
200240462c92SVictor Perevertkin FORCEINLINE
2003*545df815SVictor Perevertkin VOID
200440462c92SVictor Perevertkin WdfDeviceGetDeviceState(
200540462c92SVictor Perevertkin _In_
200640462c92SVictor Perevertkin WDFDEVICE Device,
200740462c92SVictor Perevertkin _Out_
200840462c92SVictor Perevertkin PWDF_DEVICE_STATE DeviceState
200940462c92SVictor Perevertkin )
201040462c92SVictor Perevertkin {
201140462c92SVictor Perevertkin ((PFN_WDFDEVICEGETDEVICESTATE) WdfFunctions[WdfDeviceGetDeviceStateTableIndex])(WdfDriverGlobals, Device, DeviceState);
201240462c92SVictor Perevertkin }
201340462c92SVictor Perevertkin
201440462c92SVictor Perevertkin //
201540462c92SVictor Perevertkin // WDF Function: WdfDeviceSetDeviceState
201640462c92SVictor Perevertkin //
201740462c92SVictor Perevertkin typedef
201840462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
201940462c92SVictor Perevertkin WDFAPI
202040462c92SVictor Perevertkin VOID
2021*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICESETDEVICESTATE)(
202240462c92SVictor Perevertkin _In_
202340462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
202440462c92SVictor Perevertkin _In_
202540462c92SVictor Perevertkin WDFDEVICE Device,
202640462c92SVictor Perevertkin _In_
202740462c92SVictor Perevertkin PWDF_DEVICE_STATE DeviceState
202840462c92SVictor Perevertkin );
202940462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)203040462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
203140462c92SVictor Perevertkin FORCEINLINE
2032*545df815SVictor Perevertkin VOID
203340462c92SVictor Perevertkin WdfDeviceSetDeviceState(
203440462c92SVictor Perevertkin _In_
203540462c92SVictor Perevertkin WDFDEVICE Device,
203640462c92SVictor Perevertkin _In_
203740462c92SVictor Perevertkin PWDF_DEVICE_STATE DeviceState
203840462c92SVictor Perevertkin )
203940462c92SVictor Perevertkin {
204040462c92SVictor Perevertkin ((PFN_WDFDEVICESETDEVICESTATE) WdfFunctions[WdfDeviceSetDeviceStateTableIndex])(WdfDriverGlobals, Device, DeviceState);
204140462c92SVictor Perevertkin }
204240462c92SVictor Perevertkin
204340462c92SVictor Perevertkin //
204440462c92SVictor Perevertkin // WDF Function: WdfWdmDeviceGetWdfDeviceHandle
204540462c92SVictor Perevertkin //
204640462c92SVictor Perevertkin typedef
204740462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
204840462c92SVictor Perevertkin WDFAPI
204940462c92SVictor Perevertkin WDFDEVICE
2050*545df815SVictor Perevertkin (STDCALL *PFN_WDFWDMDEVICEGETWDFDEVICEHANDLE)(
205140462c92SVictor Perevertkin _In_
205240462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
205340462c92SVictor Perevertkin _In_
205440462c92SVictor Perevertkin PDEVICE_OBJECT DeviceObject
205540462c92SVictor Perevertkin );
205640462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)205740462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
205840462c92SVictor Perevertkin FORCEINLINE
2059*545df815SVictor Perevertkin WDFDEVICE
206040462c92SVictor Perevertkin WdfWdmDeviceGetWdfDeviceHandle(
206140462c92SVictor Perevertkin _In_
206240462c92SVictor Perevertkin PDEVICE_OBJECT DeviceObject
206340462c92SVictor Perevertkin )
206440462c92SVictor Perevertkin {
206540462c92SVictor Perevertkin return ((PFN_WDFWDMDEVICEGETWDFDEVICEHANDLE) WdfFunctions[WdfWdmDeviceGetWdfDeviceHandleTableIndex])(WdfDriverGlobals, DeviceObject);
206640462c92SVictor Perevertkin }
206740462c92SVictor Perevertkin
206840462c92SVictor Perevertkin //
206940462c92SVictor Perevertkin // WDF Function: WdfDeviceWdmGetDeviceObject
207040462c92SVictor Perevertkin //
207140462c92SVictor Perevertkin typedef
207240462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
207340462c92SVictor Perevertkin WDFAPI
207440462c92SVictor Perevertkin PDEVICE_OBJECT
2075*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEWDMGETDEVICEOBJECT)(
207640462c92SVictor Perevertkin _In_
207740462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
207840462c92SVictor Perevertkin _In_
207940462c92SVictor Perevertkin WDFDEVICE Device
208040462c92SVictor Perevertkin );
208140462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)208240462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
208340462c92SVictor Perevertkin FORCEINLINE
2084*545df815SVictor Perevertkin PDEVICE_OBJECT
208540462c92SVictor Perevertkin WdfDeviceWdmGetDeviceObject(
208640462c92SVictor Perevertkin _In_
208740462c92SVictor Perevertkin WDFDEVICE Device
208840462c92SVictor Perevertkin )
208940462c92SVictor Perevertkin {
209040462c92SVictor Perevertkin return ((PFN_WDFDEVICEWDMGETDEVICEOBJECT) WdfFunctions[WdfDeviceWdmGetDeviceObjectTableIndex])(WdfDriverGlobals, Device);
209140462c92SVictor Perevertkin }
209240462c92SVictor Perevertkin
209340462c92SVictor Perevertkin //
209440462c92SVictor Perevertkin // WDF Function: WdfDeviceWdmGetAttachedDevice
209540462c92SVictor Perevertkin //
209640462c92SVictor Perevertkin typedef
209740462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
209840462c92SVictor Perevertkin WDFAPI
209940462c92SVictor Perevertkin PDEVICE_OBJECT
2100*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEWDMGETATTACHEDDEVICE)(
210140462c92SVictor Perevertkin _In_
210240462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
210340462c92SVictor Perevertkin _In_
210440462c92SVictor Perevertkin WDFDEVICE Device
210540462c92SVictor Perevertkin );
210640462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)210740462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
210840462c92SVictor Perevertkin FORCEINLINE
2109*545df815SVictor Perevertkin PDEVICE_OBJECT
211040462c92SVictor Perevertkin WdfDeviceWdmGetAttachedDevice(
211140462c92SVictor Perevertkin _In_
211240462c92SVictor Perevertkin WDFDEVICE Device
211340462c92SVictor Perevertkin )
211440462c92SVictor Perevertkin {
211540462c92SVictor Perevertkin return ((PFN_WDFDEVICEWDMGETATTACHEDDEVICE) WdfFunctions[WdfDeviceWdmGetAttachedDeviceTableIndex])(WdfDriverGlobals, Device);
211640462c92SVictor Perevertkin }
211740462c92SVictor Perevertkin
211840462c92SVictor Perevertkin //
211940462c92SVictor Perevertkin // WDF Function: WdfDeviceWdmGetPhysicalDevice
212040462c92SVictor Perevertkin //
212140462c92SVictor Perevertkin typedef
212240462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
212340462c92SVictor Perevertkin WDFAPI
212440462c92SVictor Perevertkin PDEVICE_OBJECT
2125*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEWDMGETPHYSICALDEVICE)(
212640462c92SVictor Perevertkin _In_
212740462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
212840462c92SVictor Perevertkin _In_
212940462c92SVictor Perevertkin WDFDEVICE Device
213040462c92SVictor Perevertkin );
213140462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)213240462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
213340462c92SVictor Perevertkin FORCEINLINE
2134*545df815SVictor Perevertkin PDEVICE_OBJECT
213540462c92SVictor Perevertkin WdfDeviceWdmGetPhysicalDevice(
213640462c92SVictor Perevertkin _In_
213740462c92SVictor Perevertkin WDFDEVICE Device
213840462c92SVictor Perevertkin )
213940462c92SVictor Perevertkin {
214040462c92SVictor Perevertkin return ((PFN_WDFDEVICEWDMGETPHYSICALDEVICE) WdfFunctions[WdfDeviceWdmGetPhysicalDeviceTableIndex])(WdfDriverGlobals, Device);
214140462c92SVictor Perevertkin }
214240462c92SVictor Perevertkin
214340462c92SVictor Perevertkin //
214440462c92SVictor Perevertkin // WDF Function: WdfDeviceWdmDispatchPreprocessedIrp
214540462c92SVictor Perevertkin //
214640462c92SVictor Perevertkin typedef
214740462c92SVictor Perevertkin _Must_inspect_result_
214840462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
214940462c92SVictor Perevertkin WDFAPI
215040462c92SVictor Perevertkin NTSTATUS
2151*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEWDMDISPATCHPREPROCESSEDIRP)(
215240462c92SVictor Perevertkin _In_
215340462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
215440462c92SVictor Perevertkin _In_
215540462c92SVictor Perevertkin WDFDEVICE Device,
215640462c92SVictor Perevertkin _In_
215740462c92SVictor Perevertkin PIRP Irp
215840462c92SVictor Perevertkin );
215940462c92SVictor Perevertkin
216040462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(DISPATCH_LEVEL)216140462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
216240462c92SVictor Perevertkin FORCEINLINE
2163*545df815SVictor Perevertkin NTSTATUS
216440462c92SVictor Perevertkin WdfDeviceWdmDispatchPreprocessedIrp(
216540462c92SVictor Perevertkin _In_
216640462c92SVictor Perevertkin WDFDEVICE Device,
216740462c92SVictor Perevertkin _In_
216840462c92SVictor Perevertkin PIRP Irp
216940462c92SVictor Perevertkin )
217040462c92SVictor Perevertkin {
217140462c92SVictor Perevertkin return ((PFN_WDFDEVICEWDMDISPATCHPREPROCESSEDIRP) WdfFunctions[WdfDeviceWdmDispatchPreprocessedIrpTableIndex])(WdfDriverGlobals, Device, Irp);
217240462c92SVictor Perevertkin }
217340462c92SVictor Perevertkin
217440462c92SVictor Perevertkin //
217540462c92SVictor Perevertkin // WDF Function: WdfDeviceWdmDispatchIrp
217640462c92SVictor Perevertkin //
217740462c92SVictor Perevertkin typedef
217840462c92SVictor Perevertkin _Must_inspect_result_
217940462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
218040462c92SVictor Perevertkin WDFAPI
218140462c92SVictor Perevertkin NTSTATUS
2182*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEWDMDISPATCHIRP)(
218340462c92SVictor Perevertkin _In_
218440462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
218540462c92SVictor Perevertkin _In_
218640462c92SVictor Perevertkin WDFDEVICE Device,
218740462c92SVictor Perevertkin _In_
218840462c92SVictor Perevertkin PIRP Irp,
218940462c92SVictor Perevertkin _In_
219040462c92SVictor Perevertkin WDFCONTEXT DispatchContext
219140462c92SVictor Perevertkin );
219240462c92SVictor Perevertkin
219340462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(DISPATCH_LEVEL)219440462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
219540462c92SVictor Perevertkin FORCEINLINE
2196*545df815SVictor Perevertkin NTSTATUS
219740462c92SVictor Perevertkin WdfDeviceWdmDispatchIrp(
219840462c92SVictor Perevertkin _In_
219940462c92SVictor Perevertkin WDFDEVICE Device,
220040462c92SVictor Perevertkin _In_
220140462c92SVictor Perevertkin PIRP Irp,
220240462c92SVictor Perevertkin _In_
220340462c92SVictor Perevertkin WDFCONTEXT DispatchContext
220440462c92SVictor Perevertkin )
220540462c92SVictor Perevertkin {
220640462c92SVictor Perevertkin return ((PFN_WDFDEVICEWDMDISPATCHIRP) WdfFunctions[WdfDeviceWdmDispatchIrpTableIndex])(WdfDriverGlobals, Device, Irp, DispatchContext);
220740462c92SVictor Perevertkin }
220840462c92SVictor Perevertkin
220940462c92SVictor Perevertkin //
221040462c92SVictor Perevertkin // WDF Function: WdfDeviceWdmDispatchIrpToIoQueue
221140462c92SVictor Perevertkin //
221240462c92SVictor Perevertkin typedef
221340462c92SVictor Perevertkin _Must_inspect_result_
221440462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
221540462c92SVictor Perevertkin WDFAPI
221640462c92SVictor Perevertkin NTSTATUS
2217*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEWDMDISPATCHIRPTOIOQUEUE)(
221840462c92SVictor Perevertkin _In_
221940462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
222040462c92SVictor Perevertkin _In_
222140462c92SVictor Perevertkin WDFDEVICE Device,
222240462c92SVictor Perevertkin _In_
222340462c92SVictor Perevertkin PIRP Irp,
222440462c92SVictor Perevertkin _In_
222540462c92SVictor Perevertkin WDFQUEUE Queue,
222640462c92SVictor Perevertkin _In_
222740462c92SVictor Perevertkin ULONG Flags
222840462c92SVictor Perevertkin );
222940462c92SVictor Perevertkin
223040462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(DISPATCH_LEVEL)223140462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
223240462c92SVictor Perevertkin FORCEINLINE
2233*545df815SVictor Perevertkin NTSTATUS
223440462c92SVictor Perevertkin WdfDeviceWdmDispatchIrpToIoQueue(
223540462c92SVictor Perevertkin _In_
223640462c92SVictor Perevertkin WDFDEVICE Device,
223740462c92SVictor Perevertkin _In_
223840462c92SVictor Perevertkin PIRP Irp,
223940462c92SVictor Perevertkin _In_
224040462c92SVictor Perevertkin WDFQUEUE Queue,
224140462c92SVictor Perevertkin _In_
224240462c92SVictor Perevertkin ULONG Flags
224340462c92SVictor Perevertkin )
224440462c92SVictor Perevertkin {
224540462c92SVictor Perevertkin return ((PFN_WDFDEVICEWDMDISPATCHIRPTOIOQUEUE) WdfFunctions[WdfDeviceWdmDispatchIrpToIoQueueTableIndex])(WdfDriverGlobals, Device, Irp, Queue, Flags);
224640462c92SVictor Perevertkin }
224740462c92SVictor Perevertkin
224840462c92SVictor Perevertkin //
224940462c92SVictor Perevertkin // WDF Function: WdfDeviceAddDependentUsageDeviceObject
225040462c92SVictor Perevertkin //
225140462c92SVictor Perevertkin typedef
225240462c92SVictor Perevertkin _Must_inspect_result_
225340462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
225440462c92SVictor Perevertkin WDFAPI
225540462c92SVictor Perevertkin NTSTATUS
2256*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEADDDEPENDENTUSAGEDEVICEOBJECT)(
225740462c92SVictor Perevertkin _In_
225840462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
225940462c92SVictor Perevertkin _In_
226040462c92SVictor Perevertkin WDFDEVICE Device,
226140462c92SVictor Perevertkin _In_
226240462c92SVictor Perevertkin PDEVICE_OBJECT DependentDevice
226340462c92SVictor Perevertkin );
226440462c92SVictor Perevertkin
226540462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(DISPATCH_LEVEL)226640462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
226740462c92SVictor Perevertkin FORCEINLINE
2268*545df815SVictor Perevertkin NTSTATUS
226940462c92SVictor Perevertkin WdfDeviceAddDependentUsageDeviceObject(
227040462c92SVictor Perevertkin _In_
227140462c92SVictor Perevertkin WDFDEVICE Device,
227240462c92SVictor Perevertkin _In_
227340462c92SVictor Perevertkin PDEVICE_OBJECT DependentDevice
227440462c92SVictor Perevertkin )
227540462c92SVictor Perevertkin {
227640462c92SVictor Perevertkin return ((PFN_WDFDEVICEADDDEPENDENTUSAGEDEVICEOBJECT) WdfFunctions[WdfDeviceAddDependentUsageDeviceObjectTableIndex])(WdfDriverGlobals, Device, DependentDevice);
227740462c92SVictor Perevertkin }
227840462c92SVictor Perevertkin
227940462c92SVictor Perevertkin //
228040462c92SVictor Perevertkin // WDF Function: WdfDeviceRemoveDependentUsageDeviceObject
228140462c92SVictor Perevertkin //
228240462c92SVictor Perevertkin typedef
228340462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
228440462c92SVictor Perevertkin WDFAPI
228540462c92SVictor Perevertkin VOID
2286*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEREMOVEDEPENDENTUSAGEDEVICEOBJECT)(
228740462c92SVictor Perevertkin _In_
228840462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
228940462c92SVictor Perevertkin _In_
229040462c92SVictor Perevertkin WDFDEVICE Device,
229140462c92SVictor Perevertkin _In_
229240462c92SVictor Perevertkin PDEVICE_OBJECT DependentDevice
229340462c92SVictor Perevertkin );
229440462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)229540462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
229640462c92SVictor Perevertkin FORCEINLINE
2297*545df815SVictor Perevertkin VOID
229840462c92SVictor Perevertkin WdfDeviceRemoveDependentUsageDeviceObject(
229940462c92SVictor Perevertkin _In_
230040462c92SVictor Perevertkin WDFDEVICE Device,
230140462c92SVictor Perevertkin _In_
230240462c92SVictor Perevertkin PDEVICE_OBJECT DependentDevice
230340462c92SVictor Perevertkin )
230440462c92SVictor Perevertkin {
230540462c92SVictor Perevertkin ((PFN_WDFDEVICEREMOVEDEPENDENTUSAGEDEVICEOBJECT) WdfFunctions[WdfDeviceRemoveDependentUsageDeviceObjectTableIndex])(WdfDriverGlobals, Device, DependentDevice);
230640462c92SVictor Perevertkin }
230740462c92SVictor Perevertkin
230840462c92SVictor Perevertkin //
230940462c92SVictor Perevertkin // WDF Function: WdfDeviceAddRemovalRelationsPhysicalDevice
231040462c92SVictor Perevertkin //
231140462c92SVictor Perevertkin typedef
231240462c92SVictor Perevertkin _Must_inspect_result_
231340462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
231440462c92SVictor Perevertkin WDFAPI
231540462c92SVictor Perevertkin NTSTATUS
2316*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEADDREMOVALRELATIONSPHYSICALDEVICE)(
231740462c92SVictor Perevertkin _In_
231840462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
231940462c92SVictor Perevertkin _In_
232040462c92SVictor Perevertkin WDFDEVICE Device,
232140462c92SVictor Perevertkin _In_
232240462c92SVictor Perevertkin PDEVICE_OBJECT PhysicalDevice
232340462c92SVictor Perevertkin );
232440462c92SVictor Perevertkin
232540462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(DISPATCH_LEVEL)232640462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
232740462c92SVictor Perevertkin FORCEINLINE
2328*545df815SVictor Perevertkin NTSTATUS
232940462c92SVictor Perevertkin WdfDeviceAddRemovalRelationsPhysicalDevice(
233040462c92SVictor Perevertkin _In_
233140462c92SVictor Perevertkin WDFDEVICE Device,
233240462c92SVictor Perevertkin _In_
233340462c92SVictor Perevertkin PDEVICE_OBJECT PhysicalDevice
233440462c92SVictor Perevertkin )
233540462c92SVictor Perevertkin {
233640462c92SVictor Perevertkin return ((PFN_WDFDEVICEADDREMOVALRELATIONSPHYSICALDEVICE) WdfFunctions[WdfDeviceAddRemovalRelationsPhysicalDeviceTableIndex])(WdfDriverGlobals, Device, PhysicalDevice);
233740462c92SVictor Perevertkin }
233840462c92SVictor Perevertkin
233940462c92SVictor Perevertkin //
234040462c92SVictor Perevertkin // WDF Function: WdfDeviceRemoveRemovalRelationsPhysicalDevice
234140462c92SVictor Perevertkin //
234240462c92SVictor Perevertkin typedef
234340462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
234440462c92SVictor Perevertkin WDFAPI
234540462c92SVictor Perevertkin VOID
2346*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEREMOVEREMOVALRELATIONSPHYSICALDEVICE)(
234740462c92SVictor Perevertkin _In_
234840462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
234940462c92SVictor Perevertkin _In_
235040462c92SVictor Perevertkin WDFDEVICE Device,
235140462c92SVictor Perevertkin _In_
235240462c92SVictor Perevertkin PDEVICE_OBJECT PhysicalDevice
235340462c92SVictor Perevertkin );
235440462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)235540462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
235640462c92SVictor Perevertkin FORCEINLINE
2357*545df815SVictor Perevertkin VOID
235840462c92SVictor Perevertkin WdfDeviceRemoveRemovalRelationsPhysicalDevice(
235940462c92SVictor Perevertkin _In_
236040462c92SVictor Perevertkin WDFDEVICE Device,
236140462c92SVictor Perevertkin _In_
236240462c92SVictor Perevertkin PDEVICE_OBJECT PhysicalDevice
236340462c92SVictor Perevertkin )
236440462c92SVictor Perevertkin {
236540462c92SVictor Perevertkin ((PFN_WDFDEVICEREMOVEREMOVALRELATIONSPHYSICALDEVICE) WdfFunctions[WdfDeviceRemoveRemovalRelationsPhysicalDeviceTableIndex])(WdfDriverGlobals, Device, PhysicalDevice);
236640462c92SVictor Perevertkin }
236740462c92SVictor Perevertkin
236840462c92SVictor Perevertkin //
236940462c92SVictor Perevertkin // WDF Function: WdfDeviceClearRemovalRelationsDevices
237040462c92SVictor Perevertkin //
237140462c92SVictor Perevertkin typedef
237240462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
237340462c92SVictor Perevertkin WDFAPI
237440462c92SVictor Perevertkin VOID
2375*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICECLEARREMOVALRELATIONSDEVICES)(
237640462c92SVictor Perevertkin _In_
237740462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
237840462c92SVictor Perevertkin _In_
237940462c92SVictor Perevertkin WDFDEVICE Device
238040462c92SVictor Perevertkin );
238140462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)238240462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
238340462c92SVictor Perevertkin FORCEINLINE
2384*545df815SVictor Perevertkin VOID
238540462c92SVictor Perevertkin WdfDeviceClearRemovalRelationsDevices(
238640462c92SVictor Perevertkin _In_
238740462c92SVictor Perevertkin WDFDEVICE Device
238840462c92SVictor Perevertkin )
238940462c92SVictor Perevertkin {
239040462c92SVictor Perevertkin ((PFN_WDFDEVICECLEARREMOVALRELATIONSDEVICES) WdfFunctions[WdfDeviceClearRemovalRelationsDevicesTableIndex])(WdfDriverGlobals, Device);
239140462c92SVictor Perevertkin }
239240462c92SVictor Perevertkin
239340462c92SVictor Perevertkin //
239440462c92SVictor Perevertkin // WDF Function: WdfDeviceGetDriver
239540462c92SVictor Perevertkin //
239640462c92SVictor Perevertkin typedef
239740462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
239840462c92SVictor Perevertkin WDFAPI
239940462c92SVictor Perevertkin WDFDRIVER
2400*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEGETDRIVER)(
240140462c92SVictor Perevertkin _In_
240240462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
240340462c92SVictor Perevertkin _In_
240440462c92SVictor Perevertkin WDFDEVICE Device
240540462c92SVictor Perevertkin );
240640462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)240740462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
240840462c92SVictor Perevertkin FORCEINLINE
2409*545df815SVictor Perevertkin WDFDRIVER
241040462c92SVictor Perevertkin WdfDeviceGetDriver(
241140462c92SVictor Perevertkin _In_
241240462c92SVictor Perevertkin WDFDEVICE Device
241340462c92SVictor Perevertkin )
241440462c92SVictor Perevertkin {
241540462c92SVictor Perevertkin return ((PFN_WDFDEVICEGETDRIVER) WdfFunctions[WdfDeviceGetDriverTableIndex])(WdfDriverGlobals, Device);
241640462c92SVictor Perevertkin }
241740462c92SVictor Perevertkin
241840462c92SVictor Perevertkin //
241940462c92SVictor Perevertkin // WDF Function: WdfDeviceRetrieveDeviceName
242040462c92SVictor Perevertkin //
242140462c92SVictor Perevertkin typedef
242240462c92SVictor Perevertkin _Must_inspect_result_
242340462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
242440462c92SVictor Perevertkin WDFAPI
242540462c92SVictor Perevertkin NTSTATUS
2426*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICERETRIEVEDEVICENAME)(
242740462c92SVictor Perevertkin _In_
242840462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
242940462c92SVictor Perevertkin _In_
243040462c92SVictor Perevertkin WDFDEVICE Device,
243140462c92SVictor Perevertkin _In_
243240462c92SVictor Perevertkin WDFSTRING String
243340462c92SVictor Perevertkin );
243440462c92SVictor Perevertkin
243540462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(PASSIVE_LEVEL)243640462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
243740462c92SVictor Perevertkin FORCEINLINE
2438*545df815SVictor Perevertkin NTSTATUS
243940462c92SVictor Perevertkin WdfDeviceRetrieveDeviceName(
244040462c92SVictor Perevertkin _In_
244140462c92SVictor Perevertkin WDFDEVICE Device,
244240462c92SVictor Perevertkin _In_
244340462c92SVictor Perevertkin WDFSTRING String
244440462c92SVictor Perevertkin )
244540462c92SVictor Perevertkin {
244640462c92SVictor Perevertkin return ((PFN_WDFDEVICERETRIEVEDEVICENAME) WdfFunctions[WdfDeviceRetrieveDeviceNameTableIndex])(WdfDriverGlobals, Device, String);
244740462c92SVictor Perevertkin }
244840462c92SVictor Perevertkin
244940462c92SVictor Perevertkin //
245040462c92SVictor Perevertkin // WDF Function: WdfDeviceAssignMofResourceName
245140462c92SVictor Perevertkin //
245240462c92SVictor Perevertkin typedef
245340462c92SVictor Perevertkin _Must_inspect_result_
245440462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
245540462c92SVictor Perevertkin WDFAPI
245640462c92SVictor Perevertkin NTSTATUS
2457*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEASSIGNMOFRESOURCENAME)(
245840462c92SVictor Perevertkin _In_
245940462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
246040462c92SVictor Perevertkin _In_
246140462c92SVictor Perevertkin WDFDEVICE Device,
246240462c92SVictor Perevertkin _In_
246340462c92SVictor Perevertkin PCUNICODE_STRING MofResourceName
246440462c92SVictor Perevertkin );
246540462c92SVictor Perevertkin
246640462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(PASSIVE_LEVEL)246740462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
246840462c92SVictor Perevertkin FORCEINLINE
2469*545df815SVictor Perevertkin NTSTATUS
247040462c92SVictor Perevertkin WdfDeviceAssignMofResourceName(
247140462c92SVictor Perevertkin _In_
247240462c92SVictor Perevertkin WDFDEVICE Device,
247340462c92SVictor Perevertkin _In_
247440462c92SVictor Perevertkin PCUNICODE_STRING MofResourceName
247540462c92SVictor Perevertkin )
247640462c92SVictor Perevertkin {
247740462c92SVictor Perevertkin return ((PFN_WDFDEVICEASSIGNMOFRESOURCENAME) WdfFunctions[WdfDeviceAssignMofResourceNameTableIndex])(WdfDriverGlobals, Device, MofResourceName);
247840462c92SVictor Perevertkin }
247940462c92SVictor Perevertkin
248040462c92SVictor Perevertkin //
248140462c92SVictor Perevertkin // WDF Function: WdfDeviceGetIoTarget
248240462c92SVictor Perevertkin //
248340462c92SVictor Perevertkin typedef
248440462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
248540462c92SVictor Perevertkin WDFAPI
248640462c92SVictor Perevertkin WDFIOTARGET
2487*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEGETIOTARGET)(
248840462c92SVictor Perevertkin _In_
248940462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
249040462c92SVictor Perevertkin _In_
249140462c92SVictor Perevertkin WDFDEVICE Device
249240462c92SVictor Perevertkin );
249340462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)249440462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
249540462c92SVictor Perevertkin FORCEINLINE
2496*545df815SVictor Perevertkin WDFIOTARGET
249740462c92SVictor Perevertkin WdfDeviceGetIoTarget(
249840462c92SVictor Perevertkin _In_
249940462c92SVictor Perevertkin WDFDEVICE Device
250040462c92SVictor Perevertkin )
250140462c92SVictor Perevertkin {
250240462c92SVictor Perevertkin return ((PFN_WDFDEVICEGETIOTARGET) WdfFunctions[WdfDeviceGetIoTargetTableIndex])(WdfDriverGlobals, Device);
250340462c92SVictor Perevertkin }
250440462c92SVictor Perevertkin
250540462c92SVictor Perevertkin //
250640462c92SVictor Perevertkin // WDF Function: WdfDeviceGetDevicePnpState
250740462c92SVictor Perevertkin //
250840462c92SVictor Perevertkin typedef
250940462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
251040462c92SVictor Perevertkin WDFAPI
251140462c92SVictor Perevertkin WDF_DEVICE_PNP_STATE
2512*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEGETDEVICEPNPSTATE)(
251340462c92SVictor Perevertkin _In_
251440462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
251540462c92SVictor Perevertkin _In_
251640462c92SVictor Perevertkin WDFDEVICE Device
251740462c92SVictor Perevertkin );
251840462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)251940462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
252040462c92SVictor Perevertkin FORCEINLINE
2521*545df815SVictor Perevertkin WDF_DEVICE_PNP_STATE
252240462c92SVictor Perevertkin WdfDeviceGetDevicePnpState(
252340462c92SVictor Perevertkin _In_
252440462c92SVictor Perevertkin WDFDEVICE Device
252540462c92SVictor Perevertkin )
252640462c92SVictor Perevertkin {
252740462c92SVictor Perevertkin return ((PFN_WDFDEVICEGETDEVICEPNPSTATE) WdfFunctions[WdfDeviceGetDevicePnpStateTableIndex])(WdfDriverGlobals, Device);
252840462c92SVictor Perevertkin }
252940462c92SVictor Perevertkin
253040462c92SVictor Perevertkin //
253140462c92SVictor Perevertkin // WDF Function: WdfDeviceGetDevicePowerState
253240462c92SVictor Perevertkin //
253340462c92SVictor Perevertkin typedef
253440462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
253540462c92SVictor Perevertkin WDFAPI
253640462c92SVictor Perevertkin WDF_DEVICE_POWER_STATE
2537*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEGETDEVICEPOWERSTATE)(
253840462c92SVictor Perevertkin _In_
253940462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
254040462c92SVictor Perevertkin _In_
254140462c92SVictor Perevertkin WDFDEVICE Device
254240462c92SVictor Perevertkin );
254340462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)254440462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
254540462c92SVictor Perevertkin FORCEINLINE
2546*545df815SVictor Perevertkin WDF_DEVICE_POWER_STATE
254740462c92SVictor Perevertkin WdfDeviceGetDevicePowerState(
254840462c92SVictor Perevertkin _In_
254940462c92SVictor Perevertkin WDFDEVICE Device
255040462c92SVictor Perevertkin )
255140462c92SVictor Perevertkin {
255240462c92SVictor Perevertkin return ((PFN_WDFDEVICEGETDEVICEPOWERSTATE) WdfFunctions[WdfDeviceGetDevicePowerStateTableIndex])(WdfDriverGlobals, Device);
255340462c92SVictor Perevertkin }
255440462c92SVictor Perevertkin
255540462c92SVictor Perevertkin //
255640462c92SVictor Perevertkin // WDF Function: WdfDeviceGetDevicePowerPolicyState
255740462c92SVictor Perevertkin //
255840462c92SVictor Perevertkin typedef
255940462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
256040462c92SVictor Perevertkin WDFAPI
256140462c92SVictor Perevertkin WDF_DEVICE_POWER_POLICY_STATE
2562*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEGETDEVICEPOWERPOLICYSTATE)(
256340462c92SVictor Perevertkin _In_
256440462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
256540462c92SVictor Perevertkin _In_
256640462c92SVictor Perevertkin WDFDEVICE Device
256740462c92SVictor Perevertkin );
256840462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)256940462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
257040462c92SVictor Perevertkin FORCEINLINE
2571*545df815SVictor Perevertkin WDF_DEVICE_POWER_POLICY_STATE
257240462c92SVictor Perevertkin WdfDeviceGetDevicePowerPolicyState(
257340462c92SVictor Perevertkin _In_
257440462c92SVictor Perevertkin WDFDEVICE Device
257540462c92SVictor Perevertkin )
257640462c92SVictor Perevertkin {
257740462c92SVictor Perevertkin return ((PFN_WDFDEVICEGETDEVICEPOWERPOLICYSTATE) WdfFunctions[WdfDeviceGetDevicePowerPolicyStateTableIndex])(WdfDriverGlobals, Device);
257840462c92SVictor Perevertkin }
257940462c92SVictor Perevertkin
258040462c92SVictor Perevertkin //
258140462c92SVictor Perevertkin // WDF Function: WdfDeviceAssignS0IdleSettings
258240462c92SVictor Perevertkin //
258340462c92SVictor Perevertkin typedef
258440462c92SVictor Perevertkin _Must_inspect_result_
258540462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
258640462c92SVictor Perevertkin WDFAPI
258740462c92SVictor Perevertkin NTSTATUS
2588*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEASSIGNS0IDLESETTINGS)(
258940462c92SVictor Perevertkin _In_
259040462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
259140462c92SVictor Perevertkin _In_
259240462c92SVictor Perevertkin WDFDEVICE Device,
259340462c92SVictor Perevertkin _In_
259440462c92SVictor Perevertkin PWDF_DEVICE_POWER_POLICY_IDLE_SETTINGS Settings
259540462c92SVictor Perevertkin );
259640462c92SVictor Perevertkin
259740462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(DISPATCH_LEVEL)259840462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
259940462c92SVictor Perevertkin FORCEINLINE
2600*545df815SVictor Perevertkin NTSTATUS
260140462c92SVictor Perevertkin WdfDeviceAssignS0IdleSettings(
260240462c92SVictor Perevertkin _In_
260340462c92SVictor Perevertkin WDFDEVICE Device,
260440462c92SVictor Perevertkin _In_
260540462c92SVictor Perevertkin PWDF_DEVICE_POWER_POLICY_IDLE_SETTINGS Settings
260640462c92SVictor Perevertkin )
260740462c92SVictor Perevertkin {
260840462c92SVictor Perevertkin return ((PFN_WDFDEVICEASSIGNS0IDLESETTINGS) WdfFunctions[WdfDeviceAssignS0IdleSettingsTableIndex])(WdfDriverGlobals, Device, Settings);
260940462c92SVictor Perevertkin }
261040462c92SVictor Perevertkin
261140462c92SVictor Perevertkin //
261240462c92SVictor Perevertkin // WDF Function: WdfDeviceAssignSxWakeSettings
261340462c92SVictor Perevertkin //
261440462c92SVictor Perevertkin typedef
261540462c92SVictor Perevertkin _Must_inspect_result_
261640462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
261740462c92SVictor Perevertkin WDFAPI
261840462c92SVictor Perevertkin NTSTATUS
2619*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEASSIGNSXWAKESETTINGS)(
262040462c92SVictor Perevertkin _In_
262140462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
262240462c92SVictor Perevertkin _In_
262340462c92SVictor Perevertkin WDFDEVICE Device,
262440462c92SVictor Perevertkin _In_
262540462c92SVictor Perevertkin PWDF_DEVICE_POWER_POLICY_WAKE_SETTINGS Settings
262640462c92SVictor Perevertkin );
262740462c92SVictor Perevertkin
262840462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(DISPATCH_LEVEL)262940462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
263040462c92SVictor Perevertkin FORCEINLINE
2631*545df815SVictor Perevertkin NTSTATUS
263240462c92SVictor Perevertkin WdfDeviceAssignSxWakeSettings(
263340462c92SVictor Perevertkin _In_
263440462c92SVictor Perevertkin WDFDEVICE Device,
263540462c92SVictor Perevertkin _In_
263640462c92SVictor Perevertkin PWDF_DEVICE_POWER_POLICY_WAKE_SETTINGS Settings
263740462c92SVictor Perevertkin )
263840462c92SVictor Perevertkin {
263940462c92SVictor Perevertkin return ((PFN_WDFDEVICEASSIGNSXWAKESETTINGS) WdfFunctions[WdfDeviceAssignSxWakeSettingsTableIndex])(WdfDriverGlobals, Device, Settings);
264040462c92SVictor Perevertkin }
264140462c92SVictor Perevertkin
264240462c92SVictor Perevertkin //
264340462c92SVictor Perevertkin // WDF Function: WdfDeviceOpenRegistryKey
264440462c92SVictor Perevertkin //
264540462c92SVictor Perevertkin typedef
264640462c92SVictor Perevertkin _Must_inspect_result_
264740462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
264840462c92SVictor Perevertkin WDFAPI
264940462c92SVictor Perevertkin NTSTATUS
2650*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEOPENREGISTRYKEY)(
265140462c92SVictor Perevertkin _In_
265240462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
265340462c92SVictor Perevertkin _In_
265440462c92SVictor Perevertkin WDFDEVICE Device,
265540462c92SVictor Perevertkin _In_
265640462c92SVictor Perevertkin ULONG DeviceInstanceKeyType,
265740462c92SVictor Perevertkin _In_
265840462c92SVictor Perevertkin ACCESS_MASK DesiredAccess,
265940462c92SVictor Perevertkin _In_opt_
266040462c92SVictor Perevertkin PWDF_OBJECT_ATTRIBUTES KeyAttributes,
266140462c92SVictor Perevertkin _Out_
266240462c92SVictor Perevertkin WDFKEY* Key
266340462c92SVictor Perevertkin );
266440462c92SVictor Perevertkin
266540462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(PASSIVE_LEVEL)266640462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
266740462c92SVictor Perevertkin FORCEINLINE
2668*545df815SVictor Perevertkin NTSTATUS
266940462c92SVictor Perevertkin WdfDeviceOpenRegistryKey(
267040462c92SVictor Perevertkin _In_
267140462c92SVictor Perevertkin WDFDEVICE Device,
267240462c92SVictor Perevertkin _In_
267340462c92SVictor Perevertkin ULONG DeviceInstanceKeyType,
267440462c92SVictor Perevertkin _In_
267540462c92SVictor Perevertkin ACCESS_MASK DesiredAccess,
267640462c92SVictor Perevertkin _In_opt_
267740462c92SVictor Perevertkin PWDF_OBJECT_ATTRIBUTES KeyAttributes,
267840462c92SVictor Perevertkin _Out_
267940462c92SVictor Perevertkin WDFKEY* Key
268040462c92SVictor Perevertkin )
268140462c92SVictor Perevertkin {
268240462c92SVictor Perevertkin return ((PFN_WDFDEVICEOPENREGISTRYKEY) WdfFunctions[WdfDeviceOpenRegistryKeyTableIndex])(WdfDriverGlobals, Device, DeviceInstanceKeyType, DesiredAccess, KeyAttributes, Key);
268340462c92SVictor Perevertkin }
268440462c92SVictor Perevertkin
268540462c92SVictor Perevertkin //
268640462c92SVictor Perevertkin // WDF Function: WdfDeviceOpenDevicemapKey
268740462c92SVictor Perevertkin //
268840462c92SVictor Perevertkin typedef
268940462c92SVictor Perevertkin _Must_inspect_result_
269040462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
269140462c92SVictor Perevertkin WDFAPI
269240462c92SVictor Perevertkin NTSTATUS
2693*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEOPENDEVICEMAPKEY)(
269440462c92SVictor Perevertkin _In_
269540462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
269640462c92SVictor Perevertkin _In_
269740462c92SVictor Perevertkin WDFDEVICE Device,
269840462c92SVictor Perevertkin _In_
269940462c92SVictor Perevertkin PCUNICODE_STRING KeyName,
270040462c92SVictor Perevertkin _In_
270140462c92SVictor Perevertkin ACCESS_MASK DesiredAccess,
270240462c92SVictor Perevertkin _In_opt_
270340462c92SVictor Perevertkin PWDF_OBJECT_ATTRIBUTES KeyAttributes,
270440462c92SVictor Perevertkin _Out_
270540462c92SVictor Perevertkin WDFKEY* Key
270640462c92SVictor Perevertkin );
270740462c92SVictor Perevertkin
270840462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(PASSIVE_LEVEL)270940462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
271040462c92SVictor Perevertkin FORCEINLINE
2711*545df815SVictor Perevertkin NTSTATUS
271240462c92SVictor Perevertkin WdfDeviceOpenDevicemapKey(
271340462c92SVictor Perevertkin _In_
271440462c92SVictor Perevertkin WDFDEVICE Device,
271540462c92SVictor Perevertkin _In_
271640462c92SVictor Perevertkin PCUNICODE_STRING KeyName,
271740462c92SVictor Perevertkin _In_
271840462c92SVictor Perevertkin ACCESS_MASK DesiredAccess,
271940462c92SVictor Perevertkin _In_opt_
272040462c92SVictor Perevertkin PWDF_OBJECT_ATTRIBUTES KeyAttributes,
272140462c92SVictor Perevertkin _Out_
272240462c92SVictor Perevertkin WDFKEY* Key
272340462c92SVictor Perevertkin )
272440462c92SVictor Perevertkin {
272540462c92SVictor Perevertkin return ((PFN_WDFDEVICEOPENDEVICEMAPKEY) WdfFunctions[WdfDeviceOpenDevicemapKeyTableIndex])(WdfDriverGlobals, Device, KeyName, DesiredAccess, KeyAttributes, Key);
272640462c92SVictor Perevertkin }
272740462c92SVictor Perevertkin
272840462c92SVictor Perevertkin //
272940462c92SVictor Perevertkin // WDF Function: WdfDeviceSetSpecialFileSupport
273040462c92SVictor Perevertkin //
273140462c92SVictor Perevertkin typedef
273240462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
273340462c92SVictor Perevertkin WDFAPI
273440462c92SVictor Perevertkin VOID
2735*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICESETSPECIALFILESUPPORT)(
273640462c92SVictor Perevertkin _In_
273740462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
273840462c92SVictor Perevertkin _In_
273940462c92SVictor Perevertkin WDFDEVICE Device,
274040462c92SVictor Perevertkin _In_
274140462c92SVictor Perevertkin WDF_SPECIAL_FILE_TYPE FileType,
274240462c92SVictor Perevertkin _In_
274340462c92SVictor Perevertkin BOOLEAN FileTypeIsSupported
274440462c92SVictor Perevertkin );
274540462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)274640462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
274740462c92SVictor Perevertkin FORCEINLINE
2748*545df815SVictor Perevertkin VOID
274940462c92SVictor Perevertkin WdfDeviceSetSpecialFileSupport(
275040462c92SVictor Perevertkin _In_
275140462c92SVictor Perevertkin WDFDEVICE Device,
275240462c92SVictor Perevertkin _In_
275340462c92SVictor Perevertkin WDF_SPECIAL_FILE_TYPE FileType,
275440462c92SVictor Perevertkin _In_
275540462c92SVictor Perevertkin BOOLEAN FileTypeIsSupported
275640462c92SVictor Perevertkin )
275740462c92SVictor Perevertkin {
275840462c92SVictor Perevertkin ((PFN_WDFDEVICESETSPECIALFILESUPPORT) WdfFunctions[WdfDeviceSetSpecialFileSupportTableIndex])(WdfDriverGlobals, Device, FileType, FileTypeIsSupported);
275940462c92SVictor Perevertkin }
276040462c92SVictor Perevertkin
276140462c92SVictor Perevertkin //
276240462c92SVictor Perevertkin // WDF Function: WdfDeviceSetCharacteristics
276340462c92SVictor Perevertkin //
276440462c92SVictor Perevertkin typedef
276540462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
276640462c92SVictor Perevertkin WDFAPI
276740462c92SVictor Perevertkin VOID
2768*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICESETCHARACTERISTICS)(
276940462c92SVictor Perevertkin _In_
277040462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
277140462c92SVictor Perevertkin _In_
277240462c92SVictor Perevertkin WDFDEVICE Device,
277340462c92SVictor Perevertkin _In_
277440462c92SVictor Perevertkin ULONG DeviceCharacteristics
277540462c92SVictor Perevertkin );
277640462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)277740462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
277840462c92SVictor Perevertkin FORCEINLINE
2779*545df815SVictor Perevertkin VOID
278040462c92SVictor Perevertkin WdfDeviceSetCharacteristics(
278140462c92SVictor Perevertkin _In_
278240462c92SVictor Perevertkin WDFDEVICE Device,
278340462c92SVictor Perevertkin _In_
278440462c92SVictor Perevertkin ULONG DeviceCharacteristics
278540462c92SVictor Perevertkin )
278640462c92SVictor Perevertkin {
278740462c92SVictor Perevertkin ((PFN_WDFDEVICESETCHARACTERISTICS) WdfFunctions[WdfDeviceSetCharacteristicsTableIndex])(WdfDriverGlobals, Device, DeviceCharacteristics);
278840462c92SVictor Perevertkin }
278940462c92SVictor Perevertkin
279040462c92SVictor Perevertkin //
279140462c92SVictor Perevertkin // WDF Function: WdfDeviceGetCharacteristics
279240462c92SVictor Perevertkin //
279340462c92SVictor Perevertkin typedef
279440462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
279540462c92SVictor Perevertkin WDFAPI
279640462c92SVictor Perevertkin ULONG
2797*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEGETCHARACTERISTICS)(
279840462c92SVictor Perevertkin _In_
279940462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
280040462c92SVictor Perevertkin _In_
280140462c92SVictor Perevertkin WDFDEVICE Device
280240462c92SVictor Perevertkin );
280340462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)280440462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
280540462c92SVictor Perevertkin FORCEINLINE
2806*545df815SVictor Perevertkin ULONG
280740462c92SVictor Perevertkin WdfDeviceGetCharacteristics(
280840462c92SVictor Perevertkin _In_
280940462c92SVictor Perevertkin WDFDEVICE Device
281040462c92SVictor Perevertkin )
281140462c92SVictor Perevertkin {
281240462c92SVictor Perevertkin return ((PFN_WDFDEVICEGETCHARACTERISTICS) WdfFunctions[WdfDeviceGetCharacteristicsTableIndex])(WdfDriverGlobals, Device);
281340462c92SVictor Perevertkin }
281440462c92SVictor Perevertkin
281540462c92SVictor Perevertkin //
281640462c92SVictor Perevertkin // WDF Function: WdfDeviceGetAlignmentRequirement
281740462c92SVictor Perevertkin //
281840462c92SVictor Perevertkin typedef
281940462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
282040462c92SVictor Perevertkin WDFAPI
282140462c92SVictor Perevertkin ULONG
2822*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEGETALIGNMENTREQUIREMENT)(
282340462c92SVictor Perevertkin _In_
282440462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
282540462c92SVictor Perevertkin _In_
282640462c92SVictor Perevertkin WDFDEVICE Device
282740462c92SVictor Perevertkin );
282840462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)282940462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
283040462c92SVictor Perevertkin FORCEINLINE
2831*545df815SVictor Perevertkin ULONG
283240462c92SVictor Perevertkin WdfDeviceGetAlignmentRequirement(
283340462c92SVictor Perevertkin _In_
283440462c92SVictor Perevertkin WDFDEVICE Device
283540462c92SVictor Perevertkin )
283640462c92SVictor Perevertkin {
283740462c92SVictor Perevertkin return ((PFN_WDFDEVICEGETALIGNMENTREQUIREMENT) WdfFunctions[WdfDeviceGetAlignmentRequirementTableIndex])(WdfDriverGlobals, Device);
283840462c92SVictor Perevertkin }
283940462c92SVictor Perevertkin
284040462c92SVictor Perevertkin //
284140462c92SVictor Perevertkin // WDF Function: WdfDeviceSetAlignmentRequirement
284240462c92SVictor Perevertkin //
284340462c92SVictor Perevertkin typedef
284440462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
284540462c92SVictor Perevertkin WDFAPI
284640462c92SVictor Perevertkin VOID
2847*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICESETALIGNMENTREQUIREMENT)(
284840462c92SVictor Perevertkin _In_
284940462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
285040462c92SVictor Perevertkin _In_
285140462c92SVictor Perevertkin WDFDEVICE Device,
285240462c92SVictor Perevertkin _In_
285340462c92SVictor Perevertkin ULONG AlignmentRequirement
285440462c92SVictor Perevertkin );
285540462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)285640462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
285740462c92SVictor Perevertkin FORCEINLINE
2858*545df815SVictor Perevertkin VOID
285940462c92SVictor Perevertkin WdfDeviceSetAlignmentRequirement(
286040462c92SVictor Perevertkin _In_
286140462c92SVictor Perevertkin WDFDEVICE Device,
286240462c92SVictor Perevertkin _In_
286340462c92SVictor Perevertkin ULONG AlignmentRequirement
286440462c92SVictor Perevertkin )
286540462c92SVictor Perevertkin {
286640462c92SVictor Perevertkin ((PFN_WDFDEVICESETALIGNMENTREQUIREMENT) WdfFunctions[WdfDeviceSetAlignmentRequirementTableIndex])(WdfDriverGlobals, Device, AlignmentRequirement);
286740462c92SVictor Perevertkin }
286840462c92SVictor Perevertkin
286940462c92SVictor Perevertkin //
287040462c92SVictor Perevertkin // WDF Function: WdfDeviceInitFree
287140462c92SVictor Perevertkin //
287240462c92SVictor Perevertkin typedef
287340462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
287440462c92SVictor Perevertkin WDFAPI
287540462c92SVictor Perevertkin VOID
2876*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEINITFREE)(
287740462c92SVictor Perevertkin _In_
287840462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
287940462c92SVictor Perevertkin _In_
288040462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit
288140462c92SVictor Perevertkin );
288240462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)288340462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
288440462c92SVictor Perevertkin FORCEINLINE
2885*545df815SVictor Perevertkin VOID
288640462c92SVictor Perevertkin WdfDeviceInitFree(
288740462c92SVictor Perevertkin _In_
288840462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit
288940462c92SVictor Perevertkin )
289040462c92SVictor Perevertkin {
289140462c92SVictor Perevertkin ((PFN_WDFDEVICEINITFREE) WdfFunctions[WdfDeviceInitFreeTableIndex])(WdfDriverGlobals, DeviceInit);
289240462c92SVictor Perevertkin }
289340462c92SVictor Perevertkin
289440462c92SVictor Perevertkin //
289540462c92SVictor Perevertkin // WDF Function: WdfDeviceInitSetPnpPowerEventCallbacks
289640462c92SVictor Perevertkin //
289740462c92SVictor Perevertkin typedef
289840462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
289940462c92SVictor Perevertkin WDFAPI
290040462c92SVictor Perevertkin VOID
2901*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEINITSETPNPPOWEREVENTCALLBACKS)(
290240462c92SVictor Perevertkin _In_
290340462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
290440462c92SVictor Perevertkin _In_
290540462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
290640462c92SVictor Perevertkin _In_
290740462c92SVictor Perevertkin PWDF_PNPPOWER_EVENT_CALLBACKS PnpPowerEventCallbacks
290840462c92SVictor Perevertkin );
290940462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)291040462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
291140462c92SVictor Perevertkin FORCEINLINE
2912*545df815SVictor Perevertkin VOID
291340462c92SVictor Perevertkin WdfDeviceInitSetPnpPowerEventCallbacks(
291440462c92SVictor Perevertkin _In_
291540462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
291640462c92SVictor Perevertkin _In_
291740462c92SVictor Perevertkin PWDF_PNPPOWER_EVENT_CALLBACKS PnpPowerEventCallbacks
291840462c92SVictor Perevertkin )
291940462c92SVictor Perevertkin {
292040462c92SVictor Perevertkin ((PFN_WDFDEVICEINITSETPNPPOWEREVENTCALLBACKS) WdfFunctions[WdfDeviceInitSetPnpPowerEventCallbacksTableIndex])(WdfDriverGlobals, DeviceInit, PnpPowerEventCallbacks);
292140462c92SVictor Perevertkin }
292240462c92SVictor Perevertkin
292340462c92SVictor Perevertkin //
292440462c92SVictor Perevertkin // WDF Function: WdfDeviceInitSetPowerPolicyEventCallbacks
292540462c92SVictor Perevertkin //
292640462c92SVictor Perevertkin typedef
292740462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
292840462c92SVictor Perevertkin WDFAPI
292940462c92SVictor Perevertkin VOID
2930*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEINITSETPOWERPOLICYEVENTCALLBACKS)(
293140462c92SVictor Perevertkin _In_
293240462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
293340462c92SVictor Perevertkin _In_
293440462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
293540462c92SVictor Perevertkin _In_
293640462c92SVictor Perevertkin PWDF_POWER_POLICY_EVENT_CALLBACKS PowerPolicyEventCallbacks
293740462c92SVictor Perevertkin );
293840462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)293940462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
294040462c92SVictor Perevertkin FORCEINLINE
2941*545df815SVictor Perevertkin VOID
294240462c92SVictor Perevertkin WdfDeviceInitSetPowerPolicyEventCallbacks(
294340462c92SVictor Perevertkin _In_
294440462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
294540462c92SVictor Perevertkin _In_
294640462c92SVictor Perevertkin PWDF_POWER_POLICY_EVENT_CALLBACKS PowerPolicyEventCallbacks
294740462c92SVictor Perevertkin )
294840462c92SVictor Perevertkin {
294940462c92SVictor Perevertkin ((PFN_WDFDEVICEINITSETPOWERPOLICYEVENTCALLBACKS) WdfFunctions[WdfDeviceInitSetPowerPolicyEventCallbacksTableIndex])(WdfDriverGlobals, DeviceInit, PowerPolicyEventCallbacks);
295040462c92SVictor Perevertkin }
295140462c92SVictor Perevertkin
295240462c92SVictor Perevertkin //
295340462c92SVictor Perevertkin // WDF Function: WdfDeviceInitSetPowerPolicyOwnership
295440462c92SVictor Perevertkin //
295540462c92SVictor Perevertkin typedef
295640462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
295740462c92SVictor Perevertkin WDFAPI
295840462c92SVictor Perevertkin VOID
2959*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEINITSETPOWERPOLICYOWNERSHIP)(
296040462c92SVictor Perevertkin _In_
296140462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
296240462c92SVictor Perevertkin _In_
296340462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
296440462c92SVictor Perevertkin _In_
296540462c92SVictor Perevertkin BOOLEAN IsPowerPolicyOwner
296640462c92SVictor Perevertkin );
296740462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)296840462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
296940462c92SVictor Perevertkin FORCEINLINE
2970*545df815SVictor Perevertkin VOID
297140462c92SVictor Perevertkin WdfDeviceInitSetPowerPolicyOwnership(
297240462c92SVictor Perevertkin _In_
297340462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
297440462c92SVictor Perevertkin _In_
297540462c92SVictor Perevertkin BOOLEAN IsPowerPolicyOwner
297640462c92SVictor Perevertkin )
297740462c92SVictor Perevertkin {
297840462c92SVictor Perevertkin ((PFN_WDFDEVICEINITSETPOWERPOLICYOWNERSHIP) WdfFunctions[WdfDeviceInitSetPowerPolicyOwnershipTableIndex])(WdfDriverGlobals, DeviceInit, IsPowerPolicyOwner);
297940462c92SVictor Perevertkin }
298040462c92SVictor Perevertkin
298140462c92SVictor Perevertkin //
298240462c92SVictor Perevertkin // WDF Function: WdfDeviceInitRegisterPnpStateChangeCallback
298340462c92SVictor Perevertkin //
298440462c92SVictor Perevertkin typedef
298540462c92SVictor Perevertkin _Must_inspect_result_
298640462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
298740462c92SVictor Perevertkin WDFAPI
298840462c92SVictor Perevertkin NTSTATUS
2989*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEINITREGISTERPNPSTATECHANGECALLBACK)(
299040462c92SVictor Perevertkin _In_
299140462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
299240462c92SVictor Perevertkin _In_
299340462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
299440462c92SVictor Perevertkin _In_
299540462c92SVictor Perevertkin WDF_DEVICE_PNP_STATE PnpState,
299640462c92SVictor Perevertkin _In_
299740462c92SVictor Perevertkin PFN_WDF_DEVICE_PNP_STATE_CHANGE_NOTIFICATION EvtDevicePnpStateChange,
299840462c92SVictor Perevertkin _In_
299940462c92SVictor Perevertkin ULONG CallbackTypes
300040462c92SVictor Perevertkin );
300140462c92SVictor Perevertkin
300240462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(PASSIVE_LEVEL)300340462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
300440462c92SVictor Perevertkin FORCEINLINE
3005*545df815SVictor Perevertkin NTSTATUS
300640462c92SVictor Perevertkin WdfDeviceInitRegisterPnpStateChangeCallback(
300740462c92SVictor Perevertkin _In_
300840462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
300940462c92SVictor Perevertkin _In_
301040462c92SVictor Perevertkin WDF_DEVICE_PNP_STATE PnpState,
301140462c92SVictor Perevertkin _In_
301240462c92SVictor Perevertkin PFN_WDF_DEVICE_PNP_STATE_CHANGE_NOTIFICATION EvtDevicePnpStateChange,
301340462c92SVictor Perevertkin _In_
301440462c92SVictor Perevertkin ULONG CallbackTypes
301540462c92SVictor Perevertkin )
301640462c92SVictor Perevertkin {
301740462c92SVictor Perevertkin return ((PFN_WDFDEVICEINITREGISTERPNPSTATECHANGECALLBACK) WdfFunctions[WdfDeviceInitRegisterPnpStateChangeCallbackTableIndex])(WdfDriverGlobals, DeviceInit, PnpState, EvtDevicePnpStateChange, CallbackTypes);
301840462c92SVictor Perevertkin }
301940462c92SVictor Perevertkin
302040462c92SVictor Perevertkin //
302140462c92SVictor Perevertkin // WDF Function: WdfDeviceInitRegisterPowerStateChangeCallback
302240462c92SVictor Perevertkin //
302340462c92SVictor Perevertkin typedef
302440462c92SVictor Perevertkin _Must_inspect_result_
302540462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
302640462c92SVictor Perevertkin WDFAPI
302740462c92SVictor Perevertkin NTSTATUS
3028*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEINITREGISTERPOWERSTATECHANGECALLBACK)(
302940462c92SVictor Perevertkin _In_
303040462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
303140462c92SVictor Perevertkin _In_
303240462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
303340462c92SVictor Perevertkin _In_
303440462c92SVictor Perevertkin WDF_DEVICE_POWER_STATE PowerState,
303540462c92SVictor Perevertkin _In_
303640462c92SVictor Perevertkin PFN_WDF_DEVICE_POWER_STATE_CHANGE_NOTIFICATION EvtDevicePowerStateChange,
303740462c92SVictor Perevertkin _In_
303840462c92SVictor Perevertkin ULONG CallbackTypes
303940462c92SVictor Perevertkin );
304040462c92SVictor Perevertkin
304140462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(PASSIVE_LEVEL)304240462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
304340462c92SVictor Perevertkin FORCEINLINE
3044*545df815SVictor Perevertkin NTSTATUS
304540462c92SVictor Perevertkin WdfDeviceInitRegisterPowerStateChangeCallback(
304640462c92SVictor Perevertkin _In_
304740462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
304840462c92SVictor Perevertkin _In_
304940462c92SVictor Perevertkin WDF_DEVICE_POWER_STATE PowerState,
305040462c92SVictor Perevertkin _In_
305140462c92SVictor Perevertkin PFN_WDF_DEVICE_POWER_STATE_CHANGE_NOTIFICATION EvtDevicePowerStateChange,
305240462c92SVictor Perevertkin _In_
305340462c92SVictor Perevertkin ULONG CallbackTypes
305440462c92SVictor Perevertkin )
305540462c92SVictor Perevertkin {
305640462c92SVictor Perevertkin return ((PFN_WDFDEVICEINITREGISTERPOWERSTATECHANGECALLBACK) WdfFunctions[WdfDeviceInitRegisterPowerStateChangeCallbackTableIndex])(WdfDriverGlobals, DeviceInit, PowerState, EvtDevicePowerStateChange, CallbackTypes);
305740462c92SVictor Perevertkin }
305840462c92SVictor Perevertkin
305940462c92SVictor Perevertkin //
306040462c92SVictor Perevertkin // WDF Function: WdfDeviceInitRegisterPowerPolicyStateChangeCallback
306140462c92SVictor Perevertkin //
306240462c92SVictor Perevertkin typedef
306340462c92SVictor Perevertkin _Must_inspect_result_
306440462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
306540462c92SVictor Perevertkin WDFAPI
306640462c92SVictor Perevertkin NTSTATUS
3067*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEINITREGISTERPOWERPOLICYSTATECHANGECALLBACK)(
306840462c92SVictor Perevertkin _In_
306940462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
307040462c92SVictor Perevertkin _In_
307140462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
307240462c92SVictor Perevertkin _In_
307340462c92SVictor Perevertkin WDF_DEVICE_POWER_POLICY_STATE PowerPolicyState,
307440462c92SVictor Perevertkin _In_
307540462c92SVictor Perevertkin PFN_WDF_DEVICE_POWER_POLICY_STATE_CHANGE_NOTIFICATION EvtDevicePowerPolicyStateChange,
307640462c92SVictor Perevertkin _In_
307740462c92SVictor Perevertkin ULONG CallbackTypes
307840462c92SVictor Perevertkin );
307940462c92SVictor Perevertkin
308040462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(PASSIVE_LEVEL)308140462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
308240462c92SVictor Perevertkin FORCEINLINE
3083*545df815SVictor Perevertkin NTSTATUS
308440462c92SVictor Perevertkin WdfDeviceInitRegisterPowerPolicyStateChangeCallback(
308540462c92SVictor Perevertkin _In_
308640462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
308740462c92SVictor Perevertkin _In_
308840462c92SVictor Perevertkin WDF_DEVICE_POWER_POLICY_STATE PowerPolicyState,
308940462c92SVictor Perevertkin _In_
309040462c92SVictor Perevertkin PFN_WDF_DEVICE_POWER_POLICY_STATE_CHANGE_NOTIFICATION EvtDevicePowerPolicyStateChange,
309140462c92SVictor Perevertkin _In_
309240462c92SVictor Perevertkin ULONG CallbackTypes
309340462c92SVictor Perevertkin )
309440462c92SVictor Perevertkin {
309540462c92SVictor Perevertkin return ((PFN_WDFDEVICEINITREGISTERPOWERPOLICYSTATECHANGECALLBACK) WdfFunctions[WdfDeviceInitRegisterPowerPolicyStateChangeCallbackTableIndex])(WdfDriverGlobals, DeviceInit, PowerPolicyState, EvtDevicePowerPolicyStateChange, CallbackTypes);
309640462c92SVictor Perevertkin }
309740462c92SVictor Perevertkin
309840462c92SVictor Perevertkin //
309940462c92SVictor Perevertkin // WDF Function: WdfDeviceInitSetExclusive
310040462c92SVictor Perevertkin //
310140462c92SVictor Perevertkin typedef
310240462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
310340462c92SVictor Perevertkin WDFAPI
310440462c92SVictor Perevertkin VOID
3105*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEINITSETEXCLUSIVE)(
310640462c92SVictor Perevertkin _In_
310740462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
310840462c92SVictor Perevertkin _In_
310940462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
311040462c92SVictor Perevertkin _In_
311140462c92SVictor Perevertkin BOOLEAN IsExclusive
311240462c92SVictor Perevertkin );
311340462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)311440462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
311540462c92SVictor Perevertkin FORCEINLINE
3116*545df815SVictor Perevertkin VOID
311740462c92SVictor Perevertkin WdfDeviceInitSetExclusive(
311840462c92SVictor Perevertkin _In_
311940462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
312040462c92SVictor Perevertkin _In_
312140462c92SVictor Perevertkin BOOLEAN IsExclusive
312240462c92SVictor Perevertkin )
312340462c92SVictor Perevertkin {
312440462c92SVictor Perevertkin ((PFN_WDFDEVICEINITSETEXCLUSIVE) WdfFunctions[WdfDeviceInitSetExclusiveTableIndex])(WdfDriverGlobals, DeviceInit, IsExclusive);
312540462c92SVictor Perevertkin }
312640462c92SVictor Perevertkin
312740462c92SVictor Perevertkin //
312840462c92SVictor Perevertkin // WDF Function: WdfDeviceInitSetIoType
312940462c92SVictor Perevertkin //
313040462c92SVictor Perevertkin typedef
313140462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
313240462c92SVictor Perevertkin WDFAPI
313340462c92SVictor Perevertkin VOID
3134*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEINITSETIOTYPE)(
313540462c92SVictor Perevertkin _In_
313640462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
313740462c92SVictor Perevertkin _In_
313840462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
313940462c92SVictor Perevertkin _In_
314040462c92SVictor Perevertkin WDF_DEVICE_IO_TYPE IoType
314140462c92SVictor Perevertkin );
314240462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)314340462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
314440462c92SVictor Perevertkin FORCEINLINE
3145*545df815SVictor Perevertkin VOID
314640462c92SVictor Perevertkin WdfDeviceInitSetIoType(
314740462c92SVictor Perevertkin _In_
314840462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
314940462c92SVictor Perevertkin _In_
315040462c92SVictor Perevertkin WDF_DEVICE_IO_TYPE IoType
315140462c92SVictor Perevertkin )
315240462c92SVictor Perevertkin {
315340462c92SVictor Perevertkin ((PFN_WDFDEVICEINITSETIOTYPE) WdfFunctions[WdfDeviceInitSetIoTypeTableIndex])(WdfDriverGlobals, DeviceInit, IoType);
315440462c92SVictor Perevertkin }
315540462c92SVictor Perevertkin
315640462c92SVictor Perevertkin //
315740462c92SVictor Perevertkin // WDF Function: WdfDeviceInitSetPowerNotPageable
315840462c92SVictor Perevertkin //
315940462c92SVictor Perevertkin typedef
316040462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
316140462c92SVictor Perevertkin WDFAPI
316240462c92SVictor Perevertkin VOID
3163*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEINITSETPOWERNOTPAGEABLE)(
316440462c92SVictor Perevertkin _In_
316540462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
316640462c92SVictor Perevertkin _In_
316740462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit
316840462c92SVictor Perevertkin );
316940462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)317040462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
317140462c92SVictor Perevertkin FORCEINLINE
3172*545df815SVictor Perevertkin VOID
317340462c92SVictor Perevertkin WdfDeviceInitSetPowerNotPageable(
317440462c92SVictor Perevertkin _In_
317540462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit
317640462c92SVictor Perevertkin )
317740462c92SVictor Perevertkin {
317840462c92SVictor Perevertkin ((PFN_WDFDEVICEINITSETPOWERNOTPAGEABLE) WdfFunctions[WdfDeviceInitSetPowerNotPageableTableIndex])(WdfDriverGlobals, DeviceInit);
317940462c92SVictor Perevertkin }
318040462c92SVictor Perevertkin
318140462c92SVictor Perevertkin //
318240462c92SVictor Perevertkin // WDF Function: WdfDeviceInitSetPowerPageable
318340462c92SVictor Perevertkin //
318440462c92SVictor Perevertkin typedef
318540462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
318640462c92SVictor Perevertkin WDFAPI
318740462c92SVictor Perevertkin VOID
3188*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEINITSETPOWERPAGEABLE)(
318940462c92SVictor Perevertkin _In_
319040462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
319140462c92SVictor Perevertkin _In_
319240462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit
319340462c92SVictor Perevertkin );
319440462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)319540462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
319640462c92SVictor Perevertkin FORCEINLINE
3197*545df815SVictor Perevertkin VOID
319840462c92SVictor Perevertkin WdfDeviceInitSetPowerPageable(
319940462c92SVictor Perevertkin _In_
320040462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit
320140462c92SVictor Perevertkin )
320240462c92SVictor Perevertkin {
320340462c92SVictor Perevertkin ((PFN_WDFDEVICEINITSETPOWERPAGEABLE) WdfFunctions[WdfDeviceInitSetPowerPageableTableIndex])(WdfDriverGlobals, DeviceInit);
320440462c92SVictor Perevertkin }
320540462c92SVictor Perevertkin
320640462c92SVictor Perevertkin //
320740462c92SVictor Perevertkin // WDF Function: WdfDeviceInitSetPowerInrush
320840462c92SVictor Perevertkin //
320940462c92SVictor Perevertkin typedef
321040462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
321140462c92SVictor Perevertkin WDFAPI
321240462c92SVictor Perevertkin VOID
3213*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEINITSETPOWERINRUSH)(
321440462c92SVictor Perevertkin _In_
321540462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
321640462c92SVictor Perevertkin _In_
321740462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit
321840462c92SVictor Perevertkin );
321940462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)322040462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
322140462c92SVictor Perevertkin FORCEINLINE
3222*545df815SVictor Perevertkin VOID
322340462c92SVictor Perevertkin WdfDeviceInitSetPowerInrush(
322440462c92SVictor Perevertkin _In_
322540462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit
322640462c92SVictor Perevertkin )
322740462c92SVictor Perevertkin {
322840462c92SVictor Perevertkin ((PFN_WDFDEVICEINITSETPOWERINRUSH) WdfFunctions[WdfDeviceInitSetPowerInrushTableIndex])(WdfDriverGlobals, DeviceInit);
322940462c92SVictor Perevertkin }
323040462c92SVictor Perevertkin
323140462c92SVictor Perevertkin //
323240462c92SVictor Perevertkin // WDF Function: WdfDeviceInitSetDeviceType
323340462c92SVictor Perevertkin //
323440462c92SVictor Perevertkin typedef
323540462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
323640462c92SVictor Perevertkin WDFAPI
323740462c92SVictor Perevertkin VOID
3238*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEINITSETDEVICETYPE)(
323940462c92SVictor Perevertkin _In_
324040462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
324140462c92SVictor Perevertkin _In_
324240462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
324340462c92SVictor Perevertkin _In_
324440462c92SVictor Perevertkin DEVICE_TYPE DeviceType
324540462c92SVictor Perevertkin );
324640462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)324740462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
324840462c92SVictor Perevertkin FORCEINLINE
3249*545df815SVictor Perevertkin VOID
325040462c92SVictor Perevertkin WdfDeviceInitSetDeviceType(
325140462c92SVictor Perevertkin _In_
325240462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
325340462c92SVictor Perevertkin _In_
325440462c92SVictor Perevertkin DEVICE_TYPE DeviceType
325540462c92SVictor Perevertkin )
325640462c92SVictor Perevertkin {
325740462c92SVictor Perevertkin ((PFN_WDFDEVICEINITSETDEVICETYPE) WdfFunctions[WdfDeviceInitSetDeviceTypeTableIndex])(WdfDriverGlobals, DeviceInit, DeviceType);
325840462c92SVictor Perevertkin }
325940462c92SVictor Perevertkin
326040462c92SVictor Perevertkin //
326140462c92SVictor Perevertkin // WDF Function: WdfDeviceInitAssignName
326240462c92SVictor Perevertkin //
326340462c92SVictor Perevertkin typedef
326440462c92SVictor Perevertkin _Must_inspect_result_
326540462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
326640462c92SVictor Perevertkin WDFAPI
326740462c92SVictor Perevertkin NTSTATUS
3268*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEINITASSIGNNAME)(
326940462c92SVictor Perevertkin _In_
327040462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
327140462c92SVictor Perevertkin _In_
327240462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
327340462c92SVictor Perevertkin _In_opt_
327440462c92SVictor Perevertkin PCUNICODE_STRING DeviceName
327540462c92SVictor Perevertkin );
327640462c92SVictor Perevertkin
327740462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(PASSIVE_LEVEL)327840462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
327940462c92SVictor Perevertkin FORCEINLINE
3280*545df815SVictor Perevertkin NTSTATUS
328140462c92SVictor Perevertkin WdfDeviceInitAssignName(
328240462c92SVictor Perevertkin _In_
328340462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
328440462c92SVictor Perevertkin _In_opt_
328540462c92SVictor Perevertkin PCUNICODE_STRING DeviceName
328640462c92SVictor Perevertkin )
328740462c92SVictor Perevertkin {
328840462c92SVictor Perevertkin return ((PFN_WDFDEVICEINITASSIGNNAME) WdfFunctions[WdfDeviceInitAssignNameTableIndex])(WdfDriverGlobals, DeviceInit, DeviceName);
328940462c92SVictor Perevertkin }
329040462c92SVictor Perevertkin
329140462c92SVictor Perevertkin //
329240462c92SVictor Perevertkin // WDF Function: WdfDeviceInitAssignSDDLString
329340462c92SVictor Perevertkin //
329440462c92SVictor Perevertkin typedef
329540462c92SVictor Perevertkin _Must_inspect_result_
329640462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
329740462c92SVictor Perevertkin WDFAPI
329840462c92SVictor Perevertkin NTSTATUS
3299*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEINITASSIGNSDDLSTRING)(
330040462c92SVictor Perevertkin _In_
330140462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
330240462c92SVictor Perevertkin _In_
330340462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
330440462c92SVictor Perevertkin _In_opt_
330540462c92SVictor Perevertkin PCUNICODE_STRING SDDLString
330640462c92SVictor Perevertkin );
330740462c92SVictor Perevertkin
330840462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(PASSIVE_LEVEL)330940462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
331040462c92SVictor Perevertkin FORCEINLINE
3311*545df815SVictor Perevertkin NTSTATUS
331240462c92SVictor Perevertkin WdfDeviceInitAssignSDDLString(
331340462c92SVictor Perevertkin _In_
331440462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
331540462c92SVictor Perevertkin _In_opt_
331640462c92SVictor Perevertkin PCUNICODE_STRING SDDLString
331740462c92SVictor Perevertkin )
331840462c92SVictor Perevertkin {
331940462c92SVictor Perevertkin return ((PFN_WDFDEVICEINITASSIGNSDDLSTRING) WdfFunctions[WdfDeviceInitAssignSDDLStringTableIndex])(WdfDriverGlobals, DeviceInit, SDDLString);
332040462c92SVictor Perevertkin }
332140462c92SVictor Perevertkin
332240462c92SVictor Perevertkin //
332340462c92SVictor Perevertkin // WDF Function: WdfDeviceInitSetDeviceClass
332440462c92SVictor Perevertkin //
332540462c92SVictor Perevertkin typedef
332640462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
332740462c92SVictor Perevertkin WDFAPI
332840462c92SVictor Perevertkin VOID
3329*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEINITSETDEVICECLASS)(
333040462c92SVictor Perevertkin _In_
333140462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
333240462c92SVictor Perevertkin _In_
333340462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
333440462c92SVictor Perevertkin _In_
333540462c92SVictor Perevertkin CONST GUID* DeviceClassGuid
333640462c92SVictor Perevertkin );
333740462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)333840462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
333940462c92SVictor Perevertkin FORCEINLINE
3340*545df815SVictor Perevertkin VOID
334140462c92SVictor Perevertkin WdfDeviceInitSetDeviceClass(
334240462c92SVictor Perevertkin _In_
334340462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
334440462c92SVictor Perevertkin _In_
334540462c92SVictor Perevertkin CONST GUID* DeviceClassGuid
334640462c92SVictor Perevertkin )
334740462c92SVictor Perevertkin {
334840462c92SVictor Perevertkin ((PFN_WDFDEVICEINITSETDEVICECLASS) WdfFunctions[WdfDeviceInitSetDeviceClassTableIndex])(WdfDriverGlobals, DeviceInit, DeviceClassGuid);
334940462c92SVictor Perevertkin }
335040462c92SVictor Perevertkin
335140462c92SVictor Perevertkin //
335240462c92SVictor Perevertkin // WDF Function: WdfDeviceInitSetCharacteristics
335340462c92SVictor Perevertkin //
335440462c92SVictor Perevertkin typedef
335540462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
335640462c92SVictor Perevertkin WDFAPI
335740462c92SVictor Perevertkin VOID
3358*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEINITSETCHARACTERISTICS)(
335940462c92SVictor Perevertkin _In_
336040462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
336140462c92SVictor Perevertkin _In_
336240462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
336340462c92SVictor Perevertkin _In_
336440462c92SVictor Perevertkin ULONG DeviceCharacteristics,
336540462c92SVictor Perevertkin _In_
336640462c92SVictor Perevertkin BOOLEAN OrInValues
336740462c92SVictor Perevertkin );
336840462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)336940462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
337040462c92SVictor Perevertkin FORCEINLINE
3371*545df815SVictor Perevertkin VOID
337240462c92SVictor Perevertkin WdfDeviceInitSetCharacteristics(
337340462c92SVictor Perevertkin _In_
337440462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
337540462c92SVictor Perevertkin _In_
337640462c92SVictor Perevertkin ULONG DeviceCharacteristics,
337740462c92SVictor Perevertkin _In_
337840462c92SVictor Perevertkin BOOLEAN OrInValues
337940462c92SVictor Perevertkin )
338040462c92SVictor Perevertkin {
338140462c92SVictor Perevertkin ((PFN_WDFDEVICEINITSETCHARACTERISTICS) WdfFunctions[WdfDeviceInitSetCharacteristicsTableIndex])(WdfDriverGlobals, DeviceInit, DeviceCharacteristics, OrInValues);
338240462c92SVictor Perevertkin }
338340462c92SVictor Perevertkin
338440462c92SVictor Perevertkin //
338540462c92SVictor Perevertkin // WDF Function: WdfDeviceInitSetFileObjectConfig
338640462c92SVictor Perevertkin //
338740462c92SVictor Perevertkin typedef
338840462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
338940462c92SVictor Perevertkin WDFAPI
339040462c92SVictor Perevertkin VOID
3391*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEINITSETFILEOBJECTCONFIG)(
339240462c92SVictor Perevertkin _In_
339340462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
339440462c92SVictor Perevertkin _In_
339540462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
339640462c92SVictor Perevertkin _In_
339740462c92SVictor Perevertkin PWDF_FILEOBJECT_CONFIG FileObjectConfig,
339840462c92SVictor Perevertkin _In_opt_
339940462c92SVictor Perevertkin PWDF_OBJECT_ATTRIBUTES FileObjectAttributes
340040462c92SVictor Perevertkin );
340140462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)340240462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
340340462c92SVictor Perevertkin FORCEINLINE
3404*545df815SVictor Perevertkin VOID
340540462c92SVictor Perevertkin WdfDeviceInitSetFileObjectConfig(
340640462c92SVictor Perevertkin _In_
340740462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
340840462c92SVictor Perevertkin _In_
340940462c92SVictor Perevertkin PWDF_FILEOBJECT_CONFIG FileObjectConfig,
341040462c92SVictor Perevertkin _In_opt_
341140462c92SVictor Perevertkin PWDF_OBJECT_ATTRIBUTES FileObjectAttributes
341240462c92SVictor Perevertkin )
341340462c92SVictor Perevertkin {
341440462c92SVictor Perevertkin ((PFN_WDFDEVICEINITSETFILEOBJECTCONFIG) WdfFunctions[WdfDeviceInitSetFileObjectConfigTableIndex])(WdfDriverGlobals, DeviceInit, FileObjectConfig, FileObjectAttributes);
341540462c92SVictor Perevertkin }
341640462c92SVictor Perevertkin
341740462c92SVictor Perevertkin //
341840462c92SVictor Perevertkin // WDF Function: WdfDeviceInitSetRequestAttributes
341940462c92SVictor Perevertkin //
342040462c92SVictor Perevertkin typedef
342140462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
342240462c92SVictor Perevertkin WDFAPI
342340462c92SVictor Perevertkin VOID
3424*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEINITSETREQUESTATTRIBUTES)(
342540462c92SVictor Perevertkin _In_
342640462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
342740462c92SVictor Perevertkin _In_
342840462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
342940462c92SVictor Perevertkin _In_
343040462c92SVictor Perevertkin PWDF_OBJECT_ATTRIBUTES RequestAttributes
343140462c92SVictor Perevertkin );
343240462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)343340462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
343440462c92SVictor Perevertkin FORCEINLINE
3435*545df815SVictor Perevertkin VOID
343640462c92SVictor Perevertkin WdfDeviceInitSetRequestAttributes(
343740462c92SVictor Perevertkin _In_
343840462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
343940462c92SVictor Perevertkin _In_
344040462c92SVictor Perevertkin PWDF_OBJECT_ATTRIBUTES RequestAttributes
344140462c92SVictor Perevertkin )
344240462c92SVictor Perevertkin {
344340462c92SVictor Perevertkin ((PFN_WDFDEVICEINITSETREQUESTATTRIBUTES) WdfFunctions[WdfDeviceInitSetRequestAttributesTableIndex])(WdfDriverGlobals, DeviceInit, RequestAttributes);
344440462c92SVictor Perevertkin }
344540462c92SVictor Perevertkin
344640462c92SVictor Perevertkin //
344740462c92SVictor Perevertkin // WDF Function: WdfDeviceInitAssignWdmIrpPreprocessCallback
344840462c92SVictor Perevertkin //
344940462c92SVictor Perevertkin typedef
345040462c92SVictor Perevertkin _Must_inspect_result_
345140462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
345240462c92SVictor Perevertkin WDFAPI
345340462c92SVictor Perevertkin NTSTATUS
3454*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEINITASSIGNWDMIRPPREPROCESSCALLBACK)(
345540462c92SVictor Perevertkin _In_
345640462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
345740462c92SVictor Perevertkin _In_
345840462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
345940462c92SVictor Perevertkin _In_
346040462c92SVictor Perevertkin PFN_WDFDEVICE_WDM_IRP_PREPROCESS EvtDeviceWdmIrpPreprocess,
346140462c92SVictor Perevertkin _In_
346240462c92SVictor Perevertkin UCHAR MajorFunction,
346340462c92SVictor Perevertkin _When_(NumMinorFunctions > 0, _In_reads_bytes_(NumMinorFunctions))
346440462c92SVictor Perevertkin _When_(NumMinorFunctions == 0, _In_opt_)
346540462c92SVictor Perevertkin PUCHAR MinorFunctions,
346640462c92SVictor Perevertkin _In_
346740462c92SVictor Perevertkin ULONG NumMinorFunctions
346840462c92SVictor Perevertkin );
346940462c92SVictor Perevertkin
347040462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(DISPATCH_LEVEL)347140462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
347240462c92SVictor Perevertkin FORCEINLINE
3473*545df815SVictor Perevertkin NTSTATUS
347440462c92SVictor Perevertkin WdfDeviceInitAssignWdmIrpPreprocessCallback(
347540462c92SVictor Perevertkin _In_
347640462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
347740462c92SVictor Perevertkin _In_
347840462c92SVictor Perevertkin PFN_WDFDEVICE_WDM_IRP_PREPROCESS EvtDeviceWdmIrpPreprocess,
347940462c92SVictor Perevertkin _In_
348040462c92SVictor Perevertkin UCHAR MajorFunction,
348140462c92SVictor Perevertkin _When_(NumMinorFunctions > 0, _In_reads_bytes_(NumMinorFunctions))
348240462c92SVictor Perevertkin _When_(NumMinorFunctions == 0, _In_opt_)
348340462c92SVictor Perevertkin PUCHAR MinorFunctions,
348440462c92SVictor Perevertkin _In_
348540462c92SVictor Perevertkin ULONG NumMinorFunctions
348640462c92SVictor Perevertkin )
348740462c92SVictor Perevertkin {
348840462c92SVictor Perevertkin return ((PFN_WDFDEVICEINITASSIGNWDMIRPPREPROCESSCALLBACK) WdfFunctions[WdfDeviceInitAssignWdmIrpPreprocessCallbackTableIndex])(WdfDriverGlobals, DeviceInit, EvtDeviceWdmIrpPreprocess, MajorFunction, MinorFunctions, NumMinorFunctions);
348940462c92SVictor Perevertkin }
349040462c92SVictor Perevertkin
349140462c92SVictor Perevertkin //
349240462c92SVictor Perevertkin // WDF Function: WdfDeviceInitSetIoInCallerContextCallback
349340462c92SVictor Perevertkin //
349440462c92SVictor Perevertkin typedef
349540462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
349640462c92SVictor Perevertkin WDFAPI
349740462c92SVictor Perevertkin VOID
3498*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEINITSETIOINCALLERCONTEXTCALLBACK)(
349940462c92SVictor Perevertkin _In_
350040462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
350140462c92SVictor Perevertkin _In_
350240462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
350340462c92SVictor Perevertkin _In_
350440462c92SVictor Perevertkin PFN_WDF_IO_IN_CALLER_CONTEXT EvtIoInCallerContext
350540462c92SVictor Perevertkin );
350640462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)350740462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
350840462c92SVictor Perevertkin FORCEINLINE
3509*545df815SVictor Perevertkin VOID
351040462c92SVictor Perevertkin WdfDeviceInitSetIoInCallerContextCallback(
351140462c92SVictor Perevertkin _In_
351240462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
351340462c92SVictor Perevertkin _In_
351440462c92SVictor Perevertkin PFN_WDF_IO_IN_CALLER_CONTEXT EvtIoInCallerContext
351540462c92SVictor Perevertkin )
351640462c92SVictor Perevertkin {
351740462c92SVictor Perevertkin ((PFN_WDFDEVICEINITSETIOINCALLERCONTEXTCALLBACK) WdfFunctions[WdfDeviceInitSetIoInCallerContextCallbackTableIndex])(WdfDriverGlobals, DeviceInit, EvtIoInCallerContext);
351840462c92SVictor Perevertkin }
351940462c92SVictor Perevertkin
352040462c92SVictor Perevertkin //
352140462c92SVictor Perevertkin // WDF Function: WdfDeviceInitSetRemoveLockOptions
352240462c92SVictor Perevertkin //
352340462c92SVictor Perevertkin typedef
352440462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
352540462c92SVictor Perevertkin WDFAPI
352640462c92SVictor Perevertkin VOID
3527*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEINITSETREMOVELOCKOPTIONS)(
352840462c92SVictor Perevertkin _In_
352940462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
353040462c92SVictor Perevertkin _In_
353140462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
353240462c92SVictor Perevertkin _In_
353340462c92SVictor Perevertkin PWDF_REMOVE_LOCK_OPTIONS Options
353440462c92SVictor Perevertkin );
353540462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)353640462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
353740462c92SVictor Perevertkin FORCEINLINE
3538*545df815SVictor Perevertkin VOID
353940462c92SVictor Perevertkin WdfDeviceInitSetRemoveLockOptions(
354040462c92SVictor Perevertkin _In_
354140462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
354240462c92SVictor Perevertkin _In_
354340462c92SVictor Perevertkin PWDF_REMOVE_LOCK_OPTIONS Options
354440462c92SVictor Perevertkin )
354540462c92SVictor Perevertkin {
354640462c92SVictor Perevertkin ((PFN_WDFDEVICEINITSETREMOVELOCKOPTIONS) WdfFunctions[WdfDeviceInitSetRemoveLockOptionsTableIndex])(WdfDriverGlobals, DeviceInit, Options);
354740462c92SVictor Perevertkin }
354840462c92SVictor Perevertkin
354940462c92SVictor Perevertkin //
355040462c92SVictor Perevertkin // WDF Function: WdfDeviceCreate
355140462c92SVictor Perevertkin //
355240462c92SVictor Perevertkin typedef
355340462c92SVictor Perevertkin _Must_inspect_result_
355440462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
355540462c92SVictor Perevertkin WDFAPI
355640462c92SVictor Perevertkin NTSTATUS
3557*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICECREATE)(
355840462c92SVictor Perevertkin _In_
355940462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
356040462c92SVictor Perevertkin _Inout_
356140462c92SVictor Perevertkin PWDFDEVICE_INIT* DeviceInit,
356240462c92SVictor Perevertkin _In_opt_
356340462c92SVictor Perevertkin PWDF_OBJECT_ATTRIBUTES DeviceAttributes,
356440462c92SVictor Perevertkin _Out_
356540462c92SVictor Perevertkin WDFDEVICE* Device
356640462c92SVictor Perevertkin );
356740462c92SVictor Perevertkin
356840462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(PASSIVE_LEVEL)356940462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
357040462c92SVictor Perevertkin FORCEINLINE
3571*545df815SVictor Perevertkin NTSTATUS
357240462c92SVictor Perevertkin WdfDeviceCreate(
357340462c92SVictor Perevertkin _Inout_
357440462c92SVictor Perevertkin PWDFDEVICE_INIT* DeviceInit,
357540462c92SVictor Perevertkin _In_opt_
357640462c92SVictor Perevertkin PWDF_OBJECT_ATTRIBUTES DeviceAttributes,
357740462c92SVictor Perevertkin _Out_
357840462c92SVictor Perevertkin WDFDEVICE* Device
357940462c92SVictor Perevertkin )
358040462c92SVictor Perevertkin {
358140462c92SVictor Perevertkin return ((PFN_WDFDEVICECREATE) WdfFunctions[WdfDeviceCreateTableIndex])(WdfDriverGlobals, DeviceInit, DeviceAttributes, Device);
358240462c92SVictor Perevertkin }
358340462c92SVictor Perevertkin
358440462c92SVictor Perevertkin //
358540462c92SVictor Perevertkin // WDF Function: WdfDeviceSetStaticStopRemove
358640462c92SVictor Perevertkin //
358740462c92SVictor Perevertkin typedef
358840462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
358940462c92SVictor Perevertkin WDFAPI
359040462c92SVictor Perevertkin VOID
3591*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICESETSTATICSTOPREMOVE)(
359240462c92SVictor Perevertkin _In_
359340462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
359440462c92SVictor Perevertkin _In_
359540462c92SVictor Perevertkin WDFDEVICE Device,
359640462c92SVictor Perevertkin _In_
359740462c92SVictor Perevertkin BOOLEAN Stoppable
359840462c92SVictor Perevertkin );
359940462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)360040462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
360140462c92SVictor Perevertkin FORCEINLINE
3602*545df815SVictor Perevertkin VOID
360340462c92SVictor Perevertkin WdfDeviceSetStaticStopRemove(
360440462c92SVictor Perevertkin _In_
360540462c92SVictor Perevertkin WDFDEVICE Device,
360640462c92SVictor Perevertkin _In_
360740462c92SVictor Perevertkin BOOLEAN Stoppable
360840462c92SVictor Perevertkin )
360940462c92SVictor Perevertkin {
361040462c92SVictor Perevertkin ((PFN_WDFDEVICESETSTATICSTOPREMOVE) WdfFunctions[WdfDeviceSetStaticStopRemoveTableIndex])(WdfDriverGlobals, Device, Stoppable);
361140462c92SVictor Perevertkin }
361240462c92SVictor Perevertkin
361340462c92SVictor Perevertkin //
361440462c92SVictor Perevertkin // WDF Function: WdfDeviceCreateDeviceInterface
361540462c92SVictor Perevertkin //
361640462c92SVictor Perevertkin typedef
361740462c92SVictor Perevertkin _Must_inspect_result_
361840462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
361940462c92SVictor Perevertkin WDFAPI
362040462c92SVictor Perevertkin NTSTATUS
3621*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICECREATEDEVICEINTERFACE)(
362240462c92SVictor Perevertkin _In_
362340462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
362440462c92SVictor Perevertkin _In_
362540462c92SVictor Perevertkin WDFDEVICE Device,
362640462c92SVictor Perevertkin _In_
362740462c92SVictor Perevertkin CONST GUID* InterfaceClassGUID,
362840462c92SVictor Perevertkin _In_opt_
362940462c92SVictor Perevertkin PCUNICODE_STRING ReferenceString
363040462c92SVictor Perevertkin );
363140462c92SVictor Perevertkin
363240462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(PASSIVE_LEVEL)363340462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
363440462c92SVictor Perevertkin FORCEINLINE
3635*545df815SVictor Perevertkin NTSTATUS
363640462c92SVictor Perevertkin WdfDeviceCreateDeviceInterface(
363740462c92SVictor Perevertkin _In_
363840462c92SVictor Perevertkin WDFDEVICE Device,
363940462c92SVictor Perevertkin _In_
364040462c92SVictor Perevertkin CONST GUID* InterfaceClassGUID,
364140462c92SVictor Perevertkin _In_opt_
364240462c92SVictor Perevertkin PCUNICODE_STRING ReferenceString
364340462c92SVictor Perevertkin )
364440462c92SVictor Perevertkin {
364540462c92SVictor Perevertkin return ((PFN_WDFDEVICECREATEDEVICEINTERFACE) WdfFunctions[WdfDeviceCreateDeviceInterfaceTableIndex])(WdfDriverGlobals, Device, InterfaceClassGUID, ReferenceString);
364640462c92SVictor Perevertkin }
364740462c92SVictor Perevertkin
364840462c92SVictor Perevertkin //
364940462c92SVictor Perevertkin // WDF Function: WdfDeviceSetDeviceInterfaceState
365040462c92SVictor Perevertkin //
365140462c92SVictor Perevertkin typedef
365240462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
365340462c92SVictor Perevertkin WDFAPI
365440462c92SVictor Perevertkin VOID
3655*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICESETDEVICEINTERFACESTATE)(
365640462c92SVictor Perevertkin _In_
365740462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
365840462c92SVictor Perevertkin _In_
365940462c92SVictor Perevertkin WDFDEVICE Device,
366040462c92SVictor Perevertkin _In_
366140462c92SVictor Perevertkin CONST GUID* InterfaceClassGUID,
366240462c92SVictor Perevertkin _In_opt_
366340462c92SVictor Perevertkin PCUNICODE_STRING ReferenceString,
366440462c92SVictor Perevertkin _In_
366540462c92SVictor Perevertkin BOOLEAN IsInterfaceEnabled
366640462c92SVictor Perevertkin );
366740462c92SVictor Perevertkin
_IRQL_requires_max_(PASSIVE_LEVEL)366840462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
366940462c92SVictor Perevertkin FORCEINLINE
3670*545df815SVictor Perevertkin VOID
367140462c92SVictor Perevertkin WdfDeviceSetDeviceInterfaceState(
367240462c92SVictor Perevertkin _In_
367340462c92SVictor Perevertkin WDFDEVICE Device,
367440462c92SVictor Perevertkin _In_
367540462c92SVictor Perevertkin CONST GUID* InterfaceClassGUID,
367640462c92SVictor Perevertkin _In_opt_
367740462c92SVictor Perevertkin PCUNICODE_STRING ReferenceString,
367840462c92SVictor Perevertkin _In_
367940462c92SVictor Perevertkin BOOLEAN IsInterfaceEnabled
368040462c92SVictor Perevertkin )
368140462c92SVictor Perevertkin {
368240462c92SVictor Perevertkin ((PFN_WDFDEVICESETDEVICEINTERFACESTATE) WdfFunctions[WdfDeviceSetDeviceInterfaceStateTableIndex])(WdfDriverGlobals, Device, InterfaceClassGUID, ReferenceString, IsInterfaceEnabled);
368340462c92SVictor Perevertkin }
368440462c92SVictor Perevertkin
368540462c92SVictor Perevertkin //
368640462c92SVictor Perevertkin // WDF Function: WdfDeviceRetrieveDeviceInterfaceString
368740462c92SVictor Perevertkin //
368840462c92SVictor Perevertkin typedef
368940462c92SVictor Perevertkin _Must_inspect_result_
369040462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
369140462c92SVictor Perevertkin WDFAPI
369240462c92SVictor Perevertkin NTSTATUS
3693*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICERETRIEVEDEVICEINTERFACESTRING)(
369440462c92SVictor Perevertkin _In_
369540462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
369640462c92SVictor Perevertkin _In_
369740462c92SVictor Perevertkin WDFDEVICE Device,
369840462c92SVictor Perevertkin _In_
369940462c92SVictor Perevertkin CONST GUID* InterfaceClassGUID,
370040462c92SVictor Perevertkin _In_opt_
370140462c92SVictor Perevertkin PCUNICODE_STRING ReferenceString,
370240462c92SVictor Perevertkin _In_
370340462c92SVictor Perevertkin WDFSTRING String
370440462c92SVictor Perevertkin );
370540462c92SVictor Perevertkin
370640462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(PASSIVE_LEVEL)370740462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
370840462c92SVictor Perevertkin FORCEINLINE
3709*545df815SVictor Perevertkin NTSTATUS
371040462c92SVictor Perevertkin WdfDeviceRetrieveDeviceInterfaceString(
371140462c92SVictor Perevertkin _In_
371240462c92SVictor Perevertkin WDFDEVICE Device,
371340462c92SVictor Perevertkin _In_
371440462c92SVictor Perevertkin CONST GUID* InterfaceClassGUID,
371540462c92SVictor Perevertkin _In_opt_
371640462c92SVictor Perevertkin PCUNICODE_STRING ReferenceString,
371740462c92SVictor Perevertkin _In_
371840462c92SVictor Perevertkin WDFSTRING String
371940462c92SVictor Perevertkin )
372040462c92SVictor Perevertkin {
372140462c92SVictor Perevertkin return ((PFN_WDFDEVICERETRIEVEDEVICEINTERFACESTRING) WdfFunctions[WdfDeviceRetrieveDeviceInterfaceStringTableIndex])(WdfDriverGlobals, Device, InterfaceClassGUID, ReferenceString, String);
372240462c92SVictor Perevertkin }
372340462c92SVictor Perevertkin
372440462c92SVictor Perevertkin //
372540462c92SVictor Perevertkin // WDF Function: WdfDeviceCreateSymbolicLink
372640462c92SVictor Perevertkin //
372740462c92SVictor Perevertkin typedef
372840462c92SVictor Perevertkin _Must_inspect_result_
372940462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
373040462c92SVictor Perevertkin WDFAPI
373140462c92SVictor Perevertkin NTSTATUS
3732*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICECREATESYMBOLICLINK)(
373340462c92SVictor Perevertkin _In_
373440462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
373540462c92SVictor Perevertkin _In_
373640462c92SVictor Perevertkin WDFDEVICE Device,
373740462c92SVictor Perevertkin _In_
373840462c92SVictor Perevertkin PCUNICODE_STRING SymbolicLinkName
373940462c92SVictor Perevertkin );
374040462c92SVictor Perevertkin
374140462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(PASSIVE_LEVEL)374240462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
374340462c92SVictor Perevertkin FORCEINLINE
3744*545df815SVictor Perevertkin NTSTATUS
374540462c92SVictor Perevertkin WdfDeviceCreateSymbolicLink(
374640462c92SVictor Perevertkin _In_
374740462c92SVictor Perevertkin WDFDEVICE Device,
374840462c92SVictor Perevertkin _In_
374940462c92SVictor Perevertkin PCUNICODE_STRING SymbolicLinkName
375040462c92SVictor Perevertkin )
375140462c92SVictor Perevertkin {
375240462c92SVictor Perevertkin return ((PFN_WDFDEVICECREATESYMBOLICLINK) WdfFunctions[WdfDeviceCreateSymbolicLinkTableIndex])(WdfDriverGlobals, Device, SymbolicLinkName);
375340462c92SVictor Perevertkin }
375440462c92SVictor Perevertkin
375540462c92SVictor Perevertkin //
375640462c92SVictor Perevertkin // WDF Function: WdfDeviceQueryProperty
375740462c92SVictor Perevertkin //
375840462c92SVictor Perevertkin typedef
375940462c92SVictor Perevertkin _Must_inspect_result_
376040462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
376140462c92SVictor Perevertkin WDFAPI
376240462c92SVictor Perevertkin NTSTATUS
3763*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEQUERYPROPERTY)(
376440462c92SVictor Perevertkin _In_
376540462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
376640462c92SVictor Perevertkin _In_
376740462c92SVictor Perevertkin WDFDEVICE Device,
376840462c92SVictor Perevertkin _In_
376940462c92SVictor Perevertkin DEVICE_REGISTRY_PROPERTY DeviceProperty,
377040462c92SVictor Perevertkin _In_
377140462c92SVictor Perevertkin ULONG BufferLength,
377240462c92SVictor Perevertkin _Out_writes_bytes_all_(BufferLength)
377340462c92SVictor Perevertkin PVOID PropertyBuffer,
377440462c92SVictor Perevertkin _Out_
377540462c92SVictor Perevertkin PULONG ResultLength
377640462c92SVictor Perevertkin );
377740462c92SVictor Perevertkin
377840462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(PASSIVE_LEVEL)377940462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
378040462c92SVictor Perevertkin FORCEINLINE
3781*545df815SVictor Perevertkin NTSTATUS
378240462c92SVictor Perevertkin WdfDeviceQueryProperty(
378340462c92SVictor Perevertkin _In_
378440462c92SVictor Perevertkin WDFDEVICE Device,
378540462c92SVictor Perevertkin _In_
378640462c92SVictor Perevertkin DEVICE_REGISTRY_PROPERTY DeviceProperty,
378740462c92SVictor Perevertkin _In_
378840462c92SVictor Perevertkin ULONG BufferLength,
378940462c92SVictor Perevertkin _Out_writes_bytes_all_(BufferLength)
379040462c92SVictor Perevertkin PVOID PropertyBuffer,
379140462c92SVictor Perevertkin _Out_
379240462c92SVictor Perevertkin PULONG ResultLength
379340462c92SVictor Perevertkin )
379440462c92SVictor Perevertkin {
379540462c92SVictor Perevertkin return ((PFN_WDFDEVICEQUERYPROPERTY) WdfFunctions[WdfDeviceQueryPropertyTableIndex])(WdfDriverGlobals, Device, DeviceProperty, BufferLength, PropertyBuffer, ResultLength);
379640462c92SVictor Perevertkin }
379740462c92SVictor Perevertkin
379840462c92SVictor Perevertkin //
379940462c92SVictor Perevertkin // WDF Function: WdfDeviceAllocAndQueryProperty
380040462c92SVictor Perevertkin //
380140462c92SVictor Perevertkin typedef
380240462c92SVictor Perevertkin _Must_inspect_result_
380340462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
380440462c92SVictor Perevertkin WDFAPI
380540462c92SVictor Perevertkin NTSTATUS
3806*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEALLOCANDQUERYPROPERTY)(
380740462c92SVictor Perevertkin _In_
380840462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
380940462c92SVictor Perevertkin _In_
381040462c92SVictor Perevertkin WDFDEVICE Device,
381140462c92SVictor Perevertkin _In_
381240462c92SVictor Perevertkin DEVICE_REGISTRY_PROPERTY DeviceProperty,
381340462c92SVictor Perevertkin _In_
381440462c92SVictor Perevertkin _Strict_type_match_
381540462c92SVictor Perevertkin POOL_TYPE PoolType,
381640462c92SVictor Perevertkin _In_opt_
381740462c92SVictor Perevertkin PWDF_OBJECT_ATTRIBUTES PropertyMemoryAttributes,
381840462c92SVictor Perevertkin _Out_
381940462c92SVictor Perevertkin WDFMEMORY* PropertyMemory
382040462c92SVictor Perevertkin );
382140462c92SVictor Perevertkin
382240462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(PASSIVE_LEVEL)382340462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
382440462c92SVictor Perevertkin FORCEINLINE
3825*545df815SVictor Perevertkin NTSTATUS
382640462c92SVictor Perevertkin WdfDeviceAllocAndQueryProperty(
382740462c92SVictor Perevertkin _In_
382840462c92SVictor Perevertkin WDFDEVICE Device,
382940462c92SVictor Perevertkin _In_
383040462c92SVictor Perevertkin DEVICE_REGISTRY_PROPERTY DeviceProperty,
383140462c92SVictor Perevertkin _In_
383240462c92SVictor Perevertkin _Strict_type_match_
383340462c92SVictor Perevertkin POOL_TYPE PoolType,
383440462c92SVictor Perevertkin _In_opt_
383540462c92SVictor Perevertkin PWDF_OBJECT_ATTRIBUTES PropertyMemoryAttributes,
383640462c92SVictor Perevertkin _Out_
383740462c92SVictor Perevertkin WDFMEMORY* PropertyMemory
383840462c92SVictor Perevertkin )
383940462c92SVictor Perevertkin {
384040462c92SVictor Perevertkin return ((PFN_WDFDEVICEALLOCANDQUERYPROPERTY) WdfFunctions[WdfDeviceAllocAndQueryPropertyTableIndex])(WdfDriverGlobals, Device, DeviceProperty, PoolType, PropertyMemoryAttributes, PropertyMemory);
384140462c92SVictor Perevertkin }
384240462c92SVictor Perevertkin
384340462c92SVictor Perevertkin //
384440462c92SVictor Perevertkin // WDF Function: WdfDeviceSetPnpCapabilities
384540462c92SVictor Perevertkin //
384640462c92SVictor Perevertkin typedef
384740462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
384840462c92SVictor Perevertkin WDFAPI
384940462c92SVictor Perevertkin VOID
3850*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICESETPNPCAPABILITIES)(
385140462c92SVictor Perevertkin _In_
385240462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
385340462c92SVictor Perevertkin _In_
385440462c92SVictor Perevertkin WDFDEVICE Device,
385540462c92SVictor Perevertkin _In_
385640462c92SVictor Perevertkin PWDF_DEVICE_PNP_CAPABILITIES PnpCapabilities
385740462c92SVictor Perevertkin );
385840462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)385940462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
386040462c92SVictor Perevertkin FORCEINLINE
3861*545df815SVictor Perevertkin VOID
386240462c92SVictor Perevertkin WdfDeviceSetPnpCapabilities(
386340462c92SVictor Perevertkin _In_
386440462c92SVictor Perevertkin WDFDEVICE Device,
386540462c92SVictor Perevertkin _In_
386640462c92SVictor Perevertkin PWDF_DEVICE_PNP_CAPABILITIES PnpCapabilities
386740462c92SVictor Perevertkin )
386840462c92SVictor Perevertkin {
386940462c92SVictor Perevertkin ((PFN_WDFDEVICESETPNPCAPABILITIES) WdfFunctions[WdfDeviceSetPnpCapabilitiesTableIndex])(WdfDriverGlobals, Device, PnpCapabilities);
387040462c92SVictor Perevertkin }
387140462c92SVictor Perevertkin
387240462c92SVictor Perevertkin //
387340462c92SVictor Perevertkin // WDF Function: WdfDeviceSetPowerCapabilities
387440462c92SVictor Perevertkin //
387540462c92SVictor Perevertkin typedef
387640462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
387740462c92SVictor Perevertkin WDFAPI
387840462c92SVictor Perevertkin VOID
3879*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICESETPOWERCAPABILITIES)(
388040462c92SVictor Perevertkin _In_
388140462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
388240462c92SVictor Perevertkin _In_
388340462c92SVictor Perevertkin WDFDEVICE Device,
388440462c92SVictor Perevertkin _In_
388540462c92SVictor Perevertkin PWDF_DEVICE_POWER_CAPABILITIES PowerCapabilities
388640462c92SVictor Perevertkin );
388740462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)388840462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
388940462c92SVictor Perevertkin FORCEINLINE
3890*545df815SVictor Perevertkin VOID
389140462c92SVictor Perevertkin WdfDeviceSetPowerCapabilities(
389240462c92SVictor Perevertkin _In_
389340462c92SVictor Perevertkin WDFDEVICE Device,
389440462c92SVictor Perevertkin _In_
389540462c92SVictor Perevertkin PWDF_DEVICE_POWER_CAPABILITIES PowerCapabilities
389640462c92SVictor Perevertkin )
389740462c92SVictor Perevertkin {
389840462c92SVictor Perevertkin ((PFN_WDFDEVICESETPOWERCAPABILITIES) WdfFunctions[WdfDeviceSetPowerCapabilitiesTableIndex])(WdfDriverGlobals, Device, PowerCapabilities);
389940462c92SVictor Perevertkin }
390040462c92SVictor Perevertkin
390140462c92SVictor Perevertkin //
390240462c92SVictor Perevertkin // WDF Function: WdfDeviceSetBusInformationForChildren
390340462c92SVictor Perevertkin //
390440462c92SVictor Perevertkin typedef
390540462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
390640462c92SVictor Perevertkin WDFAPI
390740462c92SVictor Perevertkin VOID
3908*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICESETBUSINFORMATIONFORCHILDREN)(
390940462c92SVictor Perevertkin _In_
391040462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
391140462c92SVictor Perevertkin _In_
391240462c92SVictor Perevertkin WDFDEVICE Device,
391340462c92SVictor Perevertkin _In_
391440462c92SVictor Perevertkin PPNP_BUS_INFORMATION BusInformation
391540462c92SVictor Perevertkin );
391640462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)391740462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
391840462c92SVictor Perevertkin FORCEINLINE
3919*545df815SVictor Perevertkin VOID
392040462c92SVictor Perevertkin WdfDeviceSetBusInformationForChildren(
392140462c92SVictor Perevertkin _In_
392240462c92SVictor Perevertkin WDFDEVICE Device,
392340462c92SVictor Perevertkin _In_
392440462c92SVictor Perevertkin PPNP_BUS_INFORMATION BusInformation
392540462c92SVictor Perevertkin )
392640462c92SVictor Perevertkin {
392740462c92SVictor Perevertkin ((PFN_WDFDEVICESETBUSINFORMATIONFORCHILDREN) WdfFunctions[WdfDeviceSetBusInformationForChildrenTableIndex])(WdfDriverGlobals, Device, BusInformation);
392840462c92SVictor Perevertkin }
392940462c92SVictor Perevertkin
393040462c92SVictor Perevertkin //
393140462c92SVictor Perevertkin // WDF Function: WdfDeviceIndicateWakeStatus
393240462c92SVictor Perevertkin //
393340462c92SVictor Perevertkin typedef
393440462c92SVictor Perevertkin _Must_inspect_result_
393540462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
393640462c92SVictor Perevertkin WDFAPI
393740462c92SVictor Perevertkin NTSTATUS
3938*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEINDICATEWAKESTATUS)(
393940462c92SVictor Perevertkin _In_
394040462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
394140462c92SVictor Perevertkin _In_
394240462c92SVictor Perevertkin WDFDEVICE Device,
394340462c92SVictor Perevertkin _In_
394440462c92SVictor Perevertkin NTSTATUS WaitWakeStatus
394540462c92SVictor Perevertkin );
394640462c92SVictor Perevertkin
394740462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(DISPATCH_LEVEL)394840462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
394940462c92SVictor Perevertkin FORCEINLINE
3950*545df815SVictor Perevertkin NTSTATUS
395140462c92SVictor Perevertkin WdfDeviceIndicateWakeStatus(
395240462c92SVictor Perevertkin _In_
395340462c92SVictor Perevertkin WDFDEVICE Device,
395440462c92SVictor Perevertkin _In_
395540462c92SVictor Perevertkin NTSTATUS WaitWakeStatus
395640462c92SVictor Perevertkin )
395740462c92SVictor Perevertkin {
395840462c92SVictor Perevertkin return ((PFN_WDFDEVICEINDICATEWAKESTATUS) WdfFunctions[WdfDeviceIndicateWakeStatusTableIndex])(WdfDriverGlobals, Device, WaitWakeStatus);
395940462c92SVictor Perevertkin }
396040462c92SVictor Perevertkin
396140462c92SVictor Perevertkin //
396240462c92SVictor Perevertkin // WDF Function: WdfDeviceSetFailed
396340462c92SVictor Perevertkin //
396440462c92SVictor Perevertkin typedef
396540462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
396640462c92SVictor Perevertkin WDFAPI
396740462c92SVictor Perevertkin VOID
3968*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICESETFAILED)(
396940462c92SVictor Perevertkin _In_
397040462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
397140462c92SVictor Perevertkin _In_
397240462c92SVictor Perevertkin WDFDEVICE Device,
397340462c92SVictor Perevertkin _In_
397440462c92SVictor Perevertkin WDF_DEVICE_FAILED_ACTION FailedAction
397540462c92SVictor Perevertkin );
397640462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)397740462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
397840462c92SVictor Perevertkin FORCEINLINE
3979*545df815SVictor Perevertkin VOID
398040462c92SVictor Perevertkin WdfDeviceSetFailed(
398140462c92SVictor Perevertkin _In_
398240462c92SVictor Perevertkin WDFDEVICE Device,
398340462c92SVictor Perevertkin _In_
398440462c92SVictor Perevertkin WDF_DEVICE_FAILED_ACTION FailedAction
398540462c92SVictor Perevertkin )
398640462c92SVictor Perevertkin {
398740462c92SVictor Perevertkin ((PFN_WDFDEVICESETFAILED) WdfFunctions[WdfDeviceSetFailedTableIndex])(WdfDriverGlobals, Device, FailedAction);
398840462c92SVictor Perevertkin }
398940462c92SVictor Perevertkin
399040462c92SVictor Perevertkin //
399140462c92SVictor Perevertkin // WDF Function: WdfDeviceStopIdleNoTrack
399240462c92SVictor Perevertkin //
399340462c92SVictor Perevertkin typedef
399440462c92SVictor Perevertkin _Must_inspect_result_
399540462c92SVictor Perevertkin _When_(WaitForD0 == 0, _IRQL_requires_max_(DISPATCH_LEVEL))
399640462c92SVictor Perevertkin _When_(WaitForD0 != 0, _IRQL_requires_max_(PASSIVE_LEVEL))
399740462c92SVictor Perevertkin WDFAPI
399840462c92SVictor Perevertkin NTSTATUS
3999*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICESTOPIDLENOTRACK)(
400040462c92SVictor Perevertkin _In_
400140462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
400240462c92SVictor Perevertkin _In_
400340462c92SVictor Perevertkin WDFDEVICE Device,
400440462c92SVictor Perevertkin _In_
400540462c92SVictor Perevertkin BOOLEAN WaitForD0
400640462c92SVictor Perevertkin );
400740462c92SVictor Perevertkin
400840462c92SVictor Perevertkin _Must_inspect_result_
400940462c92SVictor Perevertkin _When_(WaitForD0 == 0, _IRQL_requires_max_(DISPATCH_LEVEL))
401040462c92SVictor Perevertkin _When_(WaitForD0 != 0, _IRQL_requires_max_(PASSIVE_LEVEL))
401140462c92SVictor Perevertkin FORCEINLINE
4012*545df815SVictor Perevertkin NTSTATUS
WdfDeviceStopIdleNoTrack(_In_ WDFDEVICE Device,_In_ BOOLEAN WaitForD0)401340462c92SVictor Perevertkin WdfDeviceStopIdleNoTrack(
401440462c92SVictor Perevertkin _In_
401540462c92SVictor Perevertkin WDFDEVICE Device,
401640462c92SVictor Perevertkin _In_
401740462c92SVictor Perevertkin BOOLEAN WaitForD0
401840462c92SVictor Perevertkin )
401940462c92SVictor Perevertkin {
402040462c92SVictor Perevertkin return ((PFN_WDFDEVICESTOPIDLENOTRACK) WdfFunctions[WdfDeviceStopIdleNoTrackTableIndex])(WdfDriverGlobals, Device, WaitForD0);
402140462c92SVictor Perevertkin }
402240462c92SVictor Perevertkin
402340462c92SVictor Perevertkin //
402440462c92SVictor Perevertkin // WDF Function: WdfDeviceResumeIdleNoTrack
402540462c92SVictor Perevertkin //
402640462c92SVictor Perevertkin typedef
402740462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
402840462c92SVictor Perevertkin WDFAPI
402940462c92SVictor Perevertkin VOID
4030*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICERESUMEIDLENOTRACK)(
403140462c92SVictor Perevertkin _In_
403240462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
403340462c92SVictor Perevertkin _In_
403440462c92SVictor Perevertkin WDFDEVICE Device
403540462c92SVictor Perevertkin );
403640462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)403740462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
403840462c92SVictor Perevertkin FORCEINLINE
4039*545df815SVictor Perevertkin VOID
404040462c92SVictor Perevertkin WdfDeviceResumeIdleNoTrack(
404140462c92SVictor Perevertkin _In_
404240462c92SVictor Perevertkin WDFDEVICE Device
404340462c92SVictor Perevertkin )
404440462c92SVictor Perevertkin {
404540462c92SVictor Perevertkin ((PFN_WDFDEVICERESUMEIDLENOTRACK) WdfFunctions[WdfDeviceResumeIdleNoTrackTableIndex])(WdfDriverGlobals, Device);
404640462c92SVictor Perevertkin }
404740462c92SVictor Perevertkin
404840462c92SVictor Perevertkin //
404940462c92SVictor Perevertkin // WDF Function: WdfDeviceStopIdleActual
405040462c92SVictor Perevertkin //
405140462c92SVictor Perevertkin typedef
405240462c92SVictor Perevertkin _Must_inspect_result_
405340462c92SVictor Perevertkin _When_(WaitForD0 == 0, _IRQL_requires_max_(DISPATCH_LEVEL))
405440462c92SVictor Perevertkin _When_(WaitForD0 != 0, _IRQL_requires_max_(PASSIVE_LEVEL))
405540462c92SVictor Perevertkin WDFAPI
405640462c92SVictor Perevertkin NTSTATUS
4057*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICESTOPIDLEACTUAL)(
405840462c92SVictor Perevertkin _In_
405940462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
406040462c92SVictor Perevertkin _In_
406140462c92SVictor Perevertkin WDFDEVICE Device,
406240462c92SVictor Perevertkin _In_
406340462c92SVictor Perevertkin BOOLEAN WaitForD0,
406440462c92SVictor Perevertkin _In_opt_
406540462c92SVictor Perevertkin PVOID Tag,
406640462c92SVictor Perevertkin _In_
406740462c92SVictor Perevertkin LONG Line,
406840462c92SVictor Perevertkin _In_z_
406940462c92SVictor Perevertkin PCHAR File
407040462c92SVictor Perevertkin );
407140462c92SVictor Perevertkin
407240462c92SVictor Perevertkin _Must_inspect_result_
407340462c92SVictor Perevertkin _When_(WaitForD0 == 0, _IRQL_requires_max_(DISPATCH_LEVEL))
407440462c92SVictor Perevertkin _When_(WaitForD0 != 0, _IRQL_requires_max_(PASSIVE_LEVEL))
407540462c92SVictor Perevertkin FORCEINLINE
4076*545df815SVictor Perevertkin NTSTATUS
WdfDeviceStopIdleActual(_In_ WDFDEVICE Device,_In_ BOOLEAN WaitForD0,_In_opt_ PVOID Tag,_In_ LONG Line,_In_z_ PCHAR File)407740462c92SVictor Perevertkin WdfDeviceStopIdleActual(
407840462c92SVictor Perevertkin _In_
407940462c92SVictor Perevertkin WDFDEVICE Device,
408040462c92SVictor Perevertkin _In_
408140462c92SVictor Perevertkin BOOLEAN WaitForD0,
408240462c92SVictor Perevertkin _In_opt_
408340462c92SVictor Perevertkin PVOID Tag,
408440462c92SVictor Perevertkin _In_
408540462c92SVictor Perevertkin LONG Line,
408640462c92SVictor Perevertkin _In_z_
408740462c92SVictor Perevertkin PCHAR File
408840462c92SVictor Perevertkin )
408940462c92SVictor Perevertkin {
409040462c92SVictor Perevertkin return ((PFN_WDFDEVICESTOPIDLEACTUAL) WdfFunctions[WdfDeviceStopIdleActualTableIndex])(WdfDriverGlobals, Device, WaitForD0, Tag, Line, File);
409140462c92SVictor Perevertkin }
409240462c92SVictor Perevertkin
409340462c92SVictor Perevertkin //
409440462c92SVictor Perevertkin // WDF Function: WdfDeviceResumeIdleActual
409540462c92SVictor Perevertkin //
409640462c92SVictor Perevertkin typedef
409740462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
409840462c92SVictor Perevertkin WDFAPI
409940462c92SVictor Perevertkin VOID
4100*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICERESUMEIDLEACTUAL)(
410140462c92SVictor Perevertkin _In_
410240462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
410340462c92SVictor Perevertkin _In_
410440462c92SVictor Perevertkin WDFDEVICE Device,
410540462c92SVictor Perevertkin _In_opt_
410640462c92SVictor Perevertkin PVOID Tag,
410740462c92SVictor Perevertkin _In_
410840462c92SVictor Perevertkin LONG Line,
410940462c92SVictor Perevertkin _In_z_
411040462c92SVictor Perevertkin PCHAR File
411140462c92SVictor Perevertkin );
411240462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)411340462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
411440462c92SVictor Perevertkin FORCEINLINE
4115*545df815SVictor Perevertkin VOID
411640462c92SVictor Perevertkin WdfDeviceResumeIdleActual(
411740462c92SVictor Perevertkin _In_
411840462c92SVictor Perevertkin WDFDEVICE Device,
411940462c92SVictor Perevertkin _In_opt_
412040462c92SVictor Perevertkin PVOID Tag,
412140462c92SVictor Perevertkin _In_
412240462c92SVictor Perevertkin LONG Line,
412340462c92SVictor Perevertkin _In_z_
412440462c92SVictor Perevertkin PCHAR File
412540462c92SVictor Perevertkin )
412640462c92SVictor Perevertkin {
412740462c92SVictor Perevertkin ((PFN_WDFDEVICERESUMEIDLEACTUAL) WdfFunctions[WdfDeviceResumeIdleActualTableIndex])(WdfDriverGlobals, Device, Tag, Line, File);
412840462c92SVictor Perevertkin }
412940462c92SVictor Perevertkin
413040462c92SVictor Perevertkin //
413140462c92SVictor Perevertkin // WDF Function: WdfDeviceGetFileObject
413240462c92SVictor Perevertkin //
413340462c92SVictor Perevertkin typedef
413440462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
413540462c92SVictor Perevertkin WDFAPI
413640462c92SVictor Perevertkin WDFFILEOBJECT
4137*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEGETFILEOBJECT)(
413840462c92SVictor Perevertkin _In_
413940462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
414040462c92SVictor Perevertkin _In_
414140462c92SVictor Perevertkin WDFDEVICE Device,
414240462c92SVictor Perevertkin _In_
414340462c92SVictor Perevertkin PFILE_OBJECT FileObject
414440462c92SVictor Perevertkin );
414540462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)414640462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
414740462c92SVictor Perevertkin FORCEINLINE
4148*545df815SVictor Perevertkin WDFFILEOBJECT
414940462c92SVictor Perevertkin WdfDeviceGetFileObject(
415040462c92SVictor Perevertkin _In_
415140462c92SVictor Perevertkin WDFDEVICE Device,
415240462c92SVictor Perevertkin _In_
415340462c92SVictor Perevertkin PFILE_OBJECT FileObject
415440462c92SVictor Perevertkin )
415540462c92SVictor Perevertkin {
415640462c92SVictor Perevertkin return ((PFN_WDFDEVICEGETFILEOBJECT) WdfFunctions[WdfDeviceGetFileObjectTableIndex])(WdfDriverGlobals, Device, FileObject);
415740462c92SVictor Perevertkin }
415840462c92SVictor Perevertkin
415940462c92SVictor Perevertkin //
416040462c92SVictor Perevertkin // WDF Function: WdfDeviceEnqueueRequest
416140462c92SVictor Perevertkin //
416240462c92SVictor Perevertkin typedef
416340462c92SVictor Perevertkin _Must_inspect_result_
416440462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
416540462c92SVictor Perevertkin WDFAPI
416640462c92SVictor Perevertkin NTSTATUS
4167*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEENQUEUEREQUEST)(
416840462c92SVictor Perevertkin _In_
416940462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
417040462c92SVictor Perevertkin _In_
417140462c92SVictor Perevertkin WDFDEVICE Device,
417240462c92SVictor Perevertkin _In_
417340462c92SVictor Perevertkin WDFREQUEST Request
417440462c92SVictor Perevertkin );
417540462c92SVictor Perevertkin
417640462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(DISPATCH_LEVEL)417740462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
417840462c92SVictor Perevertkin FORCEINLINE
4179*545df815SVictor Perevertkin NTSTATUS
418040462c92SVictor Perevertkin WdfDeviceEnqueueRequest(
418140462c92SVictor Perevertkin _In_
418240462c92SVictor Perevertkin WDFDEVICE Device,
418340462c92SVictor Perevertkin _In_
418440462c92SVictor Perevertkin WDFREQUEST Request
418540462c92SVictor Perevertkin )
418640462c92SVictor Perevertkin {
418740462c92SVictor Perevertkin return ((PFN_WDFDEVICEENQUEUEREQUEST) WdfFunctions[WdfDeviceEnqueueRequestTableIndex])(WdfDriverGlobals, Device, Request);
418840462c92SVictor Perevertkin }
418940462c92SVictor Perevertkin
419040462c92SVictor Perevertkin //
419140462c92SVictor Perevertkin // WDF Function: WdfDeviceGetDefaultQueue
419240462c92SVictor Perevertkin //
419340462c92SVictor Perevertkin typedef
419440462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
419540462c92SVictor Perevertkin WDFAPI
419640462c92SVictor Perevertkin WDFQUEUE
4197*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEGETDEFAULTQUEUE)(
419840462c92SVictor Perevertkin _In_
419940462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
420040462c92SVictor Perevertkin _In_
420140462c92SVictor Perevertkin WDFDEVICE Device
420240462c92SVictor Perevertkin );
420340462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)420440462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
420540462c92SVictor Perevertkin FORCEINLINE
4206*545df815SVictor Perevertkin WDFQUEUE
420740462c92SVictor Perevertkin WdfDeviceGetDefaultQueue(
420840462c92SVictor Perevertkin _In_
420940462c92SVictor Perevertkin WDFDEVICE Device
421040462c92SVictor Perevertkin )
421140462c92SVictor Perevertkin {
421240462c92SVictor Perevertkin return ((PFN_WDFDEVICEGETDEFAULTQUEUE) WdfFunctions[WdfDeviceGetDefaultQueueTableIndex])(WdfDriverGlobals, Device);
421340462c92SVictor Perevertkin }
421440462c92SVictor Perevertkin
421540462c92SVictor Perevertkin //
421640462c92SVictor Perevertkin // WDF Function: WdfDeviceConfigureRequestDispatching
421740462c92SVictor Perevertkin //
421840462c92SVictor Perevertkin typedef
421940462c92SVictor Perevertkin _Must_inspect_result_
422040462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
422140462c92SVictor Perevertkin WDFAPI
422240462c92SVictor Perevertkin NTSTATUS
4223*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICECONFIGUREREQUESTDISPATCHING)(
422440462c92SVictor Perevertkin _In_
422540462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
422640462c92SVictor Perevertkin _In_
422740462c92SVictor Perevertkin WDFDEVICE Device,
422840462c92SVictor Perevertkin _In_
422940462c92SVictor Perevertkin WDFQUEUE Queue,
423040462c92SVictor Perevertkin _In_
423140462c92SVictor Perevertkin _Strict_type_match_
423240462c92SVictor Perevertkin WDF_REQUEST_TYPE RequestType
423340462c92SVictor Perevertkin );
423440462c92SVictor Perevertkin
423540462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(DISPATCH_LEVEL)423640462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
423740462c92SVictor Perevertkin FORCEINLINE
4238*545df815SVictor Perevertkin NTSTATUS
423940462c92SVictor Perevertkin WdfDeviceConfigureRequestDispatching(
424040462c92SVictor Perevertkin _In_
424140462c92SVictor Perevertkin WDFDEVICE Device,
424240462c92SVictor Perevertkin _In_
424340462c92SVictor Perevertkin WDFQUEUE Queue,
424440462c92SVictor Perevertkin _In_
424540462c92SVictor Perevertkin _Strict_type_match_
424640462c92SVictor Perevertkin WDF_REQUEST_TYPE RequestType
424740462c92SVictor Perevertkin )
424840462c92SVictor Perevertkin {
424940462c92SVictor Perevertkin return ((PFN_WDFDEVICECONFIGUREREQUESTDISPATCHING) WdfFunctions[WdfDeviceConfigureRequestDispatchingTableIndex])(WdfDriverGlobals, Device, Queue, RequestType);
425040462c92SVictor Perevertkin }
425140462c92SVictor Perevertkin
425240462c92SVictor Perevertkin //
425340462c92SVictor Perevertkin // WDF Function: WdfDeviceConfigureWdmIrpDispatchCallback
425440462c92SVictor Perevertkin //
425540462c92SVictor Perevertkin typedef
425640462c92SVictor Perevertkin _Must_inspect_result_
425740462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
425840462c92SVictor Perevertkin WDFAPI
425940462c92SVictor Perevertkin NTSTATUS
4260*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICECONFIGUREWDMIRPDISPATCHCALLBACK)(
426140462c92SVictor Perevertkin _In_
426240462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
426340462c92SVictor Perevertkin _In_
426440462c92SVictor Perevertkin WDFDEVICE Device,
426540462c92SVictor Perevertkin _In_opt_
426640462c92SVictor Perevertkin WDFDRIVER Driver,
426740462c92SVictor Perevertkin _In_
426840462c92SVictor Perevertkin UCHAR MajorFunction,
426940462c92SVictor Perevertkin _In_
427040462c92SVictor Perevertkin PFN_WDFDEVICE_WDM_IRP_DISPATCH EvtDeviceWdmIrpDisptach,
427140462c92SVictor Perevertkin _In_opt_
427240462c92SVictor Perevertkin WDFCONTEXT DriverContext
427340462c92SVictor Perevertkin );
427440462c92SVictor Perevertkin
427540462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(DISPATCH_LEVEL)427640462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
427740462c92SVictor Perevertkin FORCEINLINE
4278*545df815SVictor Perevertkin NTSTATUS
427940462c92SVictor Perevertkin WdfDeviceConfigureWdmIrpDispatchCallback(
428040462c92SVictor Perevertkin _In_
428140462c92SVictor Perevertkin WDFDEVICE Device,
428240462c92SVictor Perevertkin _In_opt_
428340462c92SVictor Perevertkin WDFDRIVER Driver,
428440462c92SVictor Perevertkin _In_
428540462c92SVictor Perevertkin UCHAR MajorFunction,
428640462c92SVictor Perevertkin _In_
428740462c92SVictor Perevertkin PFN_WDFDEVICE_WDM_IRP_DISPATCH EvtDeviceWdmIrpDisptach,
428840462c92SVictor Perevertkin _In_opt_
428940462c92SVictor Perevertkin WDFCONTEXT DriverContext
429040462c92SVictor Perevertkin )
429140462c92SVictor Perevertkin {
429240462c92SVictor Perevertkin return ((PFN_WDFDEVICECONFIGUREWDMIRPDISPATCHCALLBACK) WdfFunctions[WdfDeviceConfigureWdmIrpDispatchCallbackTableIndex])(WdfDriverGlobals, Device, Driver, MajorFunction, EvtDeviceWdmIrpDisptach, DriverContext);
429340462c92SVictor Perevertkin }
429440462c92SVictor Perevertkin
429540462c92SVictor Perevertkin //
429640462c92SVictor Perevertkin // WDF Function: WdfDeviceGetSystemPowerAction
429740462c92SVictor Perevertkin //
429840462c92SVictor Perevertkin typedef
429940462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
430040462c92SVictor Perevertkin WDFAPI
430140462c92SVictor Perevertkin POWER_ACTION
4302*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEGETSYSTEMPOWERACTION)(
430340462c92SVictor Perevertkin _In_
430440462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
430540462c92SVictor Perevertkin _In_
430640462c92SVictor Perevertkin WDFDEVICE Device
430740462c92SVictor Perevertkin );
430840462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)430940462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
431040462c92SVictor Perevertkin FORCEINLINE
4311*545df815SVictor Perevertkin POWER_ACTION
431240462c92SVictor Perevertkin WdfDeviceGetSystemPowerAction(
431340462c92SVictor Perevertkin _In_
431440462c92SVictor Perevertkin WDFDEVICE Device
431540462c92SVictor Perevertkin )
431640462c92SVictor Perevertkin {
431740462c92SVictor Perevertkin return ((PFN_WDFDEVICEGETSYSTEMPOWERACTION) WdfFunctions[WdfDeviceGetSystemPowerActionTableIndex])(WdfDriverGlobals, Device);
431840462c92SVictor Perevertkin }
431940462c92SVictor Perevertkin
432040462c92SVictor Perevertkin //
432140462c92SVictor Perevertkin // WDF Function: WdfDeviceWdmAssignPowerFrameworkSettings
432240462c92SVictor Perevertkin //
432340462c92SVictor Perevertkin typedef
432440462c92SVictor Perevertkin _Must_inspect_result_
432540462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
432640462c92SVictor Perevertkin WDFAPI
432740462c92SVictor Perevertkin NTSTATUS
4328*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEWDMASSIGNPOWERFRAMEWORKSETTINGS)(
432940462c92SVictor Perevertkin _In_
433040462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
433140462c92SVictor Perevertkin _In_
433240462c92SVictor Perevertkin WDFDEVICE Device,
433340462c92SVictor Perevertkin _In_
433440462c92SVictor Perevertkin PWDF_POWER_FRAMEWORK_SETTINGS PowerFrameworkSettings
433540462c92SVictor Perevertkin );
433640462c92SVictor Perevertkin
433740462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(PASSIVE_LEVEL)433840462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
433940462c92SVictor Perevertkin FORCEINLINE
4340*545df815SVictor Perevertkin NTSTATUS
434140462c92SVictor Perevertkin WdfDeviceWdmAssignPowerFrameworkSettings(
434240462c92SVictor Perevertkin _In_
434340462c92SVictor Perevertkin WDFDEVICE Device,
434440462c92SVictor Perevertkin _In_
434540462c92SVictor Perevertkin PWDF_POWER_FRAMEWORK_SETTINGS PowerFrameworkSettings
434640462c92SVictor Perevertkin )
434740462c92SVictor Perevertkin {
434840462c92SVictor Perevertkin return ((PFN_WDFDEVICEWDMASSIGNPOWERFRAMEWORKSETTINGS) WdfFunctions[WdfDeviceWdmAssignPowerFrameworkSettingsTableIndex])(WdfDriverGlobals, Device, PowerFrameworkSettings);
434940462c92SVictor Perevertkin }
435040462c92SVictor Perevertkin
435140462c92SVictor Perevertkin //
435240462c92SVictor Perevertkin // WDF Function: WdfDeviceInitSetReleaseHardwareOrderOnFailure
435340462c92SVictor Perevertkin //
435440462c92SVictor Perevertkin typedef
435540462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
435640462c92SVictor Perevertkin WDFAPI
435740462c92SVictor Perevertkin VOID
4358*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEINITSETRELEASEHARDWAREORDERONFAILURE)(
435940462c92SVictor Perevertkin _In_
436040462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
436140462c92SVictor Perevertkin _In_
436240462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
436340462c92SVictor Perevertkin _In_
436440462c92SVictor Perevertkin WDF_RELEASE_HARDWARE_ORDER_ON_FAILURE ReleaseHardwareOrderOnFailure
436540462c92SVictor Perevertkin );
436640462c92SVictor Perevertkin
_IRQL_requires_max_(DISPATCH_LEVEL)436740462c92SVictor Perevertkin _IRQL_requires_max_(DISPATCH_LEVEL)
436840462c92SVictor Perevertkin FORCEINLINE
4369*545df815SVictor Perevertkin VOID
437040462c92SVictor Perevertkin WdfDeviceInitSetReleaseHardwareOrderOnFailure(
437140462c92SVictor Perevertkin _In_
437240462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
437340462c92SVictor Perevertkin _In_
437440462c92SVictor Perevertkin WDF_RELEASE_HARDWARE_ORDER_ON_FAILURE ReleaseHardwareOrderOnFailure
437540462c92SVictor Perevertkin )
437640462c92SVictor Perevertkin {
437740462c92SVictor Perevertkin ((PFN_WDFDEVICEINITSETRELEASEHARDWAREORDERONFAILURE) WdfFunctions[WdfDeviceInitSetReleaseHardwareOrderOnFailureTableIndex])(WdfDriverGlobals, DeviceInit, ReleaseHardwareOrderOnFailure);
437840462c92SVictor Perevertkin }
437940462c92SVictor Perevertkin
438040462c92SVictor Perevertkin //
438140462c92SVictor Perevertkin // WDF Function: WdfDeviceInitSetIoTypeEx
438240462c92SVictor Perevertkin //
438340462c92SVictor Perevertkin typedef
438440462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
438540462c92SVictor Perevertkin WDFAPI
438640462c92SVictor Perevertkin VOID
4387*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEINITSETIOTYPEEX)(
438840462c92SVictor Perevertkin _In_
438940462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
439040462c92SVictor Perevertkin _In_
439140462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
439240462c92SVictor Perevertkin _In_
439340462c92SVictor Perevertkin PWDF_IO_TYPE_CONFIG IoTypeConfig
439440462c92SVictor Perevertkin );
439540462c92SVictor Perevertkin
_IRQL_requires_max_(PASSIVE_LEVEL)439640462c92SVictor Perevertkin _IRQL_requires_max_(PASSIVE_LEVEL)
439740462c92SVictor Perevertkin FORCEINLINE
4398*545df815SVictor Perevertkin VOID
439940462c92SVictor Perevertkin WdfDeviceInitSetIoTypeEx(
440040462c92SVictor Perevertkin _In_
440140462c92SVictor Perevertkin PWDFDEVICE_INIT DeviceInit,
440240462c92SVictor Perevertkin _In_
440340462c92SVictor Perevertkin PWDF_IO_TYPE_CONFIG IoTypeConfig
440440462c92SVictor Perevertkin )
440540462c92SVictor Perevertkin {
440640462c92SVictor Perevertkin ((PFN_WDFDEVICEINITSETIOTYPEEX) WdfFunctions[WdfDeviceInitSetIoTypeExTableIndex])(WdfDriverGlobals, DeviceInit, IoTypeConfig);
440740462c92SVictor Perevertkin }
440840462c92SVictor Perevertkin
440940462c92SVictor Perevertkin
441040462c92SVictor Perevertkin
441140462c92SVictor Perevertkin
441240462c92SVictor Perevertkin
441340462c92SVictor Perevertkin
441440462c92SVictor Perevertkin
441540462c92SVictor Perevertkin
441640462c92SVictor Perevertkin
441740462c92SVictor Perevertkin
441840462c92SVictor Perevertkin
441940462c92SVictor Perevertkin //
442040462c92SVictor Perevertkin // WDF Function: WdfDeviceQueryPropertyEx
442140462c92SVictor Perevertkin //
442240462c92SVictor Perevertkin typedef
442340462c92SVictor Perevertkin _Must_inspect_result_
442440462c92SVictor Perevertkin _IRQL_requires_max_(APC_LEVEL)
442540462c92SVictor Perevertkin WDFAPI
442640462c92SVictor Perevertkin NTSTATUS
4427*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEQUERYPROPERTYEX)(
442840462c92SVictor Perevertkin _In_
442940462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
443040462c92SVictor Perevertkin _In_
443140462c92SVictor Perevertkin WDFDEVICE Device,
443240462c92SVictor Perevertkin _In_
443340462c92SVictor Perevertkin PWDF_DEVICE_PROPERTY_DATA DeviceProperty,
443440462c92SVictor Perevertkin _In_
443540462c92SVictor Perevertkin ULONG BufferLength,
443640462c92SVictor Perevertkin _Out_
443740462c92SVictor Perevertkin PVOID PropertyBuffer,
443840462c92SVictor Perevertkin _Out_
443940462c92SVictor Perevertkin PULONG RequiredSize,
444040462c92SVictor Perevertkin _Out_
444140462c92SVictor Perevertkin PDEVPROPTYPE Type
444240462c92SVictor Perevertkin );
444340462c92SVictor Perevertkin
444440462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(APC_LEVEL)444540462c92SVictor Perevertkin _IRQL_requires_max_(APC_LEVEL)
444640462c92SVictor Perevertkin FORCEINLINE
4447*545df815SVictor Perevertkin NTSTATUS
444840462c92SVictor Perevertkin WdfDeviceQueryPropertyEx(
444940462c92SVictor Perevertkin _In_
445040462c92SVictor Perevertkin WDFDEVICE Device,
445140462c92SVictor Perevertkin _In_
445240462c92SVictor Perevertkin PWDF_DEVICE_PROPERTY_DATA DeviceProperty,
445340462c92SVictor Perevertkin _In_
445440462c92SVictor Perevertkin ULONG BufferLength,
445540462c92SVictor Perevertkin _Out_
445640462c92SVictor Perevertkin PVOID PropertyBuffer,
445740462c92SVictor Perevertkin _Out_
445840462c92SVictor Perevertkin PULONG RequiredSize,
445940462c92SVictor Perevertkin _Out_
446040462c92SVictor Perevertkin PDEVPROPTYPE Type
446140462c92SVictor Perevertkin )
446240462c92SVictor Perevertkin {
446340462c92SVictor Perevertkin return ((PFN_WDFDEVICEQUERYPROPERTYEX) WdfFunctions[WdfDeviceQueryPropertyExTableIndex])(WdfDriverGlobals, Device, DeviceProperty, BufferLength, PropertyBuffer, RequiredSize, Type);
446440462c92SVictor Perevertkin }
446540462c92SVictor Perevertkin
446640462c92SVictor Perevertkin //
446740462c92SVictor Perevertkin // WDF Function: WdfDeviceAllocAndQueryPropertyEx
446840462c92SVictor Perevertkin //
446940462c92SVictor Perevertkin typedef
447040462c92SVictor Perevertkin _Must_inspect_result_
447140462c92SVictor Perevertkin _IRQL_requires_max_(APC_LEVEL)
447240462c92SVictor Perevertkin WDFAPI
447340462c92SVictor Perevertkin NTSTATUS
4474*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEALLOCANDQUERYPROPERTYEX)(
447540462c92SVictor Perevertkin _In_
447640462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
447740462c92SVictor Perevertkin _In_
447840462c92SVictor Perevertkin WDFDEVICE Device,
447940462c92SVictor Perevertkin _In_
448040462c92SVictor Perevertkin PWDF_DEVICE_PROPERTY_DATA DeviceProperty,
448140462c92SVictor Perevertkin _In_
448240462c92SVictor Perevertkin _Strict_type_match_
448340462c92SVictor Perevertkin POOL_TYPE PoolType,
448440462c92SVictor Perevertkin _In_opt_
448540462c92SVictor Perevertkin PWDF_OBJECT_ATTRIBUTES PropertyMemoryAttributes,
448640462c92SVictor Perevertkin _Out_
448740462c92SVictor Perevertkin WDFMEMORY* PropertyMemory,
448840462c92SVictor Perevertkin _Out_
448940462c92SVictor Perevertkin PDEVPROPTYPE Type
449040462c92SVictor Perevertkin );
449140462c92SVictor Perevertkin
449240462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(APC_LEVEL)449340462c92SVictor Perevertkin _IRQL_requires_max_(APC_LEVEL)
449440462c92SVictor Perevertkin FORCEINLINE
4495*545df815SVictor Perevertkin NTSTATUS
449640462c92SVictor Perevertkin WdfDeviceAllocAndQueryPropertyEx(
449740462c92SVictor Perevertkin _In_
449840462c92SVictor Perevertkin WDFDEVICE Device,
449940462c92SVictor Perevertkin _In_
450040462c92SVictor Perevertkin PWDF_DEVICE_PROPERTY_DATA DeviceProperty,
450140462c92SVictor Perevertkin _In_
450240462c92SVictor Perevertkin _Strict_type_match_
450340462c92SVictor Perevertkin POOL_TYPE PoolType,
450440462c92SVictor Perevertkin _In_opt_
450540462c92SVictor Perevertkin PWDF_OBJECT_ATTRIBUTES PropertyMemoryAttributes,
450640462c92SVictor Perevertkin _Out_
450740462c92SVictor Perevertkin WDFMEMORY* PropertyMemory,
450840462c92SVictor Perevertkin _Out_
450940462c92SVictor Perevertkin PDEVPROPTYPE Type
451040462c92SVictor Perevertkin )
451140462c92SVictor Perevertkin {
451240462c92SVictor Perevertkin return ((PFN_WDFDEVICEALLOCANDQUERYPROPERTYEX) WdfFunctions[WdfDeviceAllocAndQueryPropertyExTableIndex])(WdfDriverGlobals, Device, DeviceProperty, PoolType, PropertyMemoryAttributes, PropertyMemory, Type);
451340462c92SVictor Perevertkin }
451440462c92SVictor Perevertkin
451540462c92SVictor Perevertkin //
451640462c92SVictor Perevertkin // WDF Function: WdfDeviceAssignProperty
451740462c92SVictor Perevertkin //
451840462c92SVictor Perevertkin typedef
451940462c92SVictor Perevertkin _Must_inspect_result_
452040462c92SVictor Perevertkin _IRQL_requires_max_(APC_LEVEL)
452140462c92SVictor Perevertkin WDFAPI
452240462c92SVictor Perevertkin NTSTATUS
4523*545df815SVictor Perevertkin (STDCALL *PFN_WDFDEVICEASSIGNPROPERTY)(
452440462c92SVictor Perevertkin _In_
452540462c92SVictor Perevertkin PWDF_DRIVER_GLOBALS DriverGlobals,
452640462c92SVictor Perevertkin _In_
452740462c92SVictor Perevertkin WDFDEVICE Device,
452840462c92SVictor Perevertkin _In_
452940462c92SVictor Perevertkin PWDF_DEVICE_PROPERTY_DATA DeviceProperty,
453040462c92SVictor Perevertkin _In_
453140462c92SVictor Perevertkin DEVPROPTYPE Type,
453240462c92SVictor Perevertkin _In_
453340462c92SVictor Perevertkin ULONG Size,
453440462c92SVictor Perevertkin _In_opt_
453540462c92SVictor Perevertkin PVOID Data
453640462c92SVictor Perevertkin );
453740462c92SVictor Perevertkin
453840462c92SVictor Perevertkin _Must_inspect_result_
_IRQL_requires_max_(APC_LEVEL)453940462c92SVictor Perevertkin _IRQL_requires_max_(APC_LEVEL)
454040462c92SVictor Perevertkin FORCEINLINE
4541*545df815SVictor Perevertkin NTSTATUS
454240462c92SVictor Perevertkin WdfDeviceAssignProperty(
454340462c92SVictor Perevertkin _In_
454440462c92SVictor Perevertkin WDFDEVICE Device,
454540462c92SVictor Perevertkin _In_
454640462c92SVictor Perevertkin PWDF_DEVICE_PROPERTY_DATA DeviceProperty,
454740462c92SVictor Perevertkin _In_
454840462c92SVictor Perevertkin DEVPROPTYPE Type,
454940462c92SVictor Perevertkin _In_
455040462c92SVictor Perevertkin ULONG Size,
455140462c92SVictor Perevertkin _In_opt_
455240462c92SVictor Perevertkin PVOID Data
455340462c92SVictor Perevertkin )
455440462c92SVictor Perevertkin {
455540462c92SVictor Perevertkin return ((PFN_WDFDEVICEASSIGNPROPERTY) WdfFunctions[WdfDeviceAssignPropertyTableIndex])(WdfDriverGlobals, Device, DeviceProperty, Type, Size, Data);
455640462c92SVictor Perevertkin }
455740462c92SVictor Perevertkin
455840462c92SVictor Perevertkin
455940462c92SVictor Perevertkin
456040462c92SVictor Perevertkin #endif // (NTDDI_VERSION >= NTDDI_WIN2K)
456140462c92SVictor Perevertkin
456240462c92SVictor Perevertkin
456340462c92SVictor Perevertkin WDF_EXTERN_C_END
456440462c92SVictor Perevertkin
456540462c92SVictor Perevertkin #endif // _WDFDEVICE_H_
456640462c92SVictor Perevertkin
456740462c92SVictor Perevertkin
4568