ReactOS 0.4.15-dev-7924-g5949c20
ff_ioman.h File Reference
#include <stdlib.h>
#include "ff_error.h"
#include "ff_config.h"
#include "ff_types.h"
#include "ff_safety.h"
#include "ff_memory.h"
#include "ff_hash.h"
Include dependency graph for ff_ioman.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  FF_DEVICE_INFO
 
struct  FF_BLK_DEVICE
 Describes the block device driver interface to FullFAT. More...
 
struct  FF_BUFFER
 FullFAT handles memory with buffers, described as below. More...
 
struct  FF_PATHCACHE
 
struct  FF_PARTITION
 FullFAT identifies a partition with the following data. More...
 
struct  FF_IOMAN
 FF_IOMAN Object. A developer should not touch these values. More...
 

Macros

#define FF_T_FAT12   0x0A
 
#define FF_T_FAT16   0x0B
 
#define FF_T_FAT32   0x0C
 
#define FF_MODE_READ   0x01
 Buffer / FILE Mode for Read Access.
 
#define FF_MODE_WRITE   0x02
 Buffer / FILE Mode for Write Access.
 
#define FF_MODE_APPEND   0x04
 FILE Mode Append Access.
 
#define FF_MODE_CREATE   0x08
 FILE Mode Create file if not existing.
 
#define FF_MODE_TRUNCATE   0x10
 FILE Mode Truncate an Existing file.
 
#define FF_MODE_DIR   0x80
 Special Mode to open a Dir. (Internal use ONLY!)
 
#define FF_BUF_MAX_HANDLES   0xFFFF
 Maximum number handles sharing a buffer. (16 bit integer, we don't want to overflow it!)
 
#define FF_ERR_DRIVER_BUSY   -10
 
#define FF_ERR_DRIVER_FATAL_ERROR   -11
 
#define FF_FAT_LOCK   0x01
 FF_IOMAN Object description.
 
#define FF_DIR_LOCK   0x02
 Lock bit mask for DIR modification locking.
 
#define FF_IOMAN_ALLOC_BLKDEV   0x01
 Flags the pBlkDevice pointer is allocated.
 
#define FF_IOMAN_ALLOC_PART   0x02
 Flags the pPartition pointer is allocated.
 
#define FF_IOMAN_ALLOC_BUFDESCR   0x04
 Flags the pBuffers pointer is allocated.
 
#define FF_IOMAN_ALLOC_BUFFERS   0x08
 Flags the pCacheMem pointer is allocated.
 
#define FF_IOMAN_ALLOC_RESERVED   0xF0
 Reserved Section.
 

Typedefs

typedef FF_T_SINT32(* FF_WRITE_BLOCKS) (FF_T_UINT8 *pBuffer, FF_T_UINT32 SectorAddress, FF_T_UINT32 Count, void *pParam)
 
typedef FF_T_SINT32(* FF_READ_BLOCKS) (FF_T_UINT8 *pBuffer, FF_T_UINT32 SectorAddress, FF_T_UINT32 Count, void *pParam)
 

Functions

FF_IOMANFF_CreateIOMAN (FF_T_UINT8 *pCacheMem, FF_T_UINT32 Size, FF_T_UINT16 BlkSize, FF_ERROR *pError)
 
FF_ERROR FF_DestroyIOMAN (FF_IOMAN *pIoman)
 
FF_ERROR FF_RegisterBlkDevice (FF_IOMAN *pIoman, FF_T_UINT16 BlkSize, FF_WRITE_BLOCKS fnWriteBlocks, FF_READ_BLOCKS fnReadBlocks, void *pParam)
 
FF_ERROR FF_UnregisterBlkDevice (FF_IOMAN *pIoman)
 
FF_ERROR FF_MountPartition (FF_IOMAN *pIoman, FF_T_UINT8 PartitionNumber)
 
FF_ERROR FF_UnmountPartition (FF_IOMAN *pIoman)
 
FF_ERROR FF_FlushCache (FF_IOMAN *pIoman)
 
FF_T_SINT32 FF_GetPartitionBlockSize (FF_IOMAN *pIoman)
 
FF_T_UINT64 FF_GetVolumeSize (FF_IOMAN *pIoman)
 
FF_T_SINT32 FF_BlockRead (FF_IOMAN *pIoman, FF_T_UINT32 ulSectorLBA, FF_T_UINT32 ulNumSectors, void *pBuffer)
 
FF_T_SINT32 FF_BlockWrite (FF_IOMAN *pIoman, FF_T_UINT32 ulSectorLBA, FF_T_UINT32 ulNumSectors, void *pBuffer)
 
FF_ERROR FF_IncreaseFreeClusters (FF_IOMAN *pIoman, FF_T_UINT32 Count)
 
FF_ERROR FF_DecreaseFreeClusters (FF_IOMAN *pIoman, FF_T_UINT32 Count)
 
FF_BUFFERFF_GetBuffer (FF_IOMAN *pIoman, FF_T_UINT32 Sector, FF_T_UINT8 Mode)
 
void FF_ReleaseBuffer (FF_IOMAN *pIoman, FF_BUFFER *pBuffer)
 

Detailed Description

Author
James Walmsley

Definition in file ff_ioman.h.

Macro Definition Documentation

◆ FF_BUF_MAX_HANDLES

#define FF_BUF_MAX_HANDLES   0xFFFF

Maximum number handles sharing a buffer. (16 bit integer, we don't want to overflow it!)

Definition at line 62 of file ff_ioman.h.

◆ FF_DIR_LOCK

#define FF_DIR_LOCK   0x02

Lock bit mask for DIR modification locking.

Definition at line 174 of file ff_ioman.h.

◆ FF_ERR_DRIVER_BUSY

#define FF_ERR_DRIVER_BUSY   -10

Definition at line 82 of file ff_ioman.h.

◆ FF_ERR_DRIVER_FATAL_ERROR

#define FF_ERR_DRIVER_FATAL_ERROR   -11

Definition at line 83 of file ff_ioman.h.

◆ FF_FAT_LOCK

#define FF_FAT_LOCK   0x01

FF_IOMAN Object description.

FullFAT functions around an object like this. Lock bit mask for FAT table locking.

Definition at line 173 of file ff_ioman.h.

◆ FF_IOMAN_ALLOC_BLKDEV

#define FF_IOMAN_ALLOC_BLKDEV   0x01

Flags the pBlkDevice pointer is allocated.

Definition at line 212 of file ff_ioman.h.

◆ FF_IOMAN_ALLOC_BUFDESCR

#define FF_IOMAN_ALLOC_BUFDESCR   0x04

Flags the pBuffers pointer is allocated.

Definition at line 214 of file ff_ioman.h.

◆ FF_IOMAN_ALLOC_BUFFERS

#define FF_IOMAN_ALLOC_BUFFERS   0x08

Flags the pCacheMem pointer is allocated.

Definition at line 215 of file ff_ioman.h.

◆ FF_IOMAN_ALLOC_PART

#define FF_IOMAN_ALLOC_PART   0x02

Flags the pPartition pointer is allocated.

Definition at line 213 of file ff_ioman.h.

◆ FF_IOMAN_ALLOC_RESERVED

#define FF_IOMAN_ALLOC_RESERVED   0xF0

Reserved Section.

Definition at line 216 of file ff_ioman.h.

◆ FF_MODE_APPEND

#define FF_MODE_APPEND   0x04

FILE Mode Append Access.

Definition at line 57 of file ff_ioman.h.

◆ FF_MODE_CREATE

#define FF_MODE_CREATE   0x08

FILE Mode Create file if not existing.

Definition at line 58 of file ff_ioman.h.

◆ FF_MODE_DIR

#define FF_MODE_DIR   0x80

Special Mode to open a Dir. (Internal use ONLY!)

Definition at line 60 of file ff_ioman.h.

◆ FF_MODE_READ

#define FF_MODE_READ   0x01

Buffer / FILE Mode for Read Access.

Definition at line 55 of file ff_ioman.h.

◆ FF_MODE_TRUNCATE

#define FF_MODE_TRUNCATE   0x10

FILE Mode Truncate an Existing file.

Definition at line 59 of file ff_ioman.h.

◆ FF_MODE_WRITE

#define FF_MODE_WRITE   0x02

Buffer / FILE Mode for Write Access.

Definition at line 56 of file ff_ioman.h.

◆ FF_T_FAT12

#define FF_T_FAT12   0x0A

Definition at line 51 of file ff_ioman.h.

◆ FF_T_FAT16

#define FF_T_FAT16   0x0B

Definition at line 52 of file ff_ioman.h.

◆ FF_T_FAT32

#define FF_T_FAT32   0x0C

Definition at line 53 of file ff_ioman.h.

Typedef Documentation

◆ FF_READ_BLOCKS

typedef FF_T_SINT32(* FF_READ_BLOCKS) (FF_T_UINT8 *pBuffer, FF_T_UINT32 SectorAddress, FF_T_UINT32 Count, void *pParam)

Definition at line 80 of file ff_ioman.h.

◆ FF_WRITE_BLOCKS

typedef FF_T_SINT32(* FF_WRITE_BLOCKS) (FF_T_UINT8 *pBuffer, FF_T_UINT32 SectorAddress, FF_T_UINT32 Count, void *pParam)

Definition at line 79 of file ff_ioman.h.

Function Documentation

◆ FF_BlockRead()

FF_T_SINT32 FF_BlockRead ( FF_IOMAN pIoman,
FF_T_UINT32  ulSectorLBA,
FF_T_UINT32  ulNumSectors,
void pBuffer 
)

◆ FF_BlockWrite()

FF_T_SINT32 FF_BlockWrite ( FF_IOMAN pIoman,
FF_T_UINT32  ulSectorLBA,
FF_T_UINT32  ulNumSectors,
void pBuffer 
)

◆ FF_CreateIOMAN()

FF_IOMAN * FF_CreateIOMAN ( FF_T_UINT8 pCacheMem,
FF_T_UINT32  Size,
FF_T_UINT16  BlkSize,
FF_ERROR pError 
)

◆ FF_DecreaseFreeClusters()

FF_ERROR FF_DecreaseFreeClusters ( FF_IOMAN pIoman,
FF_T_UINT32  Count 
)

◆ FF_DestroyIOMAN()

FF_ERROR FF_DestroyIOMAN ( FF_IOMAN pIoman)

◆ FF_FlushCache()

FF_ERROR FF_FlushCache ( FF_IOMAN pIoman)

◆ FF_GetBuffer()

FF_BUFFER * FF_GetBuffer ( FF_IOMAN pIoman,
FF_T_UINT32  Sector,
FF_T_UINT8  Mode 
)

◆ FF_GetPartitionBlockSize()

FF_T_SINT32 FF_GetPartitionBlockSize ( FF_IOMAN pIoman)

◆ FF_GetVolumeSize()

FF_T_UINT64 FF_GetVolumeSize ( FF_IOMAN pIoman)

◆ FF_IncreaseFreeClusters()

FF_ERROR FF_IncreaseFreeClusters ( FF_IOMAN pIoman,
FF_T_UINT32  Count 
)

◆ FF_MountPartition()

FF_ERROR FF_MountPartition ( FF_IOMAN pIoman,
FF_T_UINT8  PartitionNumber 
)

◆ FF_RegisterBlkDevice()

FF_ERROR FF_RegisterBlkDevice ( FF_IOMAN pIoman,
FF_T_UINT16  BlkSize,
FF_WRITE_BLOCKS  fnWriteBlocks,
FF_READ_BLOCKS  fnReadBlocks,
void pParam 
)

◆ FF_ReleaseBuffer()

void FF_ReleaseBuffer ( FF_IOMAN pIoman,
FF_BUFFER pBuffer 
)

◆ FF_UnmountPartition()

FF_ERROR FF_UnmountPartition ( FF_IOMAN pIoman)

◆ FF_UnregisterBlkDevice()

FF_ERROR FF_UnregisterBlkDevice ( FF_IOMAN pIoman)