7#ifndef __CDRW_WCACHE_LIB_H__
8#define __CDRW_WCACHE_LIB_H__
20#define WCACHE_BOUND_CHECKS
54#define WCACHE_BLOCK_USED 0x01
55#define WCACHE_BLOCK_ZERO 0x02
56#define WCACHE_BLOCK_BAD 0x04
66#define WCACHE_ERROR_READ 0x0001
67#define WCACHE_ERROR_WRITE 0x0002
68#define WCACHE_ERROR_INTERNAL 0x0003
70#define WCACHE_W_OP FALSE
71#define WCACHE_R_OP TRUE
115#define CACHED_BLOCK_MEMORY_TYPE PagedPool
116#define MAX_TRIES_FOR_NA 3
118#define WCACHE_ADDR_MASK 0xfffffff8
119#define WCACHE_FLAG_MASK 0x00000007
120#define WCACHE_FLAG_MODIFIED 0x00000001
121#define WCACHE_FLAG_ZERO 0x00000002
122#define WCACHE_FLAG_BAD 0x00000004
124#define WCACHE_MODE_ROM 0x00000000
125#define WCACHE_MODE_RW 0x00000001
126#define WCACHE_MODE_R 0x00000002
127#define WCACHE_MODE_RAM 0x00000003
128#define WCACHE_MODE_EWR 0x00000004
129#define WCACHE_MODE_MAX WCACHE_MODE_RAM
131#define PH_TMP_BUFFER 1
189#define WCACHE_INVALID_LBA ((lba_t)(-1))
191#define WCACHE_CACHE_WHOLE_PACKET 0x01
192#define WCACHE_DO_NOT_COMPARE 0x02
193#define WCACHE_CHAINED_IO 0x04
194#define WCACHE_MARK_BAD_BLOCKS 0x08
195#define WCACHE_RO_BAD_BLOCKS 0x10
196#define WCACHE_NO_WRITE_THROUGH 0x20
198#define WCACHE_VALID_FLAGS (WCACHE_CACHE_WHOLE_PACKET | \
199 WCACHE_DO_NOT_COMPARE | \
200 WCACHE_CHAINED_IO | \
201 WCACHE_MARK_BAD_BLOCKS | \
202 WCACHE_RO_BAD_BLOCKS | \
203 WCACHE_NO_WRITE_THROUGH)
205#define WCACHE_INVALID_FLAGS (0xffffffff)
__in PWDFDEVICE_INIT __in BOOLEAN Exclusive
_In_ ULONG _In_ ULONG _In_ ULONG Length
struct _WCACHE_ERROR_CONTEXT::@964::@967 Internal
struct _WCACHE_ERROR_CONTEXT::@964::@966 ReadWrite
PCHECK_BLOCK CheckUsedProc
lba_t * CachedModifiedBlocksList
PREAD_BLOCK_ASYNC ReadProcAsync
PUPDATE_RELOC UpdateRelocProc
PWC_ERROR_HANDLER ErrorHandlerProc
PWRITE_BLOCK_ASYNC WriteProcAsync
OSSTATUS WCacheWriteBlocks__(IN PW_CACHE Cache, IN PVOID Context, IN PCHAR Buffer, IN lba_t Lba, IN ULONG BCount, OUT PSIZE_T WrittenBytes, IN BOOLEAN CachedOnly)
struct _W_CACHE_FRAME W_CACHE_FRAME
VOID WCacheFlushAll__(IN PW_CACHE Cache, IN PVOID Context)
OSSTATUS WCacheStartDirect__(IN PW_CACHE Cache, IN PVOID Context, IN BOOLEAN Exclusive)
BOOLEAN WCacheIsInitialized__(IN PW_CACHE Cache)
ULONG WCacheGetWriteBlockCount__(IN PW_CACHE Cache)
VOID WCacheDiscardBlocks__(IN PW_CACHE Cache, IN PVOID Context, IN lba_t Lba, IN ULONG BCount)
OSSTATUS WCacheFlushBlocks__(IN PW_CACHE Cache, IN PVOID Context, IN lba_t Lba, IN ULONG BCount)
OSSTATUS(* PWRITE_BLOCK)(IN PVOID Context, IN PVOID Buffer, IN SIZE_T Length, IN lba_t Lba, OUT PSIZE_T WrittenBytes, IN uint32 Flags)
struct _W_CACHE_ENTRY W_CACHE_ENTRY
VOID WCacheRelease__(IN PW_CACHE Cache)
OSSTATUS WCacheInit__(IN PW_CACHE Cache, IN ULONG MaxFrames, IN ULONG MaxBlocks, IN SIZE_T MaxBytesToRead, IN ULONG PacketSizeSh, IN ULONG BlockSizeSh, IN ULONG BlocksPerFrameSh, IN lba_t FirstLba, IN lba_t LastLba, IN ULONG Mode, IN ULONG Flags, IN ULONG FramesToKeepFree, IN PWRITE_BLOCK WriteProc, IN PREAD_BLOCK ReadProc, IN PWRITE_BLOCK_ASYNC WriteProcAsync, IN PREAD_BLOCK_ASYNC ReadProcAsync, IN PCHECK_BLOCK CheckUsedProc, IN PUPDATE_RELOC UpdateRelocProc, IN PWC_ERROR_HANDLER ErrorHandlerProc)
VOID WCacheSyncReloc__(IN PW_CACHE Cache, IN PVOID Context)
ULONG(* PCHECK_BLOCK)(IN PVOID Context, IN lba_t Lba)
OSSTATUS(* PREAD_BLOCK)(IN PVOID Context, IN PVOID Buffer, IN SIZE_T Length, IN lba_t Lba, OUT PSIZE_T ReadBytes, IN uint32 Flags)
OSSTATUS(* PWC_ERROR_HANDLER)(IN PVOID Context, IN PWCACHE_ERROR_CONTEXT ErrorInfo)
OSSTATUS(* PWRITE_BLOCK_ASYNC)(IN PVOID Context, IN PVOID WContext, IN PVOID Buffer, IN SIZE_T Length, IN lba_t Lba, OUT PSIZE_T WrittenBytes, IN BOOLEAN FreeBuffer)
struct _WCACHE_ERROR_CONTEXT WCACHE_ERROR_CONTEXT
OSSTATUS WCacheReadBlocks__(IN PW_CACHE Cache, IN PVOID Context, IN PCHAR Buffer, IN lba_t Lba, IN ULONG BCount, OUT PSIZE_T ReadBytes, IN BOOLEAN CachedOnly)
OSSTATUS(* PUPDATE_RELOC)(IN PVOID Context, IN lba_t Lba, IN PULONG RelocTab, IN ULONG BCount)
OSSTATUS WCacheCompleteAsync__(IN PVOID WContext, IN OSSTATUS Status)
struct _W_CACHE_ENTRY * PW_CACHE_ENTRY
VOID WCachePurgeAll__(IN PW_CACHE Cache, IN PVOID Context)
OSSTATUS(* PREAD_BLOCK_ASYNC)(IN PVOID Context, IN PVOID WContext, IN PVOID Buffer, IN SIZE_T Length, IN lba_t Lba, OUT PSIZE_T ReadBytes)
OSSTATUS WCacheDirect__(IN PW_CACHE Cache, IN PVOID Context, IN lba_t Lba, IN BOOLEAN Modified, OUT PCHAR *CachedBlock, IN BOOLEAN CachedOnly)
OSSTATUS WCacheEODirect__(IN PW_CACHE Cache, IN PVOID Context)
ULONG WCacheGetMode__(IN PW_CACHE Cache)
struct _WCACHE_ERROR_CONTEXT * PWCACHE_ERROR_CONTEXT
BOOLEAN WCacheIsCached__(IN PW_CACHE Cache, IN lba_t Lba, IN ULONG BCount)
OSSTATUS WCacheSetMode__(IN PW_CACHE Cache, IN ULONG Mode)
ULONG WCacheChFlags__(IN PW_CACHE Cache, IN ULONG SetFlags, IN ULONG ClrFlags)
struct _W_CACHE * PW_CACHE
struct _W_CACHE_FRAME * PW_CACHE_FRAME
_Must_inspect_result_ _In_ ULONG Flags