Author: tfaber
Date: Sun Jul 10 14:46:37 2016
New Revision: 71883
URL:
http://svn.reactos.org/svn/reactos?rev=71883&view=rev
Log:
[NTOS:CC]
- Raise exceptions on failure in CcMapData if RAISE_FROM_CC_MAP_DATA is defined. This is
how the function should behave, and should be enabled once all our file system drivers
correctly handle this.
CORE-9848
Modified:
trunk/reactos/ntoskrnl/cc/pin.c
Modified: trunk/reactos/ntoskrnl/cc/pin.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/pin.c?rev=7188…
==============================================================================
--- trunk/reactos/ntoskrnl/cc/pin.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cc/pin.c [iso-8859-1] Sun Jul 10 14:46:37 2016
@@ -16,6 +16,8 @@
/* GLOBALS *******************************************************************/
+//#define RAISE_FROM_CC_MAP_DATA
+
extern NPAGED_LOOKASIDE_LIST iBcbLookasideList;
/* FUNCTIONS *****************************************************************/
@@ -62,7 +64,11 @@
{
CCTRACE(CC_API_DEBUG, "FileObject=%p FileOffset=%p Length=%lu Flags=0x%lx
-> FALSE\n",
FileObject, FileOffset, Length, Flags);
+#ifdef RAISE_FROM_CC_MAP_DATA
+ ExRaiseStatus(STATUS_INVALID_PARAMETER);
+#else
return FALSE;
+#endif
}
ROffset = ROUND_DOWN(ReadOffset, VACB_MAPPING_GRANULARITY);
@@ -75,7 +81,11 @@
{
CCTRACE(CC_API_DEBUG, "FileObject=%p FileOffset=%p Length=%lu Flags=0x%lx
-> FALSE\n",
FileObject, FileOffset, Length, Flags);
+#ifdef RAISE_FROM_CC_MAP_DATA
+ ExRaiseStatus(Status);
+#else
return FALSE;
+#endif
}
if (!Valid)
@@ -88,12 +98,17 @@
return FALSE;
}
- if (!NT_SUCCESS(CcReadVirtualAddress(Vacb)))
+ Status = CcReadVirtualAddress(Vacb);
+ if (!NT_SUCCESS(Status))
{
CcRosReleaseVacb(SharedCacheMap, Vacb, FALSE, FALSE, FALSE);
CCTRACE(CC_API_DEBUG, "FileObject=%p FileOffset=%p Length=%lu
Flags=0x%lx -> FALSE\n",
FileObject, FileOffset, Length, Flags);
+#ifdef RAISE_FROM_CC_MAP_DATA
+ ExRaiseStatus(Status);
+#else
return FALSE;
+#endif
}
}
@@ -104,7 +119,11 @@
CcRosReleaseVacb(SharedCacheMap, Vacb, TRUE, FALSE, FALSE);
CCTRACE(CC_API_DEBUG, "FileObject=%p FileOffset=%p Length=%lu Flags=0x%lx
-> FALSE\n",
FileObject, FileOffset, Length, Flags);
+#ifdef RAISE_FROM_CC_MAP_DATA
+ ExRaiseStatus(STATUS_INSUFFICIENT_RESOURCES);
+#else
return FALSE;
+#endif
}
RtlZeroMemory(iBcb, sizeof(*iBcb));