7#if defined(UDF_DBG) || defined(PRINT_ALWAYS)
14ULONG UdfTimeStamp = -1;
25 UDFPrint((
"Res:Sha:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",
Resource,
55 UDFPrint((
"Res:Sha:Fail:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",
Resource,
70 UDFPrint((
"Res:Sha*:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",
Resource,
93 UDFPrint((
"Res:Sha*:Ok:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",
Resource,
100 UDFPrint((
"Res:Sha*:Fail:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",
Resource,
114#ifdef TRACK_RESOURCES
115 UDFPrint((
"Res:Exc:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",
Resource,
140#ifdef TRACK_RESOURCES
141 UDFPrint((
"Res:Exc:OK:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",
Resource,
147#ifdef TRACK_RESOURCES
148 UDFPrint((
"Res:Exc:Fail:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",
Resource,
165#ifdef TRACK_RESOURCES
166 UDFPrint((
"Res:Free:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",
Resource,
170#ifdef TRACK_RESOURCES
171 UDFPrint((
"Res:Free:Ok:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",
Resource,
186#ifdef TRACK_RESOURCES
187 UDFPrint((
"Res:Del:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",
Resource,
198#ifdef TRACK_RESOURCES
199 UDFPrint((
"Res:Del:Ok:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",
Resource,
215#ifdef TRACK_RESOURCES
216 UDFPrint((
"Res:Ini:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",
Resource,
222#ifdef TRACK_RESOURCES
223 UDFPrint((
"Res:Ini:Ok:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",
Resource,
241#ifdef TRACK_RESOURCES
242 UDFPrint((
"Res:2Sha:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",
Resource,
246#ifdef TRACK_RESOURCES
247 UDFPrint((
"Res:2Sha:Ok:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",
Resource,
260#ifdef TRACK_RESOURCES
261 UDFPrint((
"Res:Sha*:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",
Resource,
284#ifdef TRACK_RESOURCES
285 UDFPrint((
"Res:Sha*:OK:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",
Resource,
290#ifdef TRACK_RESOURCES
291 UDFPrint((
"Res:Sha*:Fail:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",
Resource,
306#ifdef TRACK_REF_COUNTERS
309 UDFPrint((
"ThId:%x:Ilck:Inc:FileId:%x:Line:%d:Ref:%x:Val:%x:%x\n",
323#ifdef TRACK_REF_COUNTERS
326 UDFPrint((
"ThId:%x:Ilck:Dec:FileId:%x:Line:%d:Ref:%x:Val:%x:%x\n",
341#ifdef TRACK_REF_COUNTERS
344 UDFPrint((
"ThId:%x:Ilck:Add:FileId:%x:Line:%d:Ref:%x:Val:%x:%x\n",
352#define MAX_MEM_DEBUG_DESCRIPTORS 8192
354typedef struct _MEM_DESC {
357#ifdef TRACK_SYS_ALLOC_CALLERS
362} MEM_DESC, *PMEM_DESC;
365MEM_DESC MemDesc[MAX_MEM_DEBUG_DESCRIPTORS];
367ULONG AllocCountPaged = 0;
368ULONG AllocCountNPaged = 0;
369ULONG MemDescInited = 0;
375#ifdef TRACK_SYS_ALLOC_CALLERS
386 for (
i=0;
i<cur_max;
i++) {
387 if (MemDesc[
i].Addr==
NULL) {
392 if(MemDesc[
i].Addr) {
394 AllocCountPaged += (
size+7) & ~7;
396 AllocCountNPaged += (
size+7) & ~7;
400 MemDesc[
i].Length =
size;
401 MemDesc[
i].Type =
Type;
402#ifdef TRACK_SYS_ALLOC_CALLERS
403 MemDesc[
i].SrcId = SrcId;
404 MemDesc[
i].SrcLine = SrcLine;
406 return MemDesc[
i].Addr;
409 if(cur_max == MAX_MEM_DEBUG_DESCRIPTORS) {
410 UDFPrint((
"Debug memory descriptor list full\n"));
416 if(MemDesc[
i].Addr) {
418 AllocCountPaged += (
size+7) & ~7;
420 AllocCountNPaged += (
size+7) & ~7;
424 MemDesc[
i].Length = (
size);
425#ifdef TRACK_SYS_ALLOC_CALLERS
426 MemDesc[
i].SrcId = SrcId;
427 MemDesc[
i].SrcLine = SrcLine;
429 MemDesc[
i].Type =
Type;
431 return MemDesc[cur_max-1].Addr;
440 for (
i=0;
i<cur_max;
i++) {
441 if (MemDesc[
i].Addr ==
addr) {
444 AllocCountPaged -= (MemDesc[
i].Length+7) & ~7;
446 AllocCountNPaged -= (MemDesc[
i].Length+7) & ~7;
449 MemDesc[
i].Addr =
NULL;
450 MemDesc[
i].Length = 0;
451#ifdef TRACK_SYS_ALLOC_CALLERS
452 MemDesc[
i].SrcId = 0;
453 MemDesc[
i].SrcLine = 0;
458 if (
i==cur_max && cur_max != MAX_MEM_DEBUG_DESCRIPTORS) {
459 UDFPrint((
"Buug! - Deallocating nonallocated block\n"));
468UDFWaitForSingleObject(
473 UDFPrint((
"UDFWaitForSingleObject\n"));
479 else LocalTimeout.
QuadPart = 0x7FFFFFFFFFFFFFFFLL;
#define InterlockedIncrement
#define InterlockedDecrement
_Acquires_exclusive_lock_ Resource _Acquires_shared_lock_ Resource _Inout_ PERESOURCE Resource
VOID DLDAcquireShared(PERESOURCE Resource, ULONG BugCheckId, ULONG Line, BOOLEAN WaitForExclusive)
VOID DLDAcquireExclusive(PERESOURCE Resource, ULONG BugCheckId, ULONG Line)
#define NT_SUCCESS(StatCode)
#define ExAllocatePoolWithTag(hernya, size, tag)
#define ExReleaseResourceForThreadLite(res, thrdID)
#define PsGetCurrentThread()
NTSTATUS ExInitializeResourceLite(PULONG res)
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
#define ExConvertExclusiveToSharedLite(res)
#define KeGetCurrentIrql()
#define ExAcquireResourceExclusiveLite(res, wait)
#define ExDeleteResourceLite(res)
#define KeDelayExecutionThread(mode, foo, t)
#define ExAcquireResourceSharedLite(res, wait)
GLenum const GLvoid * addr
GLboolean GLboolean GLboolean GLboolean a
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
#define EXCEPTION_EXECUTE_HANDLER
#define InterlockedExchangeAdd
_In_ ULONG _In_ ULONG _In_ ULONG Length
BOOLEAN NTAPI ExAcquireSharedWaitForExclusive(IN PERESOURCE Resource, IN BOOLEAN Wait)
VOID UDFDebugConvertExclusiveToSharedLite(IN PERESOURCE Resource, IN ERESOURCE_THREAD ResourceThreadId, ULONG BugCheckId, ULONG Line)
BOOLEAN UDFDebugAcquireResourceExclusiveLite(IN PERESOURCE Resource, IN BOOLEAN Wait, ULONG BugCheckId, ULONG Line)
LONG UDFDebugInterlockedIncrement(IN PLONG addr, ULONG BugCheckId, ULONG Line)
NTSTATUS UDFDebugInitializeResourceLite(IN PERESOURCE Resource, IN ERESOURCE_THREAD ResourceThreadId, ULONG BugCheckId, ULONG Line)
LONG UDFDebugInterlockedDecrement(IN PLONG addr, ULONG BugCheckId, ULONG Line)
VOID UDFDebugDeleteResource(IN PERESOURCE Resource, IN ERESOURCE_THREAD ResourceThreadId, ULONG BugCheckId, ULONG Line)
LONG UDFDebugInterlockedExchangeAdd(IN PLONG addr, IN LONG i, ULONG BugCheckId, ULONG Line)
BOOLEAN UDFDebugAcquireResourceSharedLite(IN PERESOURCE Resource, IN BOOLEAN Wait, ULONG BugCheckId, ULONG Line)
BOOLEAN UDFDebugAcquireSharedWaitForExclusive(IN PERESOURCE Resource, IN BOOLEAN Wait, ULONG BugCheckId, ULONG Line)
VOID UDFDebugReleaseResourceForThreadLite(IN PERESOURCE Resource, IN ERESOURCE_THREAD ResourceThreadId, ULONG BugCheckId, ULONG Line)
BOOLEAN UDFDebugAcquireSharedStarveExclusive(IN PERESOURCE Resource, IN BOOLEAN Wait, ULONG BugCheckId, ULONG Line)
#define _SEH2_EXCEPT(...)
NTSTATUS DbgWaitForSingleObject_(IN PVOID Object, IN PLARGE_INTEGER Timeout OPTIONAL)
PULONG MinorVersion OPTIONAL
#define RtlZeroMemory(Destination, Length)
#define STATUS_INVALID_PARAMETER
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
_In_ WDFDPC _In_ BOOLEAN Wait
_In_ ERESOURCE_THREAD ResourceThreadId
ULONG_PTR ERESOURCE_THREAD