ReactOS 0.4.15-dev-7897-g78dc504
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 82 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 28 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 67 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 74 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 282 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:26
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:1597

Definition at line 251 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:88

Definition at line 261 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 52 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 59 of file cm_x.h.

◆ CMP_GET_CACHED_CELL

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

Definition at line 40 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 42 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 44 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 46 of file cm_x.h.

◆ CMP_IS_CELL_CACHED

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

Definition at line 34 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 145 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 95 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 215 of file cm_x.h.

◆ CmpAcquireNcbLockExclusiveByKey

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

Definition at line 224 of file cm_x.h.

◆ CmpGetAllocPageFromDelayAlloc

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

Definition at line 276 of file cm_x.h.

◆ CmpGetAllocPageFromKcb

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

Definition at line 270 of file cm_x.h.

◆ CmpIsKcbLockedExclusive

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

Definition at line 88 of file cm_x.h.

◆ CmpReleaseNcbLock

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

Definition at line 233 of file cm_x.h.

◆ CmpReleaseNcbLockByKey

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

Definition at line 242 of file cm_x.h.

◆ COMPUTE_HASH_CHAR

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

Definition at line 18 of file cm_x.h.

◆ GET_HASH_ENTRY

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

Definition at line 26 of file cm_x.h.

◆ GET_HASH_INDEX

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

Definition at line 24 of file cm_x.h.

◆ GET_HASH_KEY

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

Definition at line 12 of file cm_x.h.

Function Documentation

◆ CmpAcquireKcbLockExclusive()

FORCEINLINE VOID CmpAcquireKcbLockExclusive ( PCM_KEY_CONTROL_BLOCK  Kcb)

◆ CmpAcquireKcbLockExclusiveByIndex()

FORCEINLINE VOID CmpAcquireKcbLockExclusiveByIndex ( ULONG  Index)

Definition at line 105 of file cm_x.h.

106{
109}
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 126 of file cm_x.h.

Referenced by _Function_class_(), and CmpAcquireTwoKcbLocksExclusiveByKey().

◆ CmpAcquireKcbLockSharedByKey()

FORCEINLINE VOID CmpAcquireKcbLockSharedByKey ( _In_ ULONG  ConvKey)

Definition at line 136 of file cm_x.h.

138{
140}
#define CmpAcquireKcbLockSharedByIndex(i)
Definition: cm_x.h:95

◆ CmpConvertKcbSharedToExclusive()

FORCEINLINE VOID CmpConvertKcbSharedToExclusive ( IN PCM_KEY_CONTROL_BLOCK  k)

Definition at line 205 of file cm_x.h.

206{
210}
FORCEINLINE VOID CmpAcquireKcbLockExclusive(PCM_KEY_CONTROL_BLOCK Kcb)
Definition: cm_x.h:116
FORCEINLINE VOID CmpReleaseKcbLock(PCM_KEY_CONTROL_BLOCK Kcb)
Definition: cm_x.h:185
#define FALSE
Definition: types.h:117

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

◆ CmpReleaseKcbLock()

◆ CmpReleaseKcbLockByIndex()

FORCEINLINE VOID CmpReleaseKcbLockByIndex ( ULONG  Index)

Definition at line 174 of file cm_x.h.

175{
178}
#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 156 of file cm_x.h.

157{
160 &GET_HASH_ENTRY(CmpCacheTable, k->ConvKey)->Lock))
161 {
163 k->ConvKey)->Owner = KeGetCurrentThread();
164 return TRUE;
165 }
166 return FALSE;
167}
FORCEINLINE BOOLEAN ExConvertPushLockSharedToExclusive(IN PEX_PUSH_LOCK PushLock)
Definition: ex.h:1139

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