ReactOS 0.4.16-dev-197-g92996da
ifxhascallbacks.hpp
Go to the documentation of this file.
1
2/*++
3
4Copyright (c) Microsoft. All rights reserved.
5
6Module Name:
7
8 IFxHasCallbacks.hpp
9
10Abstract:
11
12 Interface that objects with device driver callbacks and
13 constraints implement
14
15Author:
16
17
18
19Environment:
20
21 Both kernel and user mode
22
23Revision History:
24
25--*/
26
27#ifndef __IFX_HASCALLBACKS_HPP
28#define __IFX_HASCALLBACKS_HPP
29
30//
31// Objects that have callbacks into the device driver
32// (implemented by deriving a delegate from FxCallback), may
33// have constraints specified by the device driver when the object
34// or driver was created.
35//
36// These constraints control synchronization, and execution (IRQL) level
37// on callbacks to the device driver.
38//
39// To provide synchronization an FxCallbackLock may be implemented, at
40// either DISPATCH (spinlock) or PASSIVE (mutex lock) level depending
41// on whether a passive level constraint is in effect.
42//
43// This interface allows the constraints, and any associated locks
44// to be retrieved in a generic fashion from the object, such as
45// for implementing the WdfObjectAcquireLock/WdfObjectReleaseLock APIs.
46//
47
49
50public:
51
52 //
53 // Returns the constraints in effect for the object.
54 //
55 virtual
56 VOID
58 __out WDF_EXECUTION_LEVEL* ExecutionLevel,
59 __out WDF_SYNCHRONIZATION_SCOPE* SynchronizationScope
60 ) = 0;
61
62 //
63 // This returns the callback lock in effect for the object that
64 // will serialize with its event callbacks to the device driver.
65 //
66 // If no callback locks are in effect, the return value is NULL.
67 //
68 // The type of FxCallbackLock returned may be a spinlock, or mutex
69 // type depending on whether the object has a passive level callback
70 // constraint in effect.
71 //
72 // In addition, optionally returns the object that contains the lock
73 // providing any serialization constraint. This allows reference counting
74 // the object who owns the lock, which may not be the target
75 // object. An example would be a child object sharing its parent
76 // FxDevice's synchronziation lock.
77 //
79 virtual
83 ) = 0;
84};
85
86#endif // __IFX_HASCALLBACKS_HPP
87
88
virtual _Must_inspect_result_ FxCallbackLock * GetCallbackLockPtr(__out_opt FxObject **LockObject)=0
virtual VOID GetConstraints(__out WDF_EXECUTION_LEVEL *ExecutionLevel, __out WDF_SYNCHRONIZATION_SCOPE *SynchronizationScope)=0
#define __out_opt
Definition: dbghelp.h:65
#define __out
Definition: dbghelp.h:62
#define _Must_inspect_result_
Definition: ms_sal.h:558
#define LockObject(Object)
Definition: titypes.h:34
WDF_EXTERN_C_START enum _WDF_EXECUTION_LEVEL WDF_EXECUTION_LEVEL
enum _WDF_SYNCHRONIZATION_SCOPE WDF_SYNCHRONIZATION_SCOPE