1 /*++ 2 3 Copyright (c) Microsoft Corporation 4 5 ModuleName: 6 7 MxDeviceObject.h 8 9 Abstract: 10 11 Mode agnostic definition of Device Object 12 13 See MxDeviceObjectKm.h and MxDeviceObjectUm.h/cpp for mode 14 specific implementations 15 16 --*/ 17 18 #pragma once 19 20 class MxDeviceObject 21 { 22 private: 23 // 24 // MdDeviceObject is typedef'ed to appropriate type for the mode 25 // in the mode specific file 26 // 27 MdDeviceObject m_DeviceObject; 28 29 public: 30 __inline 31 MxDeviceObject( 32 __in MdDeviceObject DeviceObject 33 ) : 34 m_DeviceObject(DeviceObject) 35 { 36 } 37 38 __inline 39 MxDeviceObject( 40 VOID 41 ) : 42 m_DeviceObject(NULL) 43 { 44 } 45 46 __inline 47 MdDeviceObject 48 GetObject( 49 VOID 50 ) 51 { 52 return m_DeviceObject; 53 } 54 55 __inline 56 VOID 57 SetObject( 58 __in_opt MdDeviceObject DeviceObject 59 ) 60 { 61 m_DeviceObject = DeviceObject; 62 } 63 64 CCHAR 65 GetStackSize( 66 VOID 67 ); 68 69 VOID 70 SetStackSize( 71 _In_ CCHAR Size 72 ); 73 74 VOID 75 ReferenceObject( 76 ); 77 78 MdDeviceObject 79 GetAttachedDeviceReference( 80 VOID 81 ); 82 83 VOID 84 DereferenceObject( 85 ); 86 87 ULONG 88 GetFlags( 89 VOID 90 ); 91 92 VOID 93 SetFlags( 94 ULONG Flags 95 ); 96 97 POWER_STATE 98 SetPowerState( 99 __in POWER_STATE_TYPE Type, 100 __in POWER_STATE State 101 ); 102 103 VOID 104 InvalidateDeviceRelations( 105 __in DEVICE_RELATION_TYPE Type 106 ); 107 108 VOID 109 InvalidateDeviceState( 110 __in MdDeviceObject Fdo //used in UMDF 111 ); 112 113 PVOID 114 GetDeviceExtension( 115 VOID 116 ); 117 118 VOID 119 SetDeviceExtension( 120 PVOID Value 121 ); 122 123 DEVICE_TYPE 124 GetDeviceType( 125 VOID 126 ); 127 128 ULONG 129 GetCharacteristics( 130 VOID 131 ); 132 133 VOID 134 SetDeviceType( 135 DEVICE_TYPE Value 136 ); 137 138 VOID 139 SetCharacteristics( 140 ULONG Characteristics 141 ); 142 143 VOID 144 SetAlignmentRequirement( 145 _In_ ULONG Value 146 ); 147 148 ULONG 149 GetAlignmentRequirement( 150 VOID 151 ); 152 }; 153