1 /*++ 2 3 Copyright (c) Microsoft Corporation 4 5 ModuleName: 6 7 MxDrierObjet.h 8 9 Abstract: 10 11 Mode agnostic definition of Driver Object 12 13 See MxDriverObjectKm.h and MxDriverObjectUm.h/cpp for mode 14 specific implementations 15 16 --*/ 17 18 #pragma once 19 20 // 21 // Forward declare enum 22 // 23 enum FxDriverObjectUmFlags : USHORT; 24 25 class MxDriverObject 26 { 27 private: 28 // 29 // MdDeviceObject is typedef'ed to appropriate type for the mode 30 // in the mode specific file 31 // 32 MdDriverObject m_DriverObject; 33 34 public: 35 __inline 36 MxDriverObject( 37 __in MdDriverObject DriverObject 38 ) : 39 m_DriverObject(DriverObject) 40 { 41 } 42 43 __inline 44 MxDriverObject( 45 VOID 46 ) : 47 m_DriverObject(NULL) 48 { 49 } 50 51 __inline 52 MdDriverObject 53 GetObject( 54 VOID 55 ) 56 { 57 return m_DriverObject; 58 } 59 60 __inline 61 VOID 62 SetObject( 63 __in_opt MdDriverObject DriverObject 64 ) 65 { 66 m_DriverObject = DriverObject; 67 } 68 69 PDRIVER_ADD_DEVICE 70 GetDriverExtensionAddDevice( 71 VOID 72 ); 73 74 VOID 75 SetDriverExtensionAddDevice( 76 _In_ MdDriverAddDevice Value 77 ); 78 79 MdDriverUnload 80 GetDriverUnload( 81 VOID 82 ); 83 84 VOID 85 SetDriverUnload( 86 _In_ MdDriverUnload Value 87 ); 88 89 VOID 90 SetMajorFunction( 91 _In_ UCHAR i, 92 _In_ MdDriverDispatch Value 93 ); 94 95 VOID 96 SetDriverObjectFlag( 97 _In_ FxDriverObjectUmFlags Flag 98 ); 99 100 BOOLEAN 101 IsDriverObjectFlagSet( 102 _In_ FxDriverObjectUmFlags Flag 103 ); 104 105 106 }; 107 108