https://git.reactos.org/?p=reactos.git;a=commitdiff;h=43836b0fbb1d67e6909dd…
commit 43836b0fbb1d67e6909dd6b97b5bb8b824733f37
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Fri Apr 27 18:57:30 2018 +0200
Commit: Pierre Schweitzer <pierre(a)reactos.org>
CommitDate: Fri Apr 27 18:57:30 2018 +0200
[NTOSKRNL] In !filecache, try to display FCB name
When no name is set in the file object, try to read the name
from the FCB. We only support FastFAT (ours) FCB for now.
This is clearly a hack, but for a kdbg command, so ;-)
---
ntoskrnl/cc/view.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/ntoskrnl/cc/view.c b/ntoskrnl/cc/view.c
index a0f0867080..0432f73a99 100644
--- a/ntoskrnl/cc/view.c
+++ b/ntoskrnl/cc/view.c
@@ -1463,6 +1463,7 @@ ExpKdbgExtFileCache(ULONG Argc, PCHAR Argv[])
ULONG Valid = 0, Dirty = 0;
PROS_SHARED_CACHE_MAP SharedCacheMap;
PUNICODE_STRING FileName;
+ PWSTR Extra = L"";
SharedCacheMap = CONTAINING_RECORD(ListEntry, ROS_SHARED_CACHE_MAP,
SharedCacheMapLinks);
@@ -1489,13 +1490,22 @@ ExpKdbgExtFileCache(ULONG Argc, PCHAR Argv[])
{
FileName = &SharedCacheMap->FileObject->FileName;
}
+ else if (SharedCacheMap->FileObject != NULL &&
+ SharedCacheMap->FileObject->FsContext != NULL &&
+
((PFSRTL_COMMON_FCB_HEADER)(SharedCacheMap->FileObject->FsContext))->NodeTypeCode
== 0x0502 &&
+
((PFSRTL_COMMON_FCB_HEADER)(SharedCacheMap->FileObject->FsContext))->NodeByteSize
== 0x1F8 &&
+ ((PUNICODE_STRING)(((PUCHAR)SharedCacheMap->FileObject->FsContext)
+ 0x100))->Length != 0)
+ {
+ FileName =
(PUNICODE_STRING)(((PUCHAR)SharedCacheMap->FileObject->FsContext) + 0x100);
+ Extra = L" (FastFAT)";
+ }
else
{
FileName = &NoName;
}
/* And print */
- KdbpPrint("%p\t%d\t%d\t%wZ\n", SharedCacheMap, Valid, Dirty,
FileName);
+ KdbpPrint("%p\t%d\t%d\t%wZ%S\n", SharedCacheMap, Valid, Dirty,
FileName, Extra);
}
return TRUE;