mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[NTOS:CC] Raise status, when CcMapData fails (#3348)
Also add a check in fastfat, that asserts, when CcMapData returns FALSE.
This commit is contained in:
parent
2b93352907
commit
ca74467904
2 changed files with 8 additions and 4 deletions
|
@ -36,7 +36,7 @@ FAT32GetNextCluster(
|
|||
PVOID BaseAddress;
|
||||
ULONG FATOffset;
|
||||
ULONG ChunkSize;
|
||||
PVOID Context;
|
||||
PVOID Context = NULL;
|
||||
LARGE_INTEGER Offset;
|
||||
|
||||
ChunkSize = CACHEPAGESIZE(DeviceExt);
|
||||
|
@ -44,7 +44,11 @@ FAT32GetNextCluster(
|
|||
Offset.QuadPart = ROUND_DOWN(FATOffset, ChunkSize);
|
||||
_SEH2_TRY
|
||||
{
|
||||
CcMapData(DeviceExt->FATFileObject, &Offset, ChunkSize, MAP_WAIT, &Context, &BaseAddress);
|
||||
if (!CcMapData(DeviceExt->FATFileObject, &Offset, ChunkSize, MAP_WAIT, &Context, &BaseAddress))
|
||||
{
|
||||
NT_ASSERT(FALSE);
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
|
|
|
@ -376,7 +376,6 @@ CcMapData (
|
|||
CCTRACE(CC_API_DEBUG, "FileObject=%p FileOffset=%p Length=%lu Flags=0x%lx -> FALSE\n",
|
||||
SharedCacheMap->FileObject, FileOffset, Length, Flags);
|
||||
ExRaiseStatus(Status);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
iBcb = CcpGetAppropriateBcb(SharedCacheMap, Vacb, FileOffset, Length, 0, FALSE);
|
||||
|
@ -385,7 +384,8 @@ CcMapData (
|
|||
CcRosReleaseVacb(SharedCacheMap, Vacb, FALSE, FALSE);
|
||||
CCTRACE(CC_API_DEBUG, "FileObject=%p FileOffset=%p Length=%lu Flags=0x%lx -> FALSE\n",
|
||||
SharedCacheMap->FileObject, FileOffset, Length, Flags);
|
||||
return FALSE;
|
||||
*pBcb = NULL; // If you ever remove this for compat, make sure to review all callers for using an unititialized value
|
||||
ExRaiseStatus(STATUS_INSUFFICIENT_RESOURCES);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue