diff --git a/reactos/ntoskrnl/cc/copy.c b/reactos/ntoskrnl/cc/copy.c index e501682fd25..e8d7e581993 100644 --- a/reactos/ntoskrnl/cc/copy.c +++ b/reactos/ntoskrnl/cc/copy.c @@ -1,4 +1,4 @@ -/* $Id: copy.c,v 1.25 2004/06/19 08:53:35 vizzini Exp $ +/* $Id: copy.c,v 1.26 2004/06/20 02:10:07 vizzini Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -139,12 +139,7 @@ ReadCacheSegmentChain(PBCB Bcb, ULONG ReadOffset, ULONG Length, /* * Create an MDL which contains all their pages. */ - Mdl = MmCreateMdl(NULL, NULL, current_size); - if(Mdl == NULL) { - DPRINT("MmCreateMdl: Out of memory!"); - return(STATUS_NO_MEMORY); - } - + MmInitializeMdl(Mdl, NULL, current_size); Mdl->MdlFlags |= (MDL_PAGES_LOCKED | MDL_IO_PAGE_READ); current2 = current; offset = 0; @@ -227,14 +222,8 @@ ReadCacheSegment(PCACHE_SEGMENT CacheSeg) { Size = CacheSeg->Bcb->CacheSegmentSize; } - - Mdl = MmCreateMdl(NULL, CacheSeg->BaseAddress, Size); - if(Mdl == NULL) - { - DPRINT("MmCreateMdl: Out of memory!"); - return(STATUS_NO_MEMORY); - } - + Mdl = alloca(MmSizeOfMdl(CacheSeg->BaseAddress, Size)); + MmInitializeMdl(Mdl, CacheSeg->BaseAddress, Size); MmBuildMdlForNonPagedPool(Mdl); Mdl->MdlFlags |= MDL_IO_PAGE_READ; KeInitializeEvent(&Event, NotificationEvent, FALSE); @@ -275,14 +264,8 @@ WriteCacheSegment(PCACHE_SEGMENT CacheSeg) { Size = CacheSeg->Bcb->CacheSegmentSize; } - - Mdl = MmCreateMdl(NULL, CacheSeg->BaseAddress, Size); - if(Mdl == NULL) - { - DPRINT("MmCreateMdl: Out of memory!"); - return(STATUS_NO_MEMORY); - } - + Mdl = alloca(MmSizeOfMdl(CacheSeg->BaseAddress, Size)); + MmInitializeMdl(Mdl, CacheSeg->BaseAddress, Size); MmBuildMdlForNonPagedPool(Mdl); Mdl->MdlFlags |= MDL_IO_PAGE_READ; KeInitializeEvent(&Event, NotificationEvent, FALSE);