2 * PROJECT: ReactOS FAT file system driver
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: drivers/filesystems/fastfat/fullfat.c
5 * PURPOSE: FullFAT integration routines
6 * PROGRAMMERS: Aleksey Bragin (aleksey@reactos.org)
9 /* INCLUDES *****************************************************************/
14 /* GLOBALS ******************************************************************/
16 #define TAG_FULLFAT 'FLUF'
18 /* FUNCTIONS ****************************************************************/
21 FF_Malloc(FF_T_UINT32 allocSize
)
23 return ExAllocatePoolWithTag(PagedPool
, allocSize
, TAG_FULLFAT
);
27 FF_Free(VOID
*pBuffer
)
29 return ExFreePoolWithTag(pBuffer
, TAG_FULLFAT
);
33 FatWriteBlocks(FF_T_UINT8
*pBuffer
, FF_T_UINT32 SectorAddress
, FF_T_UINT32 Count
, void *pParam
)
35 DPRINT1("FatWriteBlocks %p %d %d %p\n", pBuffer
, SectorAddress
, Count
, pParam
);
41 FatReadBlocks(FF_T_UINT8
*DestBuffer
, FF_T_UINT32 SectorAddress
, FF_T_UINT32 Count
, void *pParam
)
45 PVCB Vcb
= (PVCB
)pParam
;
47 ULONG SectorSize
= 512; // FIXME: hardcoding 512 is bad
49 DPRINT1("FatReadBlocks %p %d %d %p\n", DestBuffer
, SectorAddress
, Count
, pParam
);
51 /* Calculate the offset */
52 Offset
.QuadPart
= Int32x32To64(SectorAddress
, SectorSize
);
54 if (!CcMapData(Vcb
->StreamFileObject
,
66 /* Copy data to the buffer */
67 RtlCopyMemory(DestBuffer
, Buffer
, Count
* SectorSize
);
69 /* Unpin unneeded data */
72 /* Return amount of read data in sectors */