1 /** 2 * This file has no copyright assigned and is placed in the Public Domain. 3 * This file is part of the mingw-w64 runtime package. 4 * No warranty is given; refer to the file DISCLAIMER.PD within this package. 5 */ 6 7 #ifndef _AVRFSDK_ 8 #define _AVRFSDK_ 9 10 #ifdef __cplusplus 11 extern "C" { 12 #endif 13 14 #define AVRF_MAX_TRACES 32 15 16 typedef struct _AVRF_BACKTRACE_INFORMATION { 17 ULONG Depth; 18 ULONG Index; 19 ULONG64 ReturnAddresses[AVRF_MAX_TRACES]; 20 } AVRF_BACKTRACE_INFORMATION, *PAVRF_BACKTRACE_INFORMATION; 21 22 enum eUserAllocationState { 23 AllocationStateUnknown, 24 AllocationStateBusy, 25 AllocationStateFree 26 }; 27 28 enum eHeapAllocationState { 29 HeapFullPageHeap = 0x40000000, 30 HeapMetadata = 0x80000000, 31 HeapStateMask = 0xffff0000, 32 }; 33 34 enum eHeapEnumerationLevel { 35 HeapEnumerationEverything = 0, 36 HeapEnumerationStop = 0xffffffff, 37 }; 38 39 typedef struct _AVRF_HEAP_ALLOCATION { 40 ULONG64 HeapHandle; 41 ULONG64 UserAllocation; 42 ULONG64 UserAllocationSize; 43 ULONG64 Allocation; 44 ULONG64 AllocationSize; 45 ULONG UserAllocationState; 46 ULONG HeapState; 47 ULONG64 HeapContext; 48 PAVRF_BACKTRACE_INFORMATION BackTraceInformation; 49 } AVRF_HEAP_ALLOCATION, *PAVRF_HEAP_ALLOCATION; 50 51 enum eHANDLE_TRACE_OPERATIONS { 52 OperationDbUnused, 53 OperationDbOPEN, 54 OperationDbCLOSE, 55 OperationDbBADREF 56 }; 57 58 typedef struct _AVRF_HANDLE_OPERATION { 59 ULONG64 Handle; 60 ULONG ProcessId; 61 ULONG ThreadId; 62 ULONG OperationType; 63 ULONG Spare0; 64 AVRF_BACKTRACE_INFORMATION BackTraceInformation; 65 } AVRF_HANDLE_OPERATION, *PAVRF_HANDLE_OPERATION; 66 67 enum eAvrfResourceTypes { 68 AvrfResourceHeapAllocation, 69 AvrfResourceHandleTrace, 70 AvrfResourceMax 71 }; 72 73 typedef ULONG (NTAPI *AVRF_RESOURCE_ENUMERATE_CALLBACK)(void*,void*,ULONG*); 74 typedef ULONG (NTAPI *AVRF_HEAPALLOCATION_ENUMERATE_CALLBACK)(AVRF_HEAP_ALLOCATION,void*,ULONG*); 75 typedef ULONG (NTAPI *AVRF_HANDLEOPERATION_ENUMERATE_CALLBACK)(AVRF_HANDLE_OPERATION*,void*,ULONG*); 76 77 #define AVRF_ENUM_RESOURCES_FLAGS_SUSPEND 0x0001 78 #define AVRF_ENUM_RESOURCES_FLAGS_DONT_RESOLVE_TRACES 0x0002 79 80 ULONG NTAPI VerifierEnumerateResource(HANDLE,ULONG,ULONG,AVRF_RESOURCE_ENUMERATE_CALLBACK,void*); 81 BOOL NTAPI VerifierIsPerUserSettingsEnabled(void); 82 83 #ifdef __cplusplus 84 } 85 #endif 86 87 #endif /* _AVRFSDK_ */ 88