mirror of
https://github.com/reactos/reactos.git
synced 2026-06-08 17:02:56 +08:00
[NTOS:MM] Save caller address when tracing PFNs
This commit is contained in:
committed by
Jérôme Gardou
parent
aae161d061
commit
146337cc50
@@ -275,7 +275,7 @@ void
|
||||
MI_SET_PROCESS_USTR(PUNICODE_STRING ustr)
|
||||
{
|
||||
PWSTR pos, strEnd;
|
||||
int i;
|
||||
ULONG i;
|
||||
|
||||
if (!ustr->Buffer || ustr->Length == 0)
|
||||
{
|
||||
@@ -407,6 +407,7 @@ typedef struct _MMPFN
|
||||
MI_PFN_USAGES PfnUsage;
|
||||
CHAR ProcessName[16];
|
||||
#define MI_SET_PFN_PROCESS_NAME(pfn, x) memcpy(pfn->ProcessName, x, min(sizeof(x), sizeof(pfn->ProcessName)))
|
||||
PVOID CallSite;
|
||||
#endif
|
||||
|
||||
// HACK until WS lists are supported
|
||||
|
||||
@@ -254,6 +254,7 @@ MiUnlinkFreeOrZeroedPage(IN PMMPFN Entry)
|
||||
ASSERT(MI_PFN_CURRENT_USAGE != MI_USAGE_NOT_SET);
|
||||
Entry->PfnUsage = MI_PFN_CURRENT_USAGE;
|
||||
memcpy(Entry->ProcessName, MI_PFN_CURRENT_PROCESS_NAME, 16);
|
||||
Entry->CallSite = _ReturnAddress();
|
||||
MI_PFN_CURRENT_USAGE = MI_USAGE_NOT_SET;
|
||||
MI_SET_PROCESS2("Not Set");
|
||||
#endif
|
||||
@@ -462,6 +463,7 @@ MiRemovePageByColor(IN PFN_NUMBER PageIndex,
|
||||
ASSERT(MI_PFN_CURRENT_USAGE != MI_USAGE_NOT_SET);
|
||||
Pfn1->PfnUsage = MI_PFN_CURRENT_USAGE;
|
||||
memcpy(Pfn1->ProcessName, MI_PFN_CURRENT_PROCESS_NAME, 16);
|
||||
Pfn1->CallSite = _ReturnAddress();
|
||||
MI_PFN_CURRENT_USAGE = MI_USAGE_NOT_SET;
|
||||
MI_SET_PROCESS2("Not Set");
|
||||
#endif
|
||||
@@ -710,6 +712,7 @@ MiInsertPageInFreeList(IN PFN_NUMBER PageFrameIndex)
|
||||
#if MI_TRACE_PFNS
|
||||
Pfn1->PfnUsage = MI_USAGE_FREE_PAGE;
|
||||
RtlZeroMemory(Pfn1->ProcessName, 16);
|
||||
Pfn1->CallSite = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -940,6 +943,7 @@ MiInsertPageInList(IN PMMPFNLIST ListHead,
|
||||
ASSERT(MI_PFN_CURRENT_USAGE == MI_USAGE_NOT_SET);
|
||||
Pfn1->PfnUsage = MI_USAGE_FREE_PAGE;
|
||||
RtlZeroMemory(Pfn1->ProcessName, 16);
|
||||
Pfn1->CallSite = NULL;
|
||||
#endif
|
||||
}
|
||||
else if (ListName == ModifiedPageList)
|
||||
|
||||
Reference in New Issue
Block a user