CachedWrite (Windows CE 5.0)

Send Feedback

For a write-through cache, this function writes data to disk and to the cache.

For a write-back cache, this function writes data only to the cache and allows the lazy-writer thread to commit the data to the disk.

DWORDCachedWrite(DWORDdwCacheId, DWORDdwBlockNum,DWORD dwNumBlocks,PVOID pBuffer,DWORD dwWriteFlags);

Parameters

  • dwCacheId
    [in] Cache ID value returned by CreateCache.

  • dwBlockNum
    [in] Starting block to write to.

  • dwNumBlocks
    [in] Number of blocks to write.

  • pBuffer
    [in] Pointer to the buffer containing data to write.

  • dwWriteFlags
    [in] This value can be set to CACHE_FORCE_WRITETHROUGH to force the written blocks to be committed to the disk.

    This only applies for a write-back cache.

Remarks

If the cache location that the data is to be written to overwrites a dirty block that is different from the block to be written, that dirty block is committed to the disk.

Return Values

Returns ERROR_SUCCESS on success.

Returns a Microsoft Win32 error code on failure.

Requirements

OS Versions: Windows CE 5.0 and later.
Header: Fsdmgr.h.
Link Library: Fsdmgr.lib.

See Also

Cache Manager Functions

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.