ReactOS  0.4.15-dev-2991-g632fa1c
FxDriver Class Reference

#include <fxdriver.hpp>

Inheritance diagram for FxDriver:
Collaboration diagram for FxDriver:

Public Member Functions

 FxDriver (__in MdDriverObject DriverObject, __in PWDF_DRIVER_CONFIG DriverConfig, __in PFX_DRIVER_GLOBALS FxDriverGlobals)
 
 ~FxDriver ()
 
_Must_inspect_result_ NTSTATUS AllocateDriverObjectExtensionAndStoreFxDriver (VOID)
 
__inline WDFDRIVER GetHandle (VOID)
 
_Must_inspect_result_ NTSTATUS AddDevice (__in MdDeviceObject PhysicalDeviceObject)
 
VOID InitializeInternal (VOID)
 
_Must_inspect_result_ FxStringGetRegistryPath (VOID)
 
PUNICODE_STRING GetRegistryPathUnicodeString (VOID)
 
__inline MdDriverObject GetDriverObject (VOID)
 
_Must_inspect_result_ NTSTATUS Initialize (__in PCUNICODE_STRING RegistryPath, __in PWDF_DRIVER_CONFIG Config, __in_opt PWDF_OBJECT_ATTRIBUTES DriverAttributes)
 
VOID ConfigureConstraints (__in_opt PWDF_OBJECT_ATTRIBUTES DriverAttributes)
 
virtual VOID GetConstraints (__out WDF_EXECUTION_LEVEL *ExecutionLevel, __out WDF_SYNCHRONIZATION_SCOPE *SynchronizationScope)
 
virtual FxCallbackLockGetCallbackLockPtr (__deref_out FxObject **LockObject)
 
virtual NTSTATUS QueryInterface (__inout FxQueryInterfaceParams *Params)
 
virtual VOID DeleteObject (VOID)
 
virtual BOOLEAN Dispose (VOID)
 
__inline FxDisposeListGetDisposeList ()
 
__inline PFN_WDF_DRIVER_DEVICE_ADD GetDriverDeviceAddMethod ()
 
VOID SetDriverObjectFlag (_In_ FxDriverObjectUmFlags Flag)
 
BOOLEAN IsDriverObjectFlagSet (_In_ FxDriverObjectUmFlags Flag)
 
- Public Member Functions inherited from FxNonPagedObject
 FxNonPagedObject (__in WDFTYPE Type, __in USHORT Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals)
 
 FxNonPagedObject (__in WDFTYPE Type, __in USHORT Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxObjectType ObjectType)
 
virtual ~FxNonPagedObject (VOID)
 
 _Acquires_lock_ (this->m_NPLock.m_Lock) __drv_maxIRQL(DISPATCH_LEVEL) __drv_setsIRQL(DISPATCH_LEVEL) VOID Lock(__out __drv_deref(__drv_savesIRQL) PKIRQL PreviousIrql)
 
 _Releases_lock_ (this->m_NPLock.m_Lock) __drv_requiresIRQL(DISPATCH_LEVEL) __inline VOID Unlock(__in __drv_restoresIRQL KIRQL PreviousIrql)
 
 _Acquires_lock_ (this->m_NPLock.m_Lock) __drv_requiresIRQL(DISPATCH_LEVEL) VOID LockAtDispatch(VOID)
 
 _Requires_lock_held_ (this->m_NPLock.m_Lock) _Releases_lock_(this -> m_NPLock.m_Lock) __drv_requiresIRQL(DISPATCH_LEVEL) __inline VOID UnlockFromDispatch(VOID)
 
- Public Member Functions inherited from FxObject
PVOID GetCOMWrapper ()
 
void SetCOMWrapper (__drv_aliasesMem PVOID Wrapper)
 
 FxObject (__in WDFTYPE Type, __in USHORT Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals)
 
virtual ~FxObject (VOID)
 
PVOID __inline operator new (__in size_t Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxObjectType Type)
 
PVOID __inline operator new (__in size_t Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals, __in_opt PWDF_OBJECT_ATTRIBUTES Attributes, __in USHORT ExtraSize=0)
 
VOID operator delete (__in PVOID Memory)
 
VOID SetNoContextHeader (VOID)
 
PVOID __inline GetObjectHandle (VOID)
 
__inline FxContextHeaderGetContextHeader (VOID)
 
__inline PFX_DRIVER_GLOBALS GetDriverGlobals (VOID)
 
WDFTYPE GetType (VOID)
 
USHORT GetObjectSize (VOID)
 
LONG GetRefCnt (VOID)
 
FxTagTrackerGetTagTracker (VOID)
 
CfxDeviceGetDevice (VOID)
 
CfxDeviceBaseGetDeviceBase (VOID)
 
VOID SetDeviceBase (__in CfxDeviceBase *DeviceBase)
 
__inline VOID CallCleanup (VOID)
 
ULONG __inline AddRef (__in_opt PVOID Tag=NULL, __in LONG Line=0, __in_opt PSTR File=NULL)
 
virtual ULONG Release (__in_opt PVOID Tag=NULL, __in LONG Line=0, __in_opt PSTR File=NULL)
 
virtual ULONG AddRefOverride (__in WDFOBJECT_OFFSET Offset, __in_opt PVOID Tag=NULL, __in LONG Line=0, __in_opt PSTR File=NULL)
 
virtual ULONG ReleaseOverride (__in WDFOBJECT_OFFSET Offset, __in_opt PVOID Tag=NULL, __in LONG Line=0, __in_opt PSTR File=NULL)
 
virtual _Must_inspect_result_ NTSTATUS QueryInterface (__in FxQueryInterfaceParams *Params)
 
VOID MarkTraceState (VOID)
 
BOOLEAN __inline IsTraceState (VOID)
 
VOID __inline TraceDroppedEvent (__in FxObjectDroppedEvent Event)
 
VOID MarkPassiveDispose (__in FxObjectLockState State=ObjectLock)
 
VOID MarkPassiveCallbacks (__in FxObjectLockState State=ObjectLock)
 
VOID MarkForceDisposeThread (__in FxObjectLockState State=ObjectLock)
 
BOOLEAN IsPassiveCallbacks (__in BOOLEAN AcquireLock=TRUE)
 
BOOLEAN IsPassiveDispose (__in BOOLEAN AcquireLock=TRUE)
 
BOOLEAN IsForceDisposeThread (__in BOOLEAN AcquireLock=TRUE)
 
VOID MarkCommitted (VOID)
 
BOOLEAN IsCommitted (VOID)
 
VOID MarkDisposeOverride (__in FxObjectLockState State=ObjectLock)
 
VOID MarkNoDeleteDDI (__in FxObjectLockState State=ObjectLock)
 
BOOLEAN IsNoDeleteDDI (VOID)
 
_Must_inspect_result_ NTSTATUS Commit (__in_opt PWDF_OBJECT_ATTRIBUTES Attributes, __out_opt WDFOBJECT *ObjectHandle, __in_opt FxObject *Parent=NULL, __in BOOLEAN AssignDriverAsDefaultParent=TRUE)
 
VOID DeleteFromFailedCreate (VOID)
 
VOID ClearEvtCallbacks (VOID)
 
BOOLEAN EarlyDispose (VOID)
 
_Must_inspect_result_ NTSTATUS AssignParentObject (__in FxObject *ParentObject)
 
_Must_inspect_result_ NTSTATUS AddContext (__in FxContextHeader *Header, __in PVOID *Context, __in PWDF_OBJECT_ATTRIBUTES Attributes)
 
_Must_inspect_result_ NTSTATUS RemoveParentAssignment (VOID)
 
_Must_inspect_result_ FxObjectGetParentObjectReferenced (__in PVOID Tag)
 
BOOLEAN IsDisposed (VOID)
 
- Public Member Functions inherited from IFxHasCallbacks
virtual _Must_inspect_result_ FxCallbackLockGetCallbackLockPtr (__out_opt FxObject **LockObject)=0
 

Static Public Member Functions

static VOID _InitializeDriverName (__in PFX_DRIVER_GLOBALS Globals, __in PCUNICODE_STRING RegistryPath)
 
static VOID _InitializeTag (__in PFX_DRIVER_GLOBALS Globals, __in PWDF_DRIVER_CONFIG Config)
 
static FxDriverGetFxDriver (__in MdDriverObject DriverObject)
 
- Static Public Member Functions inherited from FxObject
static FxObject_FromDisposeEntry (__in PSINGLE_LIST_ENTRY Entry)
 
static FxObject_GetObjectFromHandle (__in WDFOBJECT Handle, __inout PWDFOBJECT_OFFSET ObjectOffset)
 
static PVOID __inline _ToHandle (__in FxObject *Object)
 
static VOID __inline _ReferenceActual (__in WDFOBJECT Object, __in_opt PVOID Tag, __in LONG Line, __in PSTR File)
 
static VOID __inline _DereferenceActual (__in WDFOBJECT Object, __in_opt PVOID Tag, __in LONG Line, __in PSTR File)
 
static PVOID _GetDebugBase (__in FxObject *Object)
 
static PFX_POOL_HEADER _CleanupPointer (__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxObject *Object)
 
static _Must_inspect_result_ NTSTATUS _GetEffectiveLock (__in FxObject *Object, __in_opt IFxHasCallbacks *Callbacks, __in BOOLEAN AutomaticLocking, __in BOOLEAN PassiveCallbacks, __out FxCallbackLock **CallbackLock, __out_opt FxObject **CallbackLockObject)
 
static _Must_inspect_result_ NTSTATUS _ObjectQuery (_In_ FxObject *Object, _In_ CONST GUID *Guid, _In_ ULONG QueryBufferLength, _Out_writes_bytes_(QueryBufferLength) PVOID QueryBuffer)
 

Public Attributes

FxDriverUnload m_DriverUnload
 

Static Public Attributes

static MdDriverUnloadType Unload
 

Private Attributes

MxDriverObject m_DriverObject
 
UNICODE_STRING m_RegistryPath
 
BOOLEAN m_DebuggerConnected
 
FxDriverDeviceAdd m_DriverDeviceAdd
 
WDF_EXECUTION_LEVEL m_ExecutionLevel
 
WDF_SYNCHRONIZATION_SCOPE m_SynchronizationScope
 
FxCallbackMutexLock m_CallbackMutexLock
 
FxCallbackLockm_CallbackLockPtr
 
FxObjectm_CallbackLockObjectPtr
 
WDF_DRIVER_CONFIG m_Config
 
FxDisposeListm_DisposeList
 

Static Private Attributes

static MdDriverAddDeviceType AddDevice
 

Friends

class FxDevice
 
class FxPackage
 
class FxWmiIrpHandler
 

Additional Inherited Members

- Protected Member Functions inherited from FxObject
 FxObject (__in WDFTYPE Type, __in USHORT Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxObjectType ObjectType)
 
FxObjectDebugExtensionGetDebugExtension (VOID)
 
BOOLEAN IsDebug (VOID)
 
VOID AllocateTagTracker (__in WDFTYPE Type)
 
virtual VOID SelfDestruct (VOID)
 
PVOID __inline GetObjectHandleUnchecked (VOID)
 
VOID __inline DestroyChildren (VOID)
 
VOID DeleteEarlyDisposedObject (VOID)
 
- Static Protected Member Functions inherited from FxObject
static PVOID _GetBase (__in FxObject *Object)
 
- Protected Attributes inherited from FxObject
union {
   CfxDeviceBase *   m_DeviceBase
 
   CfxDevice *   m_Device
 
}; 
 

Detailed Description

Definition at line 54 of file fxdriver.hpp.

Constructor & Destructor Documentation

◆ FxDriver()

FxDriver::FxDriver ( __in MdDriverObject  DriverObject,
__in PWDF_DRIVER_CONFIG  DriverConfig,
__in PFX_DRIVER_GLOBALS  FxDriverGlobals 
)

Definition at line 33 of file fxdriver.cpp.

37  :
38  FxNonPagedObject(FX_TYPE_DRIVER, sizeof(FxDriver), FxDriverGlobals),
39  m_DriverObject(ArgDriverObject),
40  m_CallbackMutexLock(FxDriverGlobals)
41 {
43 
44 
45 
46 
47 
48 
49 #if (FX_CORE_MODE == FX_CORE_KERNEL_MODE)
51 #else
53 #endif
54 
56 
59 
61 
62  //
63  // These are initialized up front so that sub objects
64  // can have the right configuration
65  //
67 
68  // Only copy the smallest of what is specified and our size
70 
72 
73 #if FX_IS_USER_MODE
74  m_DriverParametersKey = NULL;
75 #endif
76 }
FxNonPagedObject(__in WDFTYPE Type, __in USHORT Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals)
FxCallbackMutexLock m_CallbackMutexLock
Definition: fxdriver.hpp:93
FxDisposeList * m_DisposeList
Definition: fxdriver.hpp:111
#define FALSE
Definition: types.h:117
FORCEINLINE VOID WDF_DRIVER_CONFIG_INIT(_Out_ PWDF_DRIVER_CONFIG Config, _In_opt_ PFN_WDF_DRIVER_DEVICE_ADD EvtDriverDeviceAdd)
Definition: wdfdriver.h:148
FxObject * m_CallbackLockObjectPtr
Definition: fxdriver.hpp:101
FxCallbackLock * m_CallbackLockPtr
Definition: fxdriver.hpp:100
WDF_DRIVER_CONFIG m_Config
Definition: fxdriver.hpp:106
WDF_EXECUTION_LEVEL m_ExecutionLevel
Definition: fxdriver.hpp:77
WDF_SYNCHRONIZATION_SCOPE m_SynchronizationScope
Definition: fxdriver.hpp:78
UNICODE_STRING m_RegistryPath
Definition: fxdriver.hpp:63
#define min(a, b)
Definition: monoChain.cc:55
#define NULL
Definition: types.h:112
BOOLEAN m_DebuggerConnected
Definition: fxdriver.hpp:65
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
MxDriverObject m_DriverObject
Definition: fxdriver.hpp:62
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ PWDF_DRIVER_CONFIG DriverConfig
Definition: wdfdriver.h:213

◆ ~FxDriver()

FxDriver::~FxDriver ( )

Definition at line 78 of file fxdriver.cpp.

79 {
80  // Make it always present right now even on free builds
81  if (IsDisposed() == FALSE) {
84  "FxDriver 0x%p not disposed: this maybe a driver reference count "
85  "problem with WDFDRIVER 0x%p", this, GetObjectHandleUnchecked());
86 
90  (ULONG_PTR) this);
91  }
92 
93  //
94  // Free the memory for the registry path if required.
95  //
96  if (m_RegistryPath.Buffer) {
98  }
99 
100  if (m_DisposeList != NULL) {
102  }
103 
104 #if FX_IS_USER_MODE
105  //
106  // Close the R/W handle to the driver's service parameters key
107  // that we opened during Initialize.
108  //
109  if (m_DriverParametersKey != NULL) {
110  NTSTATUS status = FxRegKey::_Close(m_DriverParametersKey);
111  if (!NT_SUCCESS(status)) {
113  "Cannot close Driver Parameters key %!STATUS!",
114  status);
115  }
116  m_DriverParametersKey = NULL;
117  }
118 
119  //
120  // The host-created driver object holds a reference to this
121  // FxDriver object. Clear it, since this object was deleted.
122  //
123  ClearDriverObjectFxDriver();
124 #endif
125 }
virtual VOID DeleteObject(VOID)
FxDisposeList * m_DisposeList
Definition: fxdriver.hpp:111
LONG NTSTATUS
Definition: precomp.h:26
#define TRACINGDRIVER
Definition: dbgtrace.h:68
#define FxVerifierBugCheck(FxDriverGlobals, Error,...)
Definition: fxverifier.h:58
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define FALSE
Definition: types.h:117
#define TRACE_LEVEL_FATAL
Definition: storswtr.h:26
BOOLEAN IsDisposed(VOID)
Definition: fxobject.hpp:1241
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
PVOID __inline GetObjectHandleUnchecked(VOID)
Definition: fxobject.hpp:446
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
UNICODE_STRING m_RegistryPath
Definition: fxdriver.hpp:63
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
#define NULL
Definition: types.h:112
void FxPoolFree(__in_xcount(ptr is at an offset from AllocationStart) PVOID ptr)
Definition: wdfpool.cpp:361
Definition: ps.c:97

Member Function Documentation

◆ _InitializeDriverName()

FxDriver::_InitializeDriverName ( __in PFX_DRIVER_GLOBALS  Globals,
__in PCUNICODE_STRING  RegistryPath 
)
static

Definition at line 180 of file fxdriver.cpp.

196 {
197  PWCHAR pCur, pBegin, pEnd;
198 
199  RtlZeroMemory(&FxDriverGlobals->Public.DriverName[0],
200  sizeof(FxDriverGlobals->Public.DriverName) );
201 
202  if (RegistryPath == NULL) {
203  return;
204  }
205 
206  pBegin = RegistryPath->Buffer;
207 
208  //
209  // pEnd is one past the end of the string, while pCur is a pointer to the
210  // last character of the string. We will decrement pCur down towards the
211  // beginning of the string.
212  //
213  pEnd = pBegin + (RegistryPath->Length / sizeof(WCHAR));
214  pCur = pEnd - 1;
215 
216  for ( ; *pCur != L'\\' && pCur != pBegin; pCur--) {
217  DO_NOTHING();
218  }
219 
220  if (pCur != pBegin && *pCur == L'\\') {
221  size_t regLen;
222  ULONG i;
223 
224  pCur++;
225 
226  //
227  // Can't use wcslen becuase this is a UNICODE_STRING which means that it
228  // does not necessarily have a terminating NULL in the buffer.
229  //
230  regLen = pEnd - pCur;
231  if (regLen > WDF_DRIVER_GLOBALS_NAME_LEN-1) {
232  regLen = WDF_DRIVER_GLOBALS_NAME_LEN-1;
233  }
234 
235 
236  for (i = 0; i < regLen; i++) {
237  FxDriverGlobals->Public.DriverName[i] = (CHAR) pCur[i];
238  }
239  }
240  else {
242 
243 #if FX_CORE_MODE==FX_CORE_KERNEL_MODE
244  status = RtlStringCbCopyA(FxDriverGlobals->Public.DriverName,
245  sizeof(FxDriverGlobals->Public.DriverName),
246  "WDF");
247 #else // USER_MODE
248  HRESULT hr;
249  hr = StringCbCopyA(FxDriverGlobals->Public.DriverName,
250  sizeof(FxDriverGlobals->Public.DriverName),
251  "WDF");
254  }
255  else {
257  }
258 #endif
259 
262  }
263 }
NTSTATUS WinErrorToNtStatus(__in ULONG WinError)
Definition: errtostatus.cpp:60
HRESULT hr
Definition: shlfolder.c:183
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
LONG NTSTATUS
Definition: precomp.h:26
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:213
uint16_t * PWCHAR
Definition: typedefs.h:56
NTSTRSAFEAPI RtlStringCbCopyA(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ NTSTRSAFE_PCSTR pszSrc)
Definition: ntstrsafe.h:156
#define HRESULT_FACILITY(hr)
Definition: winerror.h:79
if SUCCEEDED(hr)
STRSAFEAPI StringCbCopyA(STRSAFE_LPSTR pszDest, size_t cbDest, STRSAFE_LPCSTR pszSrc)
Definition: strsafe.h:161
#define ASSERT(a)
Definition: mode.c:44
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
LONG HRESULT
Definition: typedefs.h:79
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
static const WCHAR L[]
Definition: oid.c:1250
#define FACILITY_WIN32
Definition: winerror.h:27
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
SINGLE_LIST_ENTRY * pCur
#define NULL
Definition: types.h:112
#define HRESULT_CODE(hr)
Definition: winerror.h:76
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define STATUS_SUCCESS
Definition: shellext.h:65
#define CHAR(Char)
static SERVICE_STATUS status
Definition: service.c:31
#define WDF_DRIVER_GLOBALS_NAME_LEN
Definition: wdfglobals.h:51
#define DO_NOTHING()
Definition: mxgeneral.h:32
Definition: ps.c:97

◆ _InitializeTag()

VOID FxDriver::_InitializeTag ( __in PFX_DRIVER_GLOBALS  Globals,
__in PWDF_DRIVER_CONFIG  Config 
)
static

Definition at line 266 of file fxdriver.cpp.

285 {
286  PCHAR pBegin;
287  size_t length;
288 
290 
291  length = strlen(FxDriverGlobals->Public.DriverName);
292  pBegin = &FxDriverGlobals->Public.DriverName[0];
293 
294  if (length >= 3) {
295  //
296  // If the driver name begins with "WDF" (case insensitive), start after
297  // "WDF"
298  //
299  if ((pBegin[0] == 'w' || pBegin[0] == 'W') &&
300  (pBegin[1] == 'd' || pBegin[1] == 'D') &&
301  (pBegin[2] == 'f' || pBegin[2] == 'F')) {
302  length -=3;
303  pBegin += 3;
304  }
305  }
306 
307  if (length <= 2) {
308  //
309  // 2 or less characters is not a unique enough tag, just use the default
310  // tag.
311  //
312  FxDriverGlobals->Tag = FX_TAG;
313  }
314  else {
315 
316  if (length > sizeof(ULONG)) {
317  length = sizeof(ULONG);
318  }
319 
320  //
321  // This copies the bytes in the right order (so that they appear correct
322  // when dumped as a sequence of chars)
323  //
324  RtlCopyMemory(&FxDriverGlobals->Tag,
325  pBegin,
326  length);
327 
328  FxDriverGlobals->Public.DriverTag = FxDriverGlobals->Tag;
329  }
330 }
signed char * PCHAR
Definition: retypes.h:7
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
#define FX_TAG
Definition: fxmacros.hpp:155
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_CHILD_LIST_CONFIG Config
Definition: wdfchildlist.h:474
unsigned int ULONG
Definition: retypes.h:1
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263

◆ AddDevice()

_Must_inspect_result_ NTSTATUS FxDriver::AddDevice ( __in MdDeviceObject  PhysicalDeviceObject)

◆ AllocateDriverObjectExtensionAndStoreFxDriver()

_Must_inspect_result_ NTSTATUS FxDriver::AllocateDriverObjectExtensionAndStoreFxDriver ( VOID  )

Definition at line 130 of file fxdriverkm.cpp.

133 {
135  FxDriver** ppDriver;
136 
137  //
138  // Prefast is much happier if we take the size of the type rather then
139  // the size of the variable.
140  //
142  FX_DRIVER_ID,
143  sizeof(FxDriver**),
144  (PVOID*)&ppDriver);
145  if (!NT_SUCCESS(status)) {
146  return status;
147  }
148 
149  //
150  // If we succeeded in creating the driver object extension,
151  // then store our FxDriver pointer in the DriverObjectExtension.
152  //
153  *ppDriver = this;
154 
155  return STATUS_SUCCESS;
156 }
LONG NTSTATUS
Definition: precomp.h:26
#define FX_DRIVER_ID
Definition: fxdriver.hpp:49
static __inline NTSTATUS MxAllocateDriverObjectExtension(_In_ MdDriverObject DriverObject, _In_ PVOID ClientIdentificationAddress, _In_ ULONG DriverObjectExtensionSize, _Post_ _At_(*DriverObjectExtension, _When_(return==0, __drv_aliasesMem __drv_allocatesMem(Mem) _Post_notnull_)) _When_(return==0, _Outptr_result_bytebuffer_(DriverObjectExtensionSize)) PVOID *DriverObjectExtension)
Definition: mxgeneralkm.h:396
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
__inline MdDriverObject GetObject(VOID)
#define STATUS_SUCCESS
Definition: shellext.h:65
static SERVICE_STATUS status
Definition: service.c:31
MxDriverObject m_DriverObject
Definition: fxdriver.hpp:62
Definition: ps.c:97

Referenced by Initialize().

◆ ConfigureConstraints()

VOID FxDriver::ConfigureConstraints ( __in_opt PWDF_OBJECT_ATTRIBUTES  DriverAttributes)

Definition at line 564 of file fxdriver.cpp.

583 {
584  BOOLEAN automaticLockingRequired;
585 
586  automaticLockingRequired = FALSE;
587 
588  // Initialize the mutex lock
590 
591 
592 
593 
594 
595 
596 
597 
598 
600 
603 
604  //
605  // Use the caller supplied scope and level only if they are not
606  // InheritFromParent.
607  //
608  if (DriverAttributes != NULL) {
609 
610  if (DriverAttributes->ExecutionLevel !=
612  m_ExecutionLevel = DriverAttributes->ExecutionLevel;
613  }
614 
615  if (DriverAttributes->SynchronizationScope !=
617  m_SynchronizationScope = DriverAttributes->SynchronizationScope;
618  }
619  }
620 
621  //
622  // If the driver asks for any synchronization, we synchronize the
623  // WDFDRIVER object's own callbacks as well.
624  //
625  // (No option to extend synchronization for regular operations
626  // across all WDFDEVICE objects)
627  //
630 
631  automaticLockingRequired = TRUE;
632  }
633 
634  //
635  // No FxDriver events are delivered from a thread that is
636  // not already at PASSIVE_LEVEL, so we don't need to
637  // allocate an FxSystemWorkItem if the execution level
638  // constraint is WdfExecutionLevelPassive.
639  //
640  // If any events are added FxDriver that could occur on a thread
641  // that is above PASSIVE_LEVEL, then an FxSystemWorkItem would
642  // need to be allocated to deliver those events similar to the
643  // code in FxIoQueue.
644  //
645 
646  //
647  // Configure FxDriver event callback locks
648  //
649  if (automaticLockingRequired) {
651  }
652  else {
654  }
655 }
FxCallbackMutexLock m_CallbackMutexLock
Definition: fxdriver.hpp:93
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
FxObject * m_CallbackLockObjectPtr
Definition: fxdriver.hpp:101
unsigned char BOOLEAN
VOID MarkPassiveCallbacks(__in FxObjectLockState State=ObjectLock)
Definition: fxobject.hpp:972
FxCallbackLock * m_CallbackLockPtr
Definition: fxdriver.hpp:100
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING _In_opt_ PWDF_OBJECT_ATTRIBUTES DriverAttributes
Definition: wdfdriver.h:213
void SetCallbackLockPtr(FxCallbackLock *Lock)
Definition: fxcallback.hpp:105
virtual void Initialize(FxObject *ParentObject)
WDF_EXECUTION_LEVEL m_ExecutionLevel
Definition: fxdriver.hpp:77
WDF_SYNCHRONIZATION_SCOPE m_SynchronizationScope
Definition: fxdriver.hpp:78
#define NULL
Definition: types.h:112
FxDriverDeviceAdd m_DriverDeviceAdd
Definition: fxdriver.hpp:70

Referenced by Initialize().

◆ DeleteObject()

virtual VOID FxDriver::DeleteObject ( VOID  )
inlinevirtual

Reimplemented from FxObject.

Definition at line 332 of file fxdriver.hpp.

335  {
336  //
337  // If diposed at > PASSIVE, we will cause a deadlock in FxDriver::Dispose
338  // when we call into the dispose list to wait for empty when we are in
339  // the context of the dispose list's work item.
340  //
342 
343  FxNonPagedObject::DeleteObject(); // __super call
344  }
virtual VOID DeleteObject(VOID)
#define ASSERT(a)
Definition: mode.c:44
static __inline KIRQL MxGetCurrentIrql()
Definition: mxgeneralkm.h:86
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693

Referenced by FxLibraryCommonUnregisterClient().

◆ Dispose()

BOOLEAN FxDriver::Dispose ( VOID  )
virtual

Reimplemented from FxObject.

Definition at line 128 of file fxdriver.cpp.

131 {
132  if (m_DisposeList != NULL) {
134  }
135 
136  return FxNonPagedObject::Dispose(); // __super call
137 }
FxDisposeList * m_DisposeList
Definition: fxdriver.hpp:111
VOID WaitForEmpty(VOID)
#define NULL
Definition: types.h:112
virtual BOOLEAN Dispose(VOID)

◆ GetCallbackLockPtr()

virtual FxCallbackLock* FxDriver::GetCallbackLockPtr ( __deref_out FxObject **  LockObject)
inlinevirtual

Definition at line 298 of file fxdriver.hpp.

300  {
301 
302  if (LockObject != NULL) {
304  }
305 
306  return m_CallbackLockPtr;
307  }
FxObject * m_CallbackLockObjectPtr
Definition: fxdriver.hpp:101
FxCallbackLock * m_CallbackLockPtr
Definition: fxdriver.hpp:100
#define NULL
Definition: types.h:112
#define LockObject(Object)
Definition: titypes.h:34

◆ GetConstraints()

virtual VOID FxDriver::GetConstraints ( __out WDF_EXECUTION_LEVEL ExecutionLevel,
__out WDF_SYNCHRONIZATION_SCOPE SynchronizationScope 
)
inlinevirtual

Implements IFxHasCallbacks.

Definition at line 282 of file fxdriver.hpp.

285  {
286 
287  if (ExecutionLevel != NULL) {
288  *ExecutionLevel = m_ExecutionLevel;
289  }
290 
291  if (SynchronizationScope != NULL) {
292  *SynchronizationScope = m_SynchronizationScope;
293  }
294  }
WDF_EXECUTION_LEVEL m_ExecutionLevel
Definition: fxdriver.hpp:77
WDF_SYNCHRONIZATION_SCOPE m_SynchronizationScope
Definition: fxdriver.hpp:78
#define NULL
Definition: types.h:112

Referenced by FxDeviceBase::ConfigureConstraints().

◆ GetDisposeList()

__inline FxDisposeList* FxDriver::GetDisposeList ( )
inline

Definition at line 354 of file fxdriver.hpp.

356  {
357  return m_DisposeList;
358  }
FxDisposeList * m_DisposeList
Definition: fxdriver.hpp:111

Referenced by FxObject::FinalRelease(), and FxObject::QueueDeferredDisposeLocked().

◆ GetDriverDeviceAddMethod()

◆ GetDriverObject()

__inline MdDriverObject FxDriver::GetDriverObject ( VOID  )
inline

◆ GetFxDriver()

FxDriver * FxDriver::GetFxDriver ( __in MdDriverObject  DriverObject)
static

Definition at line 159 of file fxdriverkm.cpp.

162 {
163  FxDriver* objExt;
165  FX_DRIVER_ID);
166  ASSERT(objExt != NULL);
167 
168  return objExt;
169 }
#define FX_DRIVER_ID
Definition: fxdriver.hpp:49
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
#define ASSERT(a)
Definition: mode.c:44
#define NULL
Definition: types.h:112
static __inline PVOID MxGetDriverObjectExtension(__in MdDriverObject DriverObject, __in PVOID ClientIdentificationAddress)
Definition: mxgeneralkm.h:385

◆ GetHandle()

__inline WDFDRIVER FxDriver::GetHandle ( VOID  )
inline

Definition at line 202 of file fxdriver.hpp.

205  {
206  return (WDFDRIVER) GetObjectHandle();
207  }
PVOID __inline GetObjectHandle(VOID)
Definition: fxobject.hpp:603

Referenced by FxPkgGeneral::ConfigureConstraints(), FxPkgGeneral::ConfigureFileObjectClass(), and FxPkgGeneral::OnCreate().

◆ GetRegistryPath()

_Must_inspect_result_ FxString * FxDriver::GetRegistryPath ( VOID  )

Definition at line 539 of file fxdriver.cpp.

542 {
543  FxString *pString;
544 
547 
548  if (pString != NULL) {
550 
552 
553  if (!NT_SUCCESS(status)) {
554  pString->Release();
555  pString = NULL;
556  }
557  }
558 
559  return pString;
560 }
virtual ULONG Release(__in_opt PVOID Tag=NULL, __in LONG Line=0, __in_opt PSTR File=NULL)
Definition: fxobject.hpp:853
LONG NTSTATUS
Definition: precomp.h:26
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
_Must_inspect_result_ NTSTATUS Assign(__in PCWSTR SourceString)
Definition: fxstring.cpp:57
FxString * pString
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
UNICODE_STRING m_RegistryPath
Definition: fxdriver.hpp:63
#define NULL
Definition: types.h:112
#define WDF_NO_OBJECT_ATTRIBUTES
Definition: wdftypes.h:105
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

◆ GetRegistryPathUnicodeString()

PUNICODE_STRING FxDriver::GetRegistryPathUnicodeString ( VOID  )
inline

Definition at line 243 of file fxdriver.hpp.

246  {
247  return &m_RegistryPath;
248  }
UNICODE_STRING m_RegistryPath
Definition: fxdriver.hpp:63

Referenced by FxWmiIrpHandler::_RegInfo(), and if().

◆ Initialize()

_Must_inspect_result_ NTSTATUS FxDriver::Initialize ( __in PCUNICODE_STRING  RegistryPath,
__in PWDF_DRIVER_CONFIG  Config,
__in_opt PWDF_OBJECT_ATTRIBUTES  DriverAttributes 
)

Definition at line 334 of file fxdriver.cpp.

339 {
340  PFX_DRIVER_GLOBALS FxDriverGlobals = GetDriverGlobals();
342 
343  // WDFDRIVER can not be deleted by the device driver
344  MarkNoDeleteDDI();
345 
347 
348  //
349  // Configure Constraints
350  //
352 
353  if (m_DriverObject.GetObject() == NULL) {
354  return STATUS_UNSUCCESSFUL;
355  }
356 
357  // Allocate FxDisposeList
359  if (!NT_SUCCESS(status)) {
360  return status;
361  }
362 
363  //
364  // Store FxDriver in Driver object extension
365  //
367  if (!NT_SUCCESS(status)) {
368  return status;
369  }
370 
371  //
372  // Store away the callback functions.
373  //
374  if ((Config->DriverInitFlags & WdfDriverInitNoDispatchOverride) == 0) {
375  //
376  // Caller doesn't want to override the dispatch table. That
377  // means that they want to create everything and still be in
378  // control (or at least the port driver will take over)
379  //
380  m_DriverDeviceAdd.Method = Config->EvtDriverDeviceAdd;
381  m_DriverUnload.Method = Config->EvtDriverUnload;
382  }
383 
384  if (ArgRegistryPath != NULL) {
385  USHORT length;
386 
387  length = ArgRegistryPath->Length + sizeof(UNICODE_NULL);
388 
389  m_RegistryPath.Length = ArgRegistryPath->Length;
391  m_RegistryPath.Buffer = (PWSTR) FxPoolAllocate(
393 
394  if (m_RegistryPath.Buffer != NULL) {
396  ArgRegistryPath->Buffer,
397  ArgRegistryPath->Length);
398 
399  //
400  // other parts of WDF assumes m_RegistryPath.Buffer is
401  // a null terminated string. make sure it is.
402  //
404  }
405  else {
406  //
407  // We failed to allocate space for the registry path
408  // so set the length to 0.
409  //
412 
414  }
415  }
416 
417  if (NT_SUCCESS(status)) {
418  if ((Config->DriverInitFlags & WdfDriverInitNoDispatchOverride) == 0) {
419  UCHAR i;
420 
421  //
422  // Set up dispatch routines.
423  //
424  if (Config->DriverInitFlags & WdfDriverInitNonPnpDriver) {
425  //
426  // NT4 style drivers must clear the AddDevice field in the
427  // driver object so that they can be unloaded while still
428  // having device objects around.
429  //
430  // If AddDevice is set, NT considers the driver a pnp driver
431  // and will not allow net stop to unload the driver.
432  //
434 
435  //
436  // Unload for an NT4 driver is still optional if the driver
437  // does not want to be stopped (through net stop for
438  // instance).
439  //
440  if (Config->EvtDriverUnload != NULL) {
442  }
443  else {
445  }
446 
447  }
448  else {
449  //
450  // PnP driver, set our routines up
451  //
454  }
455 
456  //
457  // For any major control code that we use a remove lock, the
458  // following locations must be updated:
459  //
460  // 1) FxDevice::_RequiresRemLock() which decides if the remlock
461  // is required
462  // 2) FxDefaultIrpHandler::Dispatch might need to be changed if
463  // there is catchall generic post processing that must be done
464  // 3) Whereever the major code irp handler completes the irp or
465  // sends it down the stack. A good design would have all
466  // spots in the irp handler where this is done to call a
467  // common function.
468  //
470 
471 #if ((FX_CORE_MODE)==(FX_CORE_KERNEL_MODE))
472  for (i = 0; i <= IRP_MJ_MAXIMUM_FUNCTION; i++) {
475  }
476  else {
478  }
479  }
480 #else // USER_MODE
481  for (i = 0; i <= IRP_MJ_MAXIMUM_FUNCTION; i++) {
484  }
485  else {
487  }
488  }
489 #endif
490  }
491 
492  //
493  // Determine if the debugger is connected.
494  //
495 #if ((FX_CORE_MODE)==(FX_CORE_KERNEL_MODE))
498  }
499 #endif
500 
501  //
502  // Log this notable event after tracing has been initialized.
503  //
504 
505 
506 
507 
508 
509 
510  if ((Config->DriverInitFlags & WdfDriverInitNonPnpDriver) &&
511  Config->EvtDriverUnload == NULL) {
512 
514  FxDriverGlobals, TRACE_LEVEL_INFORMATION, TRACINGDRIVER,
515  "Driver Object %p, reg path %wZ cannot be "
516  "unloaded, no DriverUnload routine specified",
518  }
519 
520 #if FX_IS_USER_MODE
521  //
522  // Open a R/W handle to the driver's service parameters key
523  //
524  status = OpenParametersKey();
525  if (!NT_SUCCESS(status)) {
527  FxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGDRIVER,
528  "Cannot open Driver Parameters key %!STATUS!",
529  status);
530  }
531 #endif
532  }
533 
534  return status;
535 }
static VOID DispatchUm(_In_ MdDeviceObject DeviceObject, _In_ MdIrp Irp, _In_opt_ IUnknown *Context)
Definition: fxdeviceum.cpp:32
static MdDriverUnloadType Unload
Definition: fxdriver.hpp:369
PFN_WDF_DRIVER_DEVICE_ADD Method
VOID ConfigureConstraints(__in_opt PWDF_OBJECT_ATTRIBUTES DriverAttributes)
Definition: fxdriver.cpp:564
#define IRP_MN_REMOVE_DEVICE
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
GLint x0
Definition: linetemp.h:95
USHORT MaximumLength
Definition: env_spec_w32.h:370
#define TRUE
Definition: types.h:120
uint16_t * PWSTR
Definition: typedefs.h:56
FxDisposeList * m_DisposeList
Definition: fxdriver.hpp:111
WDFCASSERT(sizeof(WDF_DRIVER_CONFIG_V1_0)==sizeof(WDF_DRIVER_CONFIG_V1_1))
#define IRP_MJ_MAXIMUM_FUNCTION
LONG NTSTATUS
Definition: precomp.h:26
#define TRACINGDRIVER
Definition: dbgtrace.h:68
#define KD_DEBUGGER_NOT_PRESENT
Definition: kdfuncs.h:133
static VOID DispatchWithLockUm(_In_ MdDeviceObject DeviceObject, _In_ MdIrp Irp, _In_opt_ IUnknown *Context)
Definition: fxdeviceum.cpp:48
#define TRACE_LEVEL_INFORMATION
Definition: storswtr.h:29
static _Must_inspect_result_ NTSTATUS STDCALL DispatchWithLock(__in MdDeviceObject DeviceObject, __in MdIrp OriginalIrp)
Definition: fxdevice.cpp:1336
#define FALSE
Definition: types.h:117
#define UNICODE_NULL
VOID SetMajorFunction(_In_ UCHAR i, _In_ MdDriverDispatch Value)
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
PFN_WDF_DRIVER_UNLOAD Method
VOID MarkDisposeOverride(__in FxObjectLockState State=ObjectLock)
Definition: fxobject.hpp:1101
_Must_inspect_result_ NTSTATUS AllocateDriverObjectExtensionAndStoreFxDriver(VOID)
Definition: fxdriverkm.cpp:130
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING _In_opt_ PWDF_OBJECT_ATTRIBUTES DriverAttributes
Definition: wdfdriver.h:213
#define KD_DEBUGGER_ENABLED
Definition: kdfuncs.h:130
static MdDriverAddDeviceType AddDevice
Definition: fxdriver.hpp:125
VOID SetDriverUnload(_In_ MdDriverUnload Value)
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
unsigned char UCHAR
Definition: xmlstorage.h:181
VOID MarkNoDeleteDDI(__in FxObjectLockState State=ObjectLock)
Definition: fxobject.hpp:1118
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_CHILD_LIST_CONFIG Config
Definition: wdfchildlist.h:474
__inline MdDriverObject GetObject(VOID)
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
FxDriverUnload m_DriverUnload
Definition: fxdriver.hpp:130
static NTSTATUS _Create(PFX_DRIVER_GLOBALS FxDriverGlobals, PVOID WdmObject, FxDisposeList **pObject)
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned short USHORT
Definition: pedump.c:61
UNICODE_STRING m_RegistryPath
Definition: fxdriver.hpp:63
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
static FxDeviceRemLockAction __inline _RequiresRemLock(__in UCHAR MajorCode, __in UCHAR MinorCode)
Definition: fxdevice.hpp:933
#define NULL
Definition: types.h:112
BOOLEAN m_DebuggerConnected
Definition: fxdriver.hpp:65
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
static _Must_inspect_result_ NTSTATUS STDCALL Dispatch(__in MdDeviceObject DeviceObject, __in MdIrp OriginalIrp)
Definition: fxdevice.cpp:1551
VOID SetDriverExtensionAddDevice(_In_ MdDriverAddDevice Value)
static SERVICE_STATUS status
Definition: service.c:31
MxDriverObject m_DriverObject
Definition: fxdriver.hpp:62
FxDriverDeviceAdd m_DriverDeviceAdd
Definition: fxdriver.hpp:70
Definition: ps.c:97

Referenced by if().

◆ InitializeInternal()

VOID FxDriver::InitializeInternal ( VOID  )

◆ IsDriverObjectFlagSet()

BOOLEAN FxDriver::IsDriverObjectFlagSet ( _In_ FxDriverObjectUmFlags  Flag)
inline

Definition at line 411 of file fxdriver.hpp.

414  {
416  }
Definition: xml2sdb.h:79
BOOLEAN IsDriverObjectFlagSet(_In_ FxDriverObjectUmFlags Flag)
MxDriverObject m_DriverObject
Definition: fxdriver.hpp:62

◆ QueryInterface()

virtual NTSTATUS FxDriver::QueryInterface ( __inout FxQueryInterfaceParams Params)
inlinevirtual

Definition at line 314 of file fxdriver.hpp.

317  {
318  switch (Params->Type) {
319  case FX_TYPE_DRIVER:
320  *Params->Object = (FxDriver*) this;
321  break;
322 
323  default:
324  return FxNonPagedObject::QueryInterface(Params); // __super call
325  }
326 
327  return STATUS_SUCCESS;
328  }
_In_ WDFIOTARGET _In_ PWDF_REQUEST_COMPLETION_PARAMS Params
Definition: wdfrequest.h:306
virtual _Must_inspect_result_ NTSTATUS QueryInterface(__in FxQueryInterfaceParams *Params)
Definition: fxobject.cpp:255
#define STATUS_SUCCESS
Definition: shellext.h:65

◆ SetDriverObjectFlag()

VOID FxDriver::SetDriverObjectFlag ( _In_ FxDriverObjectUmFlags  Flag)
inline

Definition at line 403 of file fxdriver.hpp.

406  {
408  }
VOID SetDriverObjectFlag(_In_ FxDriverObjectUmFlags Flag)
Definition: xml2sdb.h:79
MxDriverObject m_DriverObject
Definition: fxdriver.hpp:62

Friends And Related Function Documentation

◆ FxDevice

friend class FxDevice
friend

Definition at line 56 of file fxdriver.hpp.

◆ FxPackage

friend class FxPackage
friend

Definition at line 57 of file fxdriver.hpp.

◆ FxWmiIrpHandler

friend class FxWmiIrpHandler
friend

Definition at line 58 of file fxdriver.hpp.

Member Data Documentation

◆ AddDevice

_Must_inspect_result_ NTSTATUS FxDriver::AddDevice
staticprivate

Definition at line 125 of file fxdriver.hpp.

Referenced by Initialize().

◆ m_CallbackLockObjectPtr

FxObject* FxDriver::m_CallbackLockObjectPtr
private

Definition at line 101 of file fxdriver.hpp.

Referenced by ConfigureConstraints(), FxDriver(), and GetCallbackLockPtr().

◆ m_CallbackLockPtr

FxCallbackLock* FxDriver::m_CallbackLockPtr
private

Definition at line 100 of file fxdriver.hpp.

Referenced by ConfigureConstraints(), FxDriver(), and GetCallbackLockPtr().

◆ m_CallbackMutexLock

FxCallbackMutexLock FxDriver::m_CallbackMutexLock
private

Definition at line 93 of file fxdriver.hpp.

Referenced by ConfigureConstraints().

◆ m_Config

WDF_DRIVER_CONFIG FxDriver::m_Config
private

Definition at line 106 of file fxdriver.hpp.

Referenced by FxDriver().

◆ m_DebuggerConnected

BOOLEAN FxDriver::m_DebuggerConnected
private

Definition at line 65 of file fxdriver.hpp.

Referenced by FxDriver(), and Initialize().

◆ m_DisposeList

FxDisposeList* FxDriver::m_DisposeList
private

Definition at line 111 of file fxdriver.hpp.

Referenced by Dispose(), FxDriver(), GetDisposeList(), Initialize(), and ~FxDriver().

◆ m_DriverDeviceAdd

FxDriverDeviceAdd FxDriver::m_DriverDeviceAdd
private

Definition at line 70 of file fxdriver.hpp.

Referenced by ConfigureConstraints(), GetDriverDeviceAddMethod(), and Initialize().

◆ m_DriverObject

◆ m_DriverUnload

FxDriverUnload FxDriver::m_DriverUnload

Definition at line 130 of file fxdriver.hpp.

Referenced by Initialize().

◆ m_ExecutionLevel

WDF_EXECUTION_LEVEL FxDriver::m_ExecutionLevel
private

Definition at line 77 of file fxdriver.hpp.

Referenced by ConfigureConstraints(), FxDriver(), and GetConstraints().

◆ m_RegistryPath

UNICODE_STRING FxDriver::m_RegistryPath
private

◆ m_SynchronizationScope

WDF_SYNCHRONIZATION_SCOPE FxDriver::m_SynchronizationScope
private

Definition at line 78 of file fxdriver.hpp.

Referenced by ConfigureConstraints(), FxDriver(), and GetConstraints().

◆ Unload

VOID FxDriver::Unload
static

Definition at line 369 of file fxdriver.hpp.

Referenced by Initialize(), and WdfDriverMiniportUnload().


The documentation for this class was generated from the following files: