17#define MAX_STATIC_CS_DEBUG_OBJECTS 64
33#define CRITSECT_HAS_DEBUG_INFO(CriticalSection) \
34 (((CriticalSection)->DebugInfo != NULL) && \
35 ((CriticalSection)->DebugInfo != LongToPtr(-1)))
72 DPRINT1(
"Failed to Create Event!\n");
81 DPRINT(
"Created Event: %p\n", hNewEvent);
91 DPRINT(
"Closing already created event: %p\n", hNewEvent);
124 DPRINT(
"Waiting on Critical Section Event: %p %p\n",
228 DPRINT(
"Signaling Critical Section Event: %p, %p\n",
247 DPRINT1(
"Signaling Failed for: %p, %p, 0x%08lx\n",
355 DPRINT(
"Freeing from Buffer: %p. Entry: %Iu inside Process: %p\n",
362 else if (!DebugInfo->
Flags)
365 DPRINT(
"Freeing from Heap: %p inside Process: %p\n",
373 DPRINT(
"Assuming static: %p inside Process: %p\n",
599 if (
Flags & ~AllowedFlags)
625 DPRINT(
"Allocated Debug Data: %p inside Process: %p\n",
626 CritcalSectionDebugData,
629 if (!CritcalSectionDebugData)
641 CritcalSectionDebugData->
Flags = 0;
651 DPRINT(
"Securely Inserting into ProcessLocks: %p, %p, %p\n",
667 DPRINT(
"Inserting into ProcessLocks: %p, %p, %p\n",
704 SpinCount &= ~RTL_CRITICAL_SECTION_ALL_FLAG_BITS;
776 DPRINT1(
"Releasing critical section not owned!\n");
#define InterlockedIncrement
#define InterlockedDecrement
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
BOOLEAN LdrpShutdownInProgress
NTSTATUS NTAPI RtlLeaveCriticalSection(PRTL_CRITICAL_SECTION CriticalSection)
static BOOLEAN RtlpDebugInfoFreeList[MAX_STATIC_CS_DEBUG_OBJECTS]
NTSTATUS NTAPI RtlpWaitForCriticalSection(PRTL_CRITICAL_SECTION CriticalSection)
VOID NTAPI RtlpInitDeferredCriticalSection(VOID)
HANDLE LdrpShutdownThreadId
VOID NTAPI RtlpUnWaitCriticalSection(PRTL_CRITICAL_SECTION CriticalSection)
#define CRITSECT_HAS_DEBUG_INFO(CriticalSection)
NTSTATUS NTAPI RtlDeleteCriticalSection(PRTL_CRITICAL_SECTION CriticalSection)
ULONG NTAPI RtlIsCriticalSectionLockedByThread(PRTL_CRITICAL_SECTION CriticalSection)
LONG NTAPI RtlGetCriticalSectionRecursionCount(PRTL_CRITICAL_SECTION CriticalSection)
LARGE_INTEGER RtlpTimeout
VOID NTAPI RtlCheckForOrphanedCriticalSections(HANDLE ThreadHandle)
NTSTATUS NTAPI RtlInitializeCriticalSectionAndSpinCount(_Out_ PRTL_CRITICAL_SECTION CriticalSection, _In_ ULONG SpinCount)
#define MAX_STATIC_CS_DEBUG_OBJECTS
NTSTATUS NTAPI RtlInitializeCriticalSectionEx(_Out_ PRTL_CRITICAL_SECTION CriticalSection, _In_ ULONG SpinCount, _In_ ULONG Flags)
VOID NTAPI RtlpNotOwnerCriticalSection(PRTL_CRITICAL_SECTION CriticalSection)
ULONG NTAPI RtlIsCriticalSectionLocked(PRTL_CRITICAL_SECTION CriticalSection)
NTSTATUS NTAPI RtlInitializeCriticalSection(PRTL_CRITICAL_SECTION CriticalSection)
static BOOLEAN RtlpCritSectInitialized
BOOLEAN NTAPI RtlTryEnterCriticalSection(PRTL_CRITICAL_SECTION CriticalSection)
static RTL_CRITICAL_SECTION RtlCriticalSectionLock
static RTL_CRITICAL_SECTION_DEBUG RtlpStaticDebugInfo[MAX_STATIC_CS_DEBUG_OBJECTS]
ULONG NTAPI RtlSetCriticalSectionSpinCount(PRTL_CRITICAL_SECTION CriticalSection, ULONG SpinCount)
PRTL_CRITICAL_SECTION_DEBUG NTAPI RtlpAllocateDebugInfo(VOID)
VOID NTAPI RtlpFreeDebugInfo(PRTL_CRITICAL_SECTION_DEBUG DebugInfo)
BOOLEAN RtlpTimeoutDisable
static LIST_ENTRY RtlCriticalSectionList
NTSTATUS NTAPI RtlEnterCriticalSection(PRTL_CRITICAL_SECTION CriticalSection)
#define NT_SUCCESS(StatCode)
#define INVALID_HANDLE_VALUE
#define RemoveEntryList(Entry)
#define InsertTailList(ListHead, Entry)
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
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
NTSYSAPI NTSTATUS WINAPI NtWaitForKeyedEvent(HANDLE, const void *, BOOLEAN, const LARGE_INTEGER *)
NTSYSAPI NTSTATUS WINAPI NtReleaseKeyedEvent(HANDLE, const void *, BOOLEAN, const LARGE_INTEGER *)
#define InterlockedCompareExchangePointer
#define InterlockedCompareExchange
CRITICAL_SECTION CriticalSection
#define _At_(target, annos)
DECLSPEC_NORETURN NTSYSAPI VOID NTAPI RtlRaiseStatus(_In_ NTSTATUS Status)
NTSYSAPI VOID NTAPI RtlRaiseException(_In_ PEXCEPTION_RECORD ExceptionRecord)
#define RTL_CRITSECT_TYPE
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
NTSYSAPI NTSTATUS NTAPI NtWaitForSingleObject(IN HANDLE hObject, IN BOOLEAN bAlertable, IN PLARGE_INTEGER Timeout)
NTSTATUS NTAPI NtSetEvent(IN HANDLE EventHandle, OUT PLONG PreviousState OPTIONAL)
NTSTATUS NTAPI NtCreateEvent(OUT PHANDLE EventHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN EVENT_TYPE EventType, IN BOOLEAN InitialState)
#define STATUS_POSSIBLE_DEADLOCK
#define STATUS_INVALID_PARAMETER_2
#define STATUS_RESOURCE_NOT_OWNED
#define STATUS_INVALID_PARAMETER_3
#define ERROR_DBGBREAK(...)
#define _WIN32_WINNT_WIN7
LIST_ENTRY ProcessLocksList
PCRITICAL_SECTION_DEBUG DebugInfo
struct _EXCEPTION_RECORD * ExceptionRecord
ULONG_PTR ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]
LIST_ENTRY ProcessLocksList
struct _RTL_CRITICAL_SECTION * CriticalSection
#define RtlZeroMemory(Destination, Length)
#define STATUS_INVALID_PARAMETER
#define STATUS_UNSUCCESSFUL
#define RTL_CRITICAL_SECTION_FLAG_DYNAMIC_SPIN
#define RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO
#define RTL_CRITICAL_SECTION_FLAG_STATIC_INIT
#define RTL_CRITICAL_SECTION_FLAG_NO_DEBUG_INFO
#define RTL_CRITICAL_SECTION_FLAG_RESOURCE_TYPE
#define RTL_CRITICAL_SECTION_ALL_FLAG_BITS
_Must_inspect_result_ _In_ ULONG Flags
_Out_ PCLIENT_ID ClientId