ReactOS 0.4.16-dev-329-g9223134
cm_x.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define GET_HASH_KEY(ConvKey)    ((CMP_HASH_IRRATIONAL * (ConvKey)) % CMP_HASH_PRIME)
 
#define COMPUTE_HASH_CHAR(ConvKey, Char)    (37 * ConvKey + RtlUpcaseUnicodeChar(Char))
 
#define GET_HASH_INDEX(ConvKey)    (GET_HASH_KEY(ConvKey) % CmpHashTableSize)
 
#define GET_HASH_ENTRY(Table, ConvKey)    (&Table[GET_HASH_INDEX(ConvKey)])
 
#define ASSERT_VALID_HASH(h)    ASSERT_KCB_VALID(CONTAINING_RECORD((h), CM_KEY_CONTROL_BLOCK, KeyHash))
 
#define CMP_IS_CELL_CACHED(c)    (((c) & HCELL_CACHED) && ((c) != HCELL_NIL))
 
#define CMP_GET_CACHED_CELL(c)    (ULONG_PTR)((c) & ~HCELL_CACHED)
 
#define CMP_GET_CACHED_DATA(c)    (&(((PCM_CACHED_VALUE_INDEX)(CMP_GET_CACHED_CELL(c)))->Data.CellData))
 
#define CMP_GET_CACHED_INDEX(c)    (&(((PCM_CACHED_ENTRY)(CMP_GET_CACHED_CELL(c)))->CellIndex))
 
#define CMP_GET_CACHED_VALUE(c)    (&(((PCM_CACHED_VALUE)(CMP_GET_CACHED_CELL(c)))->KeyValue))
 
#define CMP_ASSERT_REGISTRY_LOCK()
 
#define CMP_ASSERT_REGISTRY_LOCK_OR_LOADING(h)
 
#define CMP_ASSERT_EXCLUSIVE_REGISTRY_LOCK()
 
#define CMP_ASSERT_EXCLUSIVE_REGISTRY_LOCK_OR_LOADING(h)
 
#define ASSERT_KCB_VALID(k)    ASSERT((k)->Signature == CM_KCB_SIGNATURE)
 
#define CmpIsKcbLockedExclusive(k)
 
#define CmpAcquireKcbLockSharedByIndex(i)
 
#define CmpAcquireKcbLockShared(k)
 
#define CmpAcquireNcbLockExclusive(n)
 
#define CmpAcquireNcbLockExclusiveByKey(k)
 
#define CmpReleaseNcbLock(k)
 
#define CmpReleaseNcbLockByKey(k)
 
#define CMP_ASSERT_HASH_ENTRY_LOCK(k)
 
#define CMP_ASSERT_KCB_LOCK(k)
 
#define CmpGetAllocPageFromKcb(k)    (PCM_ALLOC_PAGE)(((ULONG_PTR)(k)) & ~(PAGE_SIZE - 1))
 
#define CmpGetAllocPageFromDelayAlloc(a)    (PCM_ALLOC_PAGE)(((ULONG_PTR)(a)) & ~(PAGE_SIZE - 1))
 
#define CMP_ASSERT_FLUSH_LOCK(h)
 

Functions

FORCEINLINE VOID CmpAcquireKcbLockExclusiveByIndex (ULONG Index)
 
FORCEINLINE VOID CmpAcquireKcbLockExclusive (PCM_KEY_CONTROL_BLOCK Kcb)
 
FORCEINLINE VOID CmpAcquireKcbLockExclusiveByKey (IN ULONG ConvKey)
 
FORCEINLINE VOID CmpAcquireKcbLockSharedByKey (_In_ ULONG ConvKey)
 
FORCEINLINE BOOLEAN CmpTryToConvertKcbSharedToExclusive (IN PCM_KEY_CONTROL_BLOCK k)
 
FORCEINLINE VOID CmpReleaseKcbLockByIndex (ULONG Index)
 
FORCEINLINE VOID CmpReleaseKcbLock (PCM_KEY_CONTROL_BLOCK Kcb)
 
FORCEINLINE VOID CmpReleaseKcbLockByKey (ULONG ConvKey)
 
FORCEINLINE VOID CmpConvertKcbSharedToExclusive (IN PCM_KEY_CONTROL_BLOCK k)
 

Macro Definition Documentation

◆ ASSERT_KCB_VALID

#define ASSERT_KCB_VALID (   k)     ASSERT((k)->Signature == CM_KCB_SIGNATURE)

Definition at line 95 of file cm_x.h.

◆ ASSERT_VALID_HASH

#define ASSERT_VALID_HASH (   h)     ASSERT_KCB_VALID(CONTAINING_RECORD((h), CM_KEY_CONTROL_BLOCK, KeyHash))

Definition at line 41 of file cm_x.h.

◆ CMP_ASSERT_EXCLUSIVE_REGISTRY_LOCK

#define CMP_ASSERT_EXCLUSIVE_REGISTRY_LOCK ( )
Value:
BOOLEAN CmpSpecialBootCondition
Definition: cmsysini.c:26
BOOLEAN NTAPI CmpTestRegistryLockExclusive(VOID)
Definition: cmsysini.c:1998
#define TRUE
Definition: types.h:120
#define ASSERT(a)
Definition: mode.c:44

Definition at line 80 of file cm_x.h.

◆ CMP_ASSERT_EXCLUSIVE_REGISTRY_LOCK_OR_LOADING

#define CMP_ASSERT_EXCLUSIVE_REGISTRY_LOCK_OR_LOADING (   h)
Value:
(((PCMHIVE)h)->HiveIsLoading == TRUE) || \
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
Definition: cmlib.h:316

Definition at line 87 of file cm_x.h.

◆ CMP_ASSERT_FLUSH_LOCK

#define CMP_ASSERT_FLUSH_LOCK (   h)
Value:
(((PCMHIVE)h)->HiveIsLoading == TRUE) || \
BOOLEAN NTAPI CmpTestHiveFlusherLockShared(IN PCMHIVE Hive)
Definition: cmsysini.c:2040
BOOLEAN NTAPI CmpTestHiveFlusherLockExclusive(IN PCMHIVE Hive)
Definition: cmsysini.c:2048

Definition at line 299 of file cm_x.h.

◆ CMP_ASSERT_HASH_ENTRY_LOCK

#define CMP_ASSERT_HASH_ENTRY_LOCK (   k)
Value:
{ \
}
#define GET_HASH_ENTRY(Table, ConvKey)
Definition: cm_x.h:39
PCM_KEY_HASH_TABLE_ENTRY CmpCacheTable
Definition: cmkcbncb.c:18
#define KeGetCurrentThread
Definition: hal.h:55
int k
Definition: mpi.c:3369
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL _Inout_ PULONG _Out_writes_bytes_to_opt_ SaclSize PACL _Inout_ PULONG _Out_writes_bytes_to_opt_ OwnerSize PSID Owner
Definition: rtlfuncs.h:1609

Definition at line 268 of file cm_x.h.

◆ CMP_ASSERT_KCB_LOCK

#define CMP_ASSERT_KCB_LOCK (   k)
Value:
{ \
ASSERT((CmpIsKcbLockedExclusive(k) == TRUE) || \
}
#define CmpIsKcbLockedExclusive(k)
Definition: cm_x.h:101

Definition at line 278 of file cm_x.h.

◆ CMP_ASSERT_REGISTRY_LOCK

#define CMP_ASSERT_REGISTRY_LOCK ( )
Value:
BOOLEAN NTAPI CmpTestRegistryLock(VOID)
Definition: cmsysini.c:1990

Definition at line 65 of file cm_x.h.

◆ CMP_ASSERT_REGISTRY_LOCK_OR_LOADING

#define CMP_ASSERT_REGISTRY_LOCK_OR_LOADING (   h)
Value:
(((PCMHIVE)h)->HiveIsLoading == TRUE) || \

Definition at line 72 of file cm_x.h.

◆ CMP_GET_CACHED_CELL

#define CMP_GET_CACHED_CELL (   c)     (ULONG_PTR)((c) & ~HCELL_CACHED)

Definition at line 53 of file cm_x.h.

◆ CMP_GET_CACHED_DATA

#define CMP_GET_CACHED_DATA (   c)     (&(((PCM_CACHED_VALUE_INDEX)(CMP_GET_CACHED_CELL(c)))->Data.CellData))

Definition at line 55 of file cm_x.h.

◆ CMP_GET_CACHED_INDEX

#define CMP_GET_CACHED_INDEX (   c)     (&(((PCM_CACHED_ENTRY)(CMP_GET_CACHED_CELL(c)))->CellIndex))

Definition at line 57 of file cm_x.h.

◆ CMP_GET_CACHED_VALUE

#define CMP_GET_CACHED_VALUE (   c)     (&(((PCM_CACHED_VALUE)(CMP_GET_CACHED_CELL(c)))->KeyValue))

Definition at line 59 of file cm_x.h.

◆ CMP_IS_CELL_CACHED

#define CMP_IS_CELL_CACHED (   c)     (((c) & HCELL_CACHED) && ((c) != HCELL_NIL))

Definition at line 47 of file cm_x.h.

◆ CmpAcquireKcbLockShared

#define CmpAcquireKcbLockShared (   k)
Value:
{ \
ExAcquirePushLockShared(&GET_HASH_ENTRY(CmpCacheTable, \
(k)->ConvKey)->Lock); \
}
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
Definition: wdfsync.h:127

Definition at line 162 of file cm_x.h.

◆ CmpAcquireKcbLockSharedByIndex

#define CmpAcquireKcbLockSharedByIndex (   i)
Value:
{ \
ExAcquirePushLockShared(&CmpCacheTable[(i)].Lock); \
}
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

Definition at line 108 of file cm_x.h.

◆ CmpAcquireNcbLockExclusive

#define CmpAcquireNcbLockExclusive (   n)
Value:
{ \
ExAcquirePushLockExclusive(&GET_HASH_ENTRY(CmpNameCacheTable, \
(n)->ConvKey)->Lock); \
}
PCM_NAME_HASH_TABLE_ENTRY CmpNameCacheTable
Definition: cmkcbncb.c:19
GLdouble n
Definition: glext.h:7729

Definition at line 232 of file cm_x.h.

◆ CmpAcquireNcbLockExclusiveByKey

#define CmpAcquireNcbLockExclusiveByKey (   k)
Value:
{ \
ExAcquirePushLockExclusive(&GET_HASH_ENTRY(CmpNameCacheTable, \
(k))->Lock); \
}

Definition at line 241 of file cm_x.h.

◆ CmpGetAllocPageFromDelayAlloc

#define CmpGetAllocPageFromDelayAlloc (   a)     (PCM_ALLOC_PAGE)(((ULONG_PTR)(a)) & ~(PAGE_SIZE - 1))

Definition at line 293 of file cm_x.h.

◆ CmpGetAllocPageFromKcb

#define CmpGetAllocPageFromKcb (   k)     (PCM_ALLOC_PAGE)(((ULONG_PTR)(k)) & ~(PAGE_SIZE - 1))

Definition at line 287 of file cm_x.h.

◆ CmpIsKcbLockedExclusive

#define CmpIsKcbLockedExclusive (   k)
Value:
(k)->ConvKey)->Owner == KeGetCurrentThread())

Definition at line 101 of file cm_x.h.

◆ CmpReleaseNcbLock

#define CmpReleaseNcbLock (   k)
Value:
{ \
ExReleasePushLock(&GET_HASH_ENTRY(CmpNameCacheTable, \
(k)->ConvKey)->Lock); \
}

Definition at line 250 of file cm_x.h.

◆ CmpReleaseNcbLockByKey

#define CmpReleaseNcbLockByKey (   k)
Value:
{ \
ExReleasePushLock(&GET_HASH_ENTRY(CmpNameCacheTable, \
(k))->Lock); \
}

Definition at line 259 of file cm_x.h.

◆ COMPUTE_HASH_CHAR

#define COMPUTE_HASH_CHAR (   ConvKey,
  Char 
)     (37 * ConvKey + RtlUpcaseUnicodeChar(Char))

Definition at line 31 of file cm_x.h.

◆ GET_HASH_ENTRY

#define GET_HASH_ENTRY (   Table,
  ConvKey 
)     (&Table[GET_HASH_INDEX(ConvKey)])

Definition at line 39 of file cm_x.h.

◆ GET_HASH_INDEX

#define GET_HASH_INDEX (   ConvKey)     (GET_HASH_KEY(ConvKey) % CmpHashTableSize)

Definition at line 37 of file cm_x.h.

◆ GET_HASH_KEY

#define GET_HASH_KEY (   ConvKey)     ((CMP_HASH_IRRATIONAL * (ConvKey)) % CMP_HASH_PRIME)

Definition at line 25 of file cm_x.h.

Function Documentation

◆ CmpAcquireKcbLockExclusive()

FORCEINLINE VOID CmpAcquireKcbLockExclusive ( PCM_KEY_CONTROL_BLOCK  Kcb)

Definition at line 133 of file cm_x.h.

134{
136}
FORCEINLINE VOID CmpAcquireKcbLockExclusiveByIndex(ULONG Index)
Definition: cm_x.h:118
#define GET_HASH_INDEX(ConvKey)
Definition: cm_x.h:37

Referenced by CmDeleteValueKey(), CmpConvertKcbSharedToExclusive(), CmpCreateKeyControlBlock(), CmpDereferenceKeyControlBlock(), CmpSecurityMethod(), DelistKeyBodyFromKCB(), and EnlistKeyBodyWithKCB().

◆ CmpAcquireKcbLockExclusiveByIndex()

FORCEINLINE VOID CmpAcquireKcbLockExclusiveByIndex ( ULONG  Index)

Definition at line 118 of file cm_x.h.

119{
123#if DBG
124 CmpCaptureLockBackTraceByIndex(Index);
125#endif
126}
FORCEINLINE VOID ExAcquirePushLockExclusive(PEX_PUSH_LOCK PushLock)
Definition: ex.h:1036
PKTHREAD Owner
Definition: cm.h:161
_In_ WDFCOLLECTION _In_ ULONG Index

Referenced by CmpAcquireKcbLockExclusive(), CmpAcquireKcbLockExclusiveByKey(), CmpDoOpen(), and CmpLockKcbArray().

◆ CmpAcquireKcbLockExclusiveByKey()

FORCEINLINE VOID CmpAcquireKcbLockExclusiveByKey ( IN ULONG  ConvKey)

Definition at line 143 of file cm_x.h.

Referenced by _Function_class_(), and CmpAcquireTwoKcbLocksExclusiveByKey().

◆ CmpAcquireKcbLockSharedByKey()

FORCEINLINE VOID CmpAcquireKcbLockSharedByKey ( _In_ ULONG  ConvKey)

Definition at line 153 of file cm_x.h.

155{
157}
#define CmpAcquireKcbLockSharedByIndex(i)
Definition: cm_x.h:108

◆ CmpConvertKcbSharedToExclusive()

FORCEINLINE VOID CmpConvertKcbSharedToExclusive ( IN PCM_KEY_CONTROL_BLOCK  k)

Definition at line 222 of file cm_x.h.

223{
227}
FORCEINLINE VOID CmpAcquireKcbLockExclusive(PCM_KEY_CONTROL_BLOCK Kcb)
Definition: cm_x.h:133
FORCEINLINE VOID CmpReleaseKcbLock(PCM_KEY_CONTROL_BLOCK Kcb)
Definition: cm_x.h:202
#define FALSE
Definition: types.h:117

Referenced by CmEnumerateValueKey(), CmpReferenceKeyControlBlock(), CmQueryValueKey(), and CmSetValueKey().

◆ CmpReleaseKcbLock()

◆ CmpReleaseKcbLockByIndex()

FORCEINLINE VOID CmpReleaseKcbLockByIndex ( ULONG  Index)

Definition at line 191 of file cm_x.h.

192{
195}
#define NULL
Definition: types.h:112
FORCEINLINE VOID ExReleasePushLock(PEX_PUSH_LOCK PushLock)
Definition: ex.h:1296

Referenced by CmpReleaseKcbLock(), CmpReleaseKcbLockByKey(), and CmpUnLockKcbArray().

◆ CmpReleaseKcbLockByKey()

FORCEINLINE VOID CmpReleaseKcbLockByKey ( ULONG  ConvKey)

◆ CmpTryToConvertKcbSharedToExclusive()

FORCEINLINE BOOLEAN CmpTryToConvertKcbSharedToExclusive ( IN PCM_KEY_CONTROL_BLOCK  k)

Definition at line 173 of file cm_x.h.

174{
177 &GET_HASH_ENTRY(CmpCacheTable, k->ConvKey)->Lock))
178 {
180 k->ConvKey)->Owner = KeGetCurrentThread();
181 return TRUE;
182 }
183 return FALSE;
184}
FORCEINLINE BOOLEAN ExConvertPushLockSharedToExclusive(IN PEX_PUSH_LOCK PushLock)
Definition: ex.h:1139

Referenced by CmpCompareNewValueDataAgainstKCBCache(), CmpGetValueListFromCache(), CmpReferenceKeyControlBlock(), and CmSetValueKey().