ReactOS  0.4.15-dev-3331-g8ebe441
FxRegKey Class Reference

#include <fxregkey.hpp>

Inheritance diagram for FxRegKey:
Collaboration diagram for FxRegKey:

Public Member Functions

 FxRegKey (PFX_DRIVER_GLOBALS FxDriverGlobals)
 
 __drv_maxIRQL (PASSIVE_LEVEL) ~FxRegKey(VOID)
 
_Must_inspect_result_ __drv_maxIRQL (PASSIVE_LEVEL) NTSTATUS Create(__in_opt HANDLE ParentKey
 
_Must_inspect_result_ __drv_maxIRQL (PASSIVE_LEVEL) NTSTATUS Open(__in_opt HANDLE ParentKey
 
__inline VOID SetHandle (__in HANDLE Key)
 
__inline HANDLE GetHandle (VOID)
 
 __drv_maxIRQL (PASSIVE_LEVEL) NTSTATUS Close(VOID)
 
_Must_inspect_result_ __drv_maxIRQL (PASSIVE_LEVEL) NTSTATUS SetValue(__in PCUNICODE_STRING ValueName
 
_Must_inspect_result_ __in ULONG __in_bcount (ValueLength) PVOID Value
 
static _Must_inspect_result_ _In_ PCUNICODE_STRING _In_ ULONG _In_reads_bytes_ (ValueLength) PVOID Value
 
_Must_inspect_result_ __drv_maxIRQL (PASSIVE_LEVEL) NTSTATUS QueryValue(__in PCUNICODE_STRING ValueName
 
_Must_inspect_result_ __in ULONG __out_bcount_opt (ValueLength) PVOID Value
 
static _Must_inspect_result_ __in HANDLE __in PCUNICODE_STRING __in ULONG __out_bcount_opt (ValueLength) PVOID Value
 
VOID __inline SetCanCloseHandle (BOOLEAN CanCloseHandle)
 
- Public Member Functions inherited from FxPagedObject
 FxPagedObject (__in WDFTYPE Type, __in USHORT Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals)
 
virtual ~FxPagedObject (VOID)
 
VOID Lock (VOID)
 
VOID Unlock (VOID)
 
_Must_inspect_result_ NTSTATUS Initialize (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)
 
virtual VOID DeleteObject (VOID)
 
virtual BOOLEAN Dispose (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)
 

Static Public Member Functions

static __drv_maxIRQL (PASSIVE_LEVEL) NTSTATUS _Close(__in HANDLE Key)
 
static _Must_inspect_result_ __drv_maxIRQL (PASSIVE_LEVEL) NTSTATUS _SetValue(_In_ HANDLE Key
 
static _Must_inspect_result_ __drv_maxIRQL (PASSIVE_LEVEL) NTSTATUS _QueryValue(__in PFX_DRIVER_GLOBALS FxDriverGlobals
 
static _Must_inspect_result_ __drv_maxIRQL (PASSIVE_LEVEL) NTSTATUS _QueryULong(__in HANDLE Key
 
static _Must_inspect_result_ __drv_maxIRQL (PASSIVE_LEVEL) NTSTATUS _QueryQuadWord(__in HANDLE Key
 
static BOOLEAN __inline _IsValidSzType (__in ULONG RegValueType)
 
static _Must_inspect_result_ NTSTATUS _VerifyMultiSzString (__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PCUNICODE_STRING RegValueName, __in_bcount(DataLength) PWCHAR DataString, __in ULONG DataLength)
 
- 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

_Must_inspect_result_ __in PCUNICODE_STRING KeyName
 
_Must_inspect_result_ __in PCUNICODE_STRING __in ACCESS_MASK DesiredAccess = KEY_ALL_ACCESS
 
_Must_inspect_result_ __in PCUNICODE_STRING __in ACCESS_MASK __in ULONG CreateOptions = REG_OPTION_NON_VOLATILE
 
_Must_inspect_result_ __in PCUNICODE_STRING __in ACCESS_MASK __in ULONG __out_opt PULONG CreateDisposition
 
_Must_inspect_result_ __in ULONG ValueType
 
_Must_inspect_result_ __in ULONG __in ULONG ValueLength
 
static _Must_inspect_result_ _In_ PCUNICODE_STRING ValueName
 
static _Must_inspect_result_ _In_ PCUNICODE_STRING _In_ ULONG ValueType
 
static _Must_inspect_result_ _In_ PCUNICODE_STRING _In_ ULONG _In_ ULONG ValueLength
 
_Must_inspect_result_ __in ULONG ValueLength
 
_Must_inspect_result_ __in ULONG __out_opt PULONG ValueLengthQueried
 
_Must_inspect_result_ __in ULONG __out_opt PULONG __out_opt PULONG ValueType
 
static _Must_inspect_result_ __in HANDLE Key
 
static _Must_inspect_result_ __in HANDLE __in PCUNICODE_STRING ValueName
 
static _Must_inspect_result_ __in HANDLE __in PCUNICODE_STRING __in ULONG ValueLength
 
static _Must_inspect_result_ __in HANDLE __in PCUNICODE_STRING __in ULONG __out_opt PULONG ValueLengthQueried
 
static _Must_inspect_result_ __in HANDLE __in PCUNICODE_STRING __in ULONG __out_opt PULONG __out_opt PULONG ValueType
 
static _Must_inspect_result_ __in PCUNICODE_STRING ValueName
 
static _Must_inspect_result_ __in PCUNICODE_STRING __out PULONG Value
 
static _Must_inspect_result_ __in PCUNICODE_STRING __out PLARGE_INTEGER Value
 

Protected Attributes

HANDLE m_Key
 
PFX_DRIVER_GLOBALS m_Globals
 
- Protected Attributes inherited from FxObject
union {
   CfxDeviceBase *   m_DeviceBase
 
   CfxDevice *   m_Device
 
}; 
 

Static Private Member Functions

static __out_range (Length,(Length+sizeof(KEY_VALUE_PARTIAL_INFORMATION) -1)) ULONG _ComputePartialSize(__in_bound ULONG Length)
 

Private Attributes

BOOLEAN m_CanCloseHandle
 

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)
 

Detailed Description

Definition at line 25 of file fxregkey.hpp.

Constructor & Destructor Documentation

◆ FxRegKey()

FxRegKey::FxRegKey ( PFX_DRIVER_GLOBALS  FxDriverGlobals)

Definition at line 29 of file fxregkeykm.cpp.

31  :
32  FxPagedObject(FX_TYPE_REG_KEY, sizeof(FxRegKey), FxDriverGlobals),
33  m_Key(NULL),
34  m_Globals(FxDriverGlobals)
35 {
36 }
PFX_DRIVER_GLOBALS m_Globals
Definition: fxregkey.hpp:262
HANDLE m_Key
Definition: fxregkey.hpp:261
FxPagedObject(__in WDFTYPE Type, __in USHORT Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals)
#define NULL
Definition: types.h:112

Member Function Documentation

◆ __drv_maxIRQL() [1/11]

FxRegKey::__drv_maxIRQL ( PASSIVE_LEVEL  )

◆ __drv_maxIRQL() [2/11]

_Must_inspect_result_ FxRegKey::__drv_maxIRQL ( PASSIVE_LEVEL  )

◆ __drv_maxIRQL() [3/11]

_Must_inspect_result_ FxRegKey::__drv_maxIRQL ( PASSIVE_LEVEL  )

◆ __drv_maxIRQL() [4/11]

FxRegKey::__drv_maxIRQL ( PASSIVE_LEVEL  )
inline

Definition at line 110 of file fxregkey.hpp.

115  {
116  HANDLE key;
117 
118  key = m_Key;
119  m_Key = NULL;
120 
121 #if (FX_CORE_MODE == FX_CORE_USER_MODE)
122  //
123  // For special cases where, due to user-mode restrictions,
124  // we cannot open a specific handle for write access,
125  // so we reuse a pre-opened one multiple times.
126  //
127  // In this case we do not want to close it when we close
128  // the FxRegKey object.
129  //
130  if (m_CanCloseHandle == FALSE) {
131  return STATUS_SUCCESS;
132  }
133 #endif
134  return _Close(key);
135  }
#define FALSE
Definition: types.h:117
BOOLEAN m_CanCloseHandle
Definition: fxregkey.hpp:271
HANDLE m_Key
Definition: fxregkey.hpp:261
HKEY key
Definition: reg.c:42
#define NULL
Definition: types.h:112
#define STATUS_SUCCESS
Definition: shellext.h:65
Definition: path.c:41

◆ __drv_maxIRQL() [5/11]

static FxRegKey::__drv_maxIRQL ( PASSIVE_LEVEL  )
static

◆ __drv_maxIRQL() [6/11]

_Must_inspect_result_ FxRegKey::__drv_maxIRQL ( PASSIVE_LEVEL  )

◆ __drv_maxIRQL() [7/11]

static _Must_inspect_result_ FxRegKey::__drv_maxIRQL ( PASSIVE_LEVEL  )
static

◆ __drv_maxIRQL() [8/11]

_Must_inspect_result_ FxRegKey::__drv_maxIRQL ( PASSIVE_LEVEL  )

◆ __drv_maxIRQL() [9/11]

static _Must_inspect_result_ FxRegKey::__drv_maxIRQL ( PASSIVE_LEVEL  )
static

◆ __drv_maxIRQL() [10/11]

static _Must_inspect_result_ FxRegKey::__drv_maxIRQL ( PASSIVE_LEVEL  )
static

◆ __drv_maxIRQL() [11/11]

static _Must_inspect_result_ FxRegKey::__drv_maxIRQL ( PASSIVE_LEVEL  )
static

◆ __in_bcount()

_Must_inspect_result_ __in ULONG FxRegKey::__in_bcount ( ValueLength  )

◆ __out_bcount_opt() [1/2]

_Must_inspect_result_ __in ULONG FxRegKey::__out_bcount_opt ( ValueLength  )

◆ __out_bcount_opt() [2/2]

static _Must_inspect_result_ __in HANDLE __in PCUNICODE_STRING __in ULONG FxRegKey::__out_bcount_opt ( ValueLength  )

◆ __out_range()

static FxRegKey::__out_range ( Length  ,
(Length+sizeof(KEY_VALUE_PARTIAL_INFORMATION) -1)   
)
inlinestaticprivate

Definition at line 250 of file fxregkey.hpp.

255  {
257  }
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255

◆ _In_reads_bytes_()

static _Must_inspect_result_ _In_ PCUNICODE_STRING _In_ ULONG FxRegKey::_In_reads_bytes_ ( ValueLength  )

◆ _IsValidSzType()

static BOOLEAN __inline FxRegKey::_IsValidSzType ( __in ULONG  RegValueType)
inlinestatic

Definition at line 230 of file fxregkey.hpp.

233  {
234  return (RegValueType == REG_SZ) || (RegValueType == REG_EXPAND_SZ);
235  }
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
#define REG_SZ
Definition: layer.c:22

◆ _VerifyMultiSzString()

_Must_inspect_result_ NTSTATUS FxRegKey::_VerifyMultiSzString ( __in PFX_DRIVER_GLOBALS  FxDriverGlobals,
__in PCUNICODE_STRING  RegValueName,
__in_bcount(DataLength) PWCHAR  DataString,
__in ULONG  DataLength 
)
static

Definition at line 14 of file fxregkey.cpp.

40 {
42 
43  if ((DataLength % 2) != 0) {
45  FxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGERROR,
46  "Reg value name %wZ, DataLength %d, Data buffer length is invalid, "
47  "STATUS_OBJECT_TYPE_MISMATCH",
48  RegValueName, DataLength);
50  }
51 
52  numChars = DataLength / sizeof(WCHAR);
53  if (numChars < 2 ||
54  DataString[numChars-1] != UNICODE_NULL ||
55  DataString[numChars-2] != UNICODE_NULL) {
56 
58  FxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGERROR,
59  "Read value name %wZ, DataLength %d, Data buffer from registry does not "
60  "have double NULL terminal chars, STATUS_OBJECT_TYPE_MISMATCH",
61  RegValueName, DataLength);
63  }
64 
65  return STATUS_SUCCESS;
66 }
#define UNICODE_NULL
_In_ ULONG _In_opt_ WDFREQUEST _In_opt_ PVOID _In_ size_t _In_ PVOID _In_ size_t _Out_ size_t * DataLength
Definition: cdrom.h:1437
USHORT numChars
#define STATUS_OBJECT_TYPE_MISMATCH
Definition: ntstatus.h:273
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
unsigned int ULONG
Definition: retypes.h:1
#define STATUS_SUCCESS
Definition: shellext.h:65
#define TRACINGERROR
Definition: dbgtrace.h:63

Referenced by FxVerifierGetObjectDebugInfo().

◆ GetHandle()

__inline HANDLE FxRegKey::GetHandle ( VOID  )
inline

Definition at line 103 of file fxregkey.hpp.

106  {
107  return m_Key;
108  }
HANDLE m_Key
Definition: fxregkey.hpp:261

◆ SetCanCloseHandle()

VOID __inline FxRegKey::SetCanCloseHandle ( BOOLEAN  CanCloseHandle)
inline

Definition at line 277 of file fxregkey.hpp.

280  {
281  m_CanCloseHandle = CanCloseHandle;
282  }
BOOLEAN m_CanCloseHandle
Definition: fxregkey.hpp:271

Referenced by if().

◆ SetHandle()

__inline VOID FxRegKey::SetHandle ( __in HANDLE  Key)
inline

Definition at line 94 of file fxregkey.hpp.

97  {
98  m_Key = Key;
99  }
HANDLE m_Key
Definition: fxregkey.hpp:261
static _Must_inspect_result_ __in HANDLE Key
Definition: fxregkey.hpp:199

Referenced by FxDevice::_OpenKey(), and if().

Member Data Documentation

◆ CreateDisposition

◆ CreateOptions

◆ DesiredAccess

Definition at line 43 of file fxregkey.hpp.

◆ Key

Definition at line 199 of file fxregkey.hpp.

Referenced by SetHandle().

◆ KeyName

Definition at line 42 of file fxregkey.hpp.

◆ m_CanCloseHandle

BOOLEAN FxRegKey::m_CanCloseHandle
private

Definition at line 271 of file fxregkey.hpp.

Referenced by __drv_maxIRQL(), __drv_maxIRQL(), and SetCanCloseHandle().

◆ m_Globals

PFX_DRIVER_GLOBALS FxRegKey::m_Globals
protected

Definition at line 262 of file fxregkey.hpp.

◆ m_Key

HANDLE FxRegKey::m_Key
protected

Definition at line 261 of file fxregkey.hpp.

Referenced by __drv_maxIRQL(), __drv_maxIRQL(), GetHandle(), and SetHandle().

◆ Value [1/2]

Definition at line 213 of file fxregkey.hpp.

◆ Value [2/2]

Definition at line 223 of file fxregkey.hpp.

◆ ValueLength [1/4]

_Must_inspect_result_ __in ULONG __in ULONG FxRegKey::ValueLength
Initial value:
{
return _SetValue(m_Key,

Definition at line 153 of file fxregkey.hpp.

◆ ValueLength [2/4]

Definition at line 171 of file fxregkey.hpp.

◆ ValueLength [3/4]

_Must_inspect_result_ __in ULONG FxRegKey::ValueLength

Definition at line 178 of file fxregkey.hpp.

◆ ValueLength [4/4]

Definition at line 199 of file fxregkey.hpp.

◆ ValueLengthQueried [1/2]

_Must_inspect_result_ __in ULONG __out_opt PULONG FxRegKey::ValueLengthQueried

Definition at line 180 of file fxregkey.hpp.

◆ ValueLengthQueried [2/2]

Definition at line 203 of file fxregkey.hpp.

◆ ValueName [1/3]

static _Must_inspect_result_ __in PCUNICODE_STRING FxRegKey::ValueName

Definition at line 167 of file fxregkey.hpp.

◆ ValueName [2/3]

Definition at line 199 of file fxregkey.hpp.

◆ ValueName [3/3]

Definition at line 213 of file fxregkey.hpp.

◆ ValueType [1/4]

_Must_inspect_result_ __in ULONG FxRegKey::ValueType

Definition at line 149 of file fxregkey.hpp.

◆ ValueType [2/4]

Definition at line 167 of file fxregkey.hpp.

◆ ValueType [3/4]

Initial value:

Definition at line 183 of file fxregkey.hpp.

◆ ValueType [4/4]


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