Author: pschweitzer
Date: Sun Mar 20 18:33:54 2016
New Revision: 71030
URL:
http://svn.reactos.org/svn/reactos?rev=71030&view=rev
Log:
[NTOSKRNL]
Implement in a really simple way CcSetBcbOwnerPointer() and CcUnpinDataForThread(). They
don't do everything the Windows Cc does, but at least, they do the basic job.
CORE-10996
Modified:
trunk/reactos/ntoskrnl/cc/cacheman.c
trunk/reactos/ntoskrnl/cc/pin.c
trunk/reactos/ntoskrnl/include/internal/cc.h
Modified: trunk/reactos/ntoskrnl/cc/cacheman.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/cacheman.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/cc/cacheman.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cc/cacheman.c [iso-8859-1] Sun Mar 20 18:33:54 2016
@@ -117,10 +117,14 @@
IN PVOID Owner
)
{
+ PINTERNAL_BCB iBcb = Bcb;
+
CCTRACE(CC_API_DEBUG, "Bcb=%p Owner=%p\n",
Bcb, Owner);
- UNIMPLEMENTED;
+ if (iBcb->OwnerPointer)
+ DPRINT1("OwnerPointer was already set?! Old: %p, New: %p\n",
iBcb->OwnerPointer, Owner);
+ iBcb->OwnerPointer = Owner;
}
/*
Modified: trunk/reactos/ntoskrnl/cc/pin.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/pin.c?rev=7103…
==============================================================================
--- trunk/reactos/ntoskrnl/cc/pin.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cc/pin.c [iso-8859-1] Sun Mar 20 18:33:54 2016
@@ -242,9 +242,17 @@
IN PVOID Bcb,
IN ERESOURCE_THREAD ResourceThreadId)
{
+ PINTERNAL_BCB iBcb = Bcb;
+
CCTRACE(CC_API_DEBUG, "Bcb=%p ResourceThreadId=%lu\n", Bcb,
ResourceThreadId);
- UNIMPLEMENTED;
+ if (iBcb->OwnerPointer != (PVOID)ResourceThreadId)
+ {
+ DPRINT1("Invalid owner! Caller: %p, Owner: %p\n",
(PVOID)ResourceThreadId, iBcb->OwnerPointer);
+ return;
+ }
+
+ return CcUnpinData(Bcb);
}
/*
Modified: trunk/reactos/ntoskrnl/include/internal/cc.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/cc.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/cc.h [iso-8859-1] Sun Mar 20 18:33:54 2016
@@ -194,6 +194,7 @@
PROS_VACB Vacb;
BOOLEAN Dirty;
CSHORT RefCount; /* (At offset 0x34 on WinNT4) */
+ PVOID OwnerPointer;
} INTERNAL_BCB, *PINTERNAL_BCB;
VOID