ReactOS 0.4.16-dev-197-g92996da
trace.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Run-Time Library
3 * LICENSE: BSD - See COPYING.ARM in the top level directory
4 * PURPOSE: Rtl Trace Routines
5 */
6
7/* INCLUDES *******************************************************************/
8
9#include <rtl.h>
10#define NDEBUG
11#include <debug.h>
12
15
16/* FUNCTIONS ******************************************************************/
17
21{
22 /* Just return a pointer to an array, according to MSDN */
24}
25
26VOID
29{
30 PIMAGE_NT_HEADERS NtHeaders;
33 USHORT StringLen;
34
35 DPRINT("LdrpRecordUnloadEvent(%wZ, %p - %p)\n", &LdrEntry->BaseDllName, LdrEntry->DllBase,
36 (ULONG_PTR)LdrEntry->DllBase + LdrEntry->SizeOfImage);
37
38 RtlpUnloadEventTrace[Index].BaseAddress = LdrEntry->DllBase;
39 RtlpUnloadEventTrace[Index].SizeOfImage = LdrEntry->SizeOfImage;
41
42 NtHeaders = RtlImageNtHeader(LdrEntry->DllBase);
43
44 if (NtHeaders)
45 {
48 }
49 else
50 {
53 }
54
55 StringLen = min(LdrEntry->BaseDllName.Length / sizeof(WCHAR), RTL_NUMBER_OF(RtlpUnloadEventTrace[Index].ImageName));
56 RtlCopyMemory(RtlpUnloadEventTrace[Index].ImageName, LdrEntry->BaseDllName.Buffer, StringLen * sizeof(WCHAR));
58 RtlpUnloadEventTrace[Index].ImageName[StringLen] = 0;
59}
60
65 IN PVOID *Trace,
66 OUT OPTIONAL PRTL_TRACE_BLOCK *TraceBlock)
67{
69 return FALSE;
70}
71
77 IN ULONG Tag,
79{
81 return NULL;
82}
83
87{
89 return FALSE;
90}
91
95 IN PRTL_TRACE_ENUMERATE TraceEnumerate,
96 IN OUT PRTL_TRACE_BLOCK *TraceBlock)
97{
99 return FALSE;
100}
101
102
104NTAPI
106 IN ULONG Count,
107 IN PVOID *Trace,
108 OUT OPTIONAL PRTL_TRACE_BLOCK *TraceBlock)
109{
111 return FALSE;
112}
113
115NTAPI
117{
119 return FALSE;
120}
121
123NTAPI
125{
127 return FALSE;
128}
129
131NTAPI
133{
135 return FALSE;
136}
unsigned char BOOLEAN
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
#define UNIMPLEMENTED
Definition: debug.h:118
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define RtlImageNtHeader
Definition: compat.h:806
#define Trace(x)
Definition: inflate.c:42
static const char * ImageName
Definition: image.c:34
#define min(a, b)
Definition: monoChain.cc:55
#define _In_
Definition: ms_sal.h:308
unsigned int UINT
Definition: ndis.h:50
_In_ ACCESS_MASK _In_opt_ POBJECT_ATTRIBUTES _In_opt_ PLARGE_INTEGER MaximumSize
Definition: mmfuncs.h:362
ULONG(NTAPI * RTL_TRACE_HASH_FUNCTION)(ULONG Count, PVOID *Trace)
Definition: rtltypes.h:1812
#define RTL_UNLOAD_EVENT_TRACE_NUMBER
Definition: rtltypes.h:1231
int Count
Definition: noreturn.cpp:7
unsigned short USHORT
Definition: pedump.c:61
BOOLEAN NTAPI RtlTraceDatabaseDestroy(IN PRTL_TRACE_DATABASE Database)
Definition: trace.c:86
BOOLEAN NTAPI RtlTraceDatabaseLock(IN PRTL_TRACE_DATABASE Database)
Definition: trace.c:116
static RTL_UNLOAD_EVENT_TRACE RtlpUnloadEventTrace[RTL_UNLOAD_EVENT_TRACE_NUMBER]
Definition: trace.c:13
BOOLEAN NTAPI RtlTraceDatabaseValidate(IN PRTL_TRACE_DATABASE Database)
Definition: trace.c:132
BOOLEAN NTAPI RtlTraceDatabaseFind(IN PRTL_TRACE_DATABASE Database, IN ULONG Count, IN PVOID *Trace, OUT OPTIONAL PRTL_TRACE_BLOCK *TraceBlock)
Definition: trace.c:105
BOOLEAN NTAPI RtlTraceDatabaseUnlock(IN PRTL_TRACE_DATABASE Database)
Definition: trace.c:124
PRTL_TRACE_DATABASE NTAPI RtlTraceDatabaseCreate(IN ULONG Buckets, IN OPTIONAL SIZE_T MaximumSize, IN ULONG Flags, IN ULONG Tag, IN OPTIONAL RTL_TRACE_HASH_FUNCTION HashFunction)
Definition: trace.c:74
BOOLEAN NTAPI RtlTraceDatabaseEnumerate(IN PRTL_TRACE_DATABASE Database, IN PRTL_TRACE_ENUMERATE TraceEnumerate, IN OUT PRTL_TRACE_BLOCK *TraceBlock)
Definition: trace.c:94
static UINT RtlpUnloadEventTraceIndex
Definition: trace.c:14
PRTL_UNLOAD_EVENT_TRACE NTAPI RtlGetUnloadEventTrace(VOID)
Definition: trace.c:20
VOID NTAPI LdrpRecordUnloadEvent(_In_ PLDR_DATA_TABLE_ENTRY LdrEntry)
Definition: trace.c:28
BOOLEAN NTAPI RtlTraceDatabaseAdd(IN PRTL_TRACE_DATABASE Database, IN ULONG Count, IN PVOID *Trace, OUT OPTIONAL PRTL_TRACE_BLOCK *TraceBlock)
Definition: trace.c:63
#define DPRINT
Definition: sndvol32.h:73
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
IMAGE_OPTIONAL_HEADER32 OptionalHeader
Definition: ntddk_ex.h:184
IMAGE_FILE_HEADER FileHeader
Definition: ntddk_ex.h:183
Definition: btrfs_drv.h:1876
#define NTAPI
Definition: typedefs.h:36
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4065
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
__wchar_t WCHAR
Definition: xmlstorage.h:180