ReactOS 0.4.15-dev-7897-g78dc504
fxpnpstatemachine.hpp
Go to the documentation of this file.
1//
2// Copyright (C) Microsoft. All rights reserved.
3//
4#ifndef _FXPNPSTATEMACHINE_H_
5#define _FXPNPSTATEMACHINE_H_
6
7// @@SMVERIFY_SPLIT_BEGIN
8
9typedef
13 );
14
15//
16// Treat these values as a bit field when comparing for known dropped events in
17// the current state and treat them as values when they known transition events
18// from state to the next.
19//
21 PnpEventInvalid = 0x000000,
30 PnpEventStop = 0x000100,
31 PnpEventRemove = 0x000200,
33 PnpEventEject = 0x000800,
44
45 //
46 // Not a real event, just a value that shows all of the events which have
47 // queued the pnp irp. If we drop one of these events, we *must* complete
48 // the pended pnp irp. See PnpProcessEventInner.
49 //
58
59 //
60 // Not a real event, just a value that indicates all of the events which
61 // goto the head of the queue and are always processed, even if the state is
62 // locked.
63 //
70
71 PnpEventNull = 0xFFFFFFFF,
72};
73
74//
75// Bit packed ULONG.
76//
78 struct {
79 //
80 // Indicates whether the state is open to all events
81 //
83
84 //
85 // Bit of events we know we can drop in this state
86 //
89
90 struct {
91 //
92 // Maps to the same bit location as QueueOpen. Since we start
93 // KnownDroppedEvents at the next bit, start our bits by at the next
94 // bit as well.
95 //
97
98 //
99 // These are defined so that we can easily tell in the debugger what
100 // each set bit in KnownDroppedEvents maps to in the FxPnpEvent enum
101 //
123};
124
127
129
131};
132
134
136 //
137 // Framework internal function
138 //
140
142
144
146
147};
148
150
151#if FX_STATE_MACHINE_VERIFY
152#define MAX_PNP_STATE_ENTRY_FN_RETURN_STATES (5)
153
154struct PNP_STATE_ENTRY_FUNCTION_TARGET_STATE {
155 //
156 // Return value from state entry function
157 //
159
160 //
161 // type of device the returning state applies to
162 //
163 FxStateMachineDeviceType DeviceType;
164
165 //
166 // Info about the state transition
167 //
169};
170
171typedef const PNP_STATE_ENTRY_FUNCTION_TARGET_STATE* CPPNP_STATE_ENTRY_FUNCTION_TARGET_STATE;
172
173struct PNP_STATE_ENTRY_FN_RETURN_STATE_TABLE {
174 //
175 // array of state transitions caused by state entry function
176 //
177 PNP_STATE_ENTRY_FUNCTION_TARGET_STATE TargetStates[MAX_PNP_STATE_ENTRY_FN_RETURN_STATES];
178};
179
180typedef const PNP_STATE_ENTRY_FN_RETURN_STATE_TABLE* CPPNP_STATE_ENTRY_FN_RETURN_STATE_TABLE;
181#endif //FX_STATE_MACHINE_VERIFY
182
183// @@SMVERIFY_SPLIT_END
184
185//
186// This type of union is done so that we can
187// 1) shrink the array element to the smallest size possible
188// 2) keep types within the structure so we can dump it in the debugger
189//
191 struct {
200 } S;
201
203};
204
205
208 VOID
210 {
211 RtlZeroMemory(&m_Queue[0], sizeof(m_Queue));
213
216 }
217
219
221
223};
224
225#endif // _FXPNPSTATEMACHINE_H_
unsigned char BOOLEAN
@ Comment
Definition: asmpp.cpp:34
#define FALSE
Definition: types.h:117
#define EVENT_TRAP_FIELD
Definition: fxpkgpnp.hpp:64
const UCHAR PnpEventQueueDepth
Definition: fxpkgpnp.hpp:33
WDF_DEVICE_PNP_STATE(* PFN_PNP_STATE_ENTRY_FUNCTION)(FxPkgPnp *This)
const PNP_STATE_TABLE * CPPNP_STATE_TABLE
const PNP_EVENT_TARGET_STATE * CPPNP_EVENT_TARGET_STATE
@ PnpEventEject
@ PnpEventNull
@ PnpEventRemove
@ PnpEventInvalid
@ PnpEventPowerUpFailed
@ PnpEventPending
@ PnpEventSurpriseRemove
@ PnpEventStartDeviceComplete
@ PnpEventPwrPolStopFailed
@ PnpEventPwrPolStarted
@ PnpEventStop
@ PnpEventPwrPolRemoved
@ PnpEventPwrPolStartFailed
@ PnpEventQueryRemove
@ PnpEventStartDevice
@ PnpEventCancelStop
@ PnpEventStartDeviceFailed
@ PnpEventQueryStop
@ PnpEventPowerDownFailed
@ PnpEventCancelRemove
@ PnpEventParentRemoved
@ PnpEventPwrPolStopped
@ PnpEventAddDevice
@ PnpPriorityEventsMask
@ PnpEventDeviceInD0
@ PnpEventChildrenRemovalComplete
DeviceType
Definition: mmdrv.h:42
unsigned short USHORT
Definition: pedump.c:61
UCHAR IncrementHistoryIndex(VOID)
FxPnpMachineStateHistory m_States
FxPnpEvent m_Queue[PnpEventQueueDepth]
WDF_DEVICE_PNP_STATE TargetState
PNP_EVENT_TARGET_STATE FirstTargetState
FxPnpStateInfo StateInfo
PFN_PNP_STATE_ENTRY_FUNCTION StateFunc
CPPNP_EVENT_TARGET_STATE OtherTargetStates
char * PSTR
Definition: typedefs.h:51
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint32_t ULONG
Definition: typedefs.h:59
WDF_DEVICE_PNP_STATE State4
WDF_DEVICE_PNP_STATE State1
USHORT History[PnpEventQueueDepth]
WDF_DEVICE_PNP_STATE State3
WDF_DEVICE_PNP_STATE State5
WDF_DEVICE_PNP_STATE State8
struct FxPnpMachineStateHistory::@4777 S
WDF_DEVICE_PNP_STATE State2
WDF_DEVICE_PNP_STATE State6
WDF_DEVICE_PNP_STATE State7
ULONG PnpEventStartDeviceFailedKnown
struct FxPnpStateInfo::@4775 Bits
ULONG PnpEventChildrenRemovalCompleteKnown
ULONG PnpEventStartDeviceCompleteKnown
ULONG PnpEventPowerDownFailedKnown
struct FxPnpStateInfo::@4776 BitsByName
@ WdfDevStatePnpObjectCreated
Definition: wdfdevice.h:64
enum _WDF_DEVICE_PNP_STATE WDF_DEVICE_PNP_STATE