mirror of
https://github.com/reactos/reactos.git
synced 2024-10-06 17:35:07 +00:00
144 lines
2.5 KiB
C
144 lines
2.5 KiB
C
|
/*
|
|||
|
* COPYRIGHT: See COPYING in the top level directory
|
|||
|
* PROJECT: ReactOS Kernel
|
|||
|
* FILE: ntoskrnl/cache/logsup.c
|
|||
|
* PURPOSE: Logging and configuration routines
|
|||
|
* PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
|
|||
|
*/
|
|||
|
|
|||
|
/* INCLUDES *******************************************************************/
|
|||
|
|
|||
|
#include <ntoskrnl.h>
|
|||
|
#include "newcc.h"
|
|||
|
#define NDEBUG
|
|||
|
#include <debug.h>
|
|||
|
|
|||
|
/* GLOBALS ********************************************************************/
|
|||
|
|
|||
|
/* FUNCTIONS ******************************************************************/
|
|||
|
|
|||
|
|
|||
|
PMDL
|
|||
|
NTAPI
|
|||
|
CcpBuildCacheMdl
|
|||
|
(PFILE_OBJECT FileObject,
|
|||
|
PLARGE_INTEGER FileOffset,
|
|||
|
ULONG Length,
|
|||
|
PIO_STATUS_BLOCK IOSB)
|
|||
|
{
|
|||
|
PMDL Mdl;
|
|||
|
PVOID Bcb, Buffer;
|
|||
|
|
|||
|
BOOLEAN Result = CcMapData
|
|||
|
(FileObject,
|
|||
|
FileOffset,
|
|||
|
Length,
|
|||
|
PIN_WAIT,
|
|||
|
&Bcb,
|
|||
|
&Buffer);
|
|||
|
|
|||
|
if (!Result)
|
|||
|
{
|
|||
|
IOSB->Information = 0;
|
|||
|
IOSB->Status = STATUS_UNSUCCESSFUL;
|
|||
|
return NULL;
|
|||
|
}
|
|||
|
|
|||
|
IOSB->Information = Length;
|
|||
|
IOSB->Status = STATUS_SUCCESS;
|
|||
|
|
|||
|
Mdl = IoAllocateMdl
|
|||
|
(Buffer,
|
|||
|
Length,
|
|||
|
FALSE,
|
|||
|
FALSE,
|
|||
|
NULL);
|
|||
|
|
|||
|
if (!Mdl)
|
|||
|
{
|
|||
|
IOSB->Information = 0;
|
|||
|
IOSB->Status = STATUS_NO_MEMORY;
|
|||
|
return NULL;
|
|||
|
}
|
|||
|
|
|||
|
IOSB->Information = Length;
|
|||
|
IOSB->Status = STATUS_SUCCESS;
|
|||
|
|
|||
|
return Mdl;
|
|||
|
}
|
|||
|
|
|||
|
VOID
|
|||
|
NTAPI
|
|||
|
CcMdlRead(IN PFILE_OBJECT FileObject,
|
|||
|
IN PLARGE_INTEGER FileOffset,
|
|||
|
IN ULONG Length,
|
|||
|
OUT PMDL *MdlChain,
|
|||
|
OUT PIO_STATUS_BLOCK IoStatus)
|
|||
|
{
|
|||
|
*MdlChain = CcpBuildCacheMdl
|
|||
|
(FileObject,
|
|||
|
FileOffset,
|
|||
|
Length,
|
|||
|
IoStatus);
|
|||
|
}
|
|||
|
|
|||
|
VOID
|
|||
|
NTAPI
|
|||
|
CcMdlReadComplete(IN PFILE_OBJECT FileObject,
|
|||
|
IN PMDL MdlChain)
|
|||
|
{
|
|||
|
IoFreeMdl(MdlChain);
|
|||
|
}
|
|||
|
|
|||
|
VOID
|
|||
|
NTAPI
|
|||
|
CcMdlReadComplete2(IN PMDL MdlChain,
|
|||
|
IN PFILE_OBJECT FileObject)
|
|||
|
{
|
|||
|
DPRINT("Not sure\n");
|
|||
|
}
|
|||
|
|
|||
|
VOID
|
|||
|
NTAPI
|
|||
|
CcPrepareMdlWrite(IN PFILE_OBJECT FileObject,
|
|||
|
IN PLARGE_INTEGER FileOffset,
|
|||
|
IN ULONG Length,
|
|||
|
OUT PMDL *MdlChain,
|
|||
|
OUT PIO_STATUS_BLOCK IoStatus)
|
|||
|
{
|
|||
|
*MdlChain = CcpBuildCacheMdl
|
|||
|
(FileObject,
|
|||
|
FileOffset,
|
|||
|
Length,
|
|||
|
IoStatus);
|
|||
|
}
|
|||
|
|
|||
|
VOID
|
|||
|
NTAPI
|
|||
|
CcMdlWriteComplete(IN PFILE_OBJECT FileObject,
|
|||
|
IN PLARGE_INTEGER FileOffset,
|
|||
|
IN PMDL MdlChain)
|
|||
|
{
|
|||
|
IoFreeMdl(MdlChain);
|
|||
|
}
|
|||
|
|
|||
|
VOID
|
|||
|
NTAPI
|
|||
|
CcMdlWriteComplete2(IN PFILE_OBJECT FileObject,
|
|||
|
IN PLARGE_INTEGER FileOffset,
|
|||
|
IN PMDL MdlChain)
|
|||
|
{
|
|||
|
DPRINT("Not sure\n");
|
|||
|
}
|
|||
|
|
|||
|
VOID
|
|||
|
NTAPI
|
|||
|
CcMdlWriteAbort(IN PFILE_OBJECT FileObject,
|
|||
|
IN PMDL MdlChain)
|
|||
|
{
|
|||
|
ASSERT(FALSE);
|
|||
|
IoFreeMdl(MdlChain);
|
|||
|
}
|
|||
|
|
|||
|
/* EOF */
|