Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

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.

It is called by File System Disk Manager (FSDMGR) for disk cache.

Syntax

DWORD  FSDMGR_CachedWrite(
  DWORD dwCacheId,
  DWORD dwBlockNum,
  DWORD dwNumBlocks,
  PVOID pBuffer,
  DWORD dwWriteFlags
);

Parameters

dwCacheId

[in] Cache ID value returned by the FSDMGR_CreateCachefunction.

dwBlockNum

[in] Starting block to which to write.

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 applies only to a write-back cache.

Return Value

ERROR_SUCCESS indicates success. A Microsoft Win32 error code indicates failure.

Remarks

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

Requirements

Header fsdmgr.h
Library Fsdmgr.lib
Windows Embedded CE Windows CE 5.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

FSD Functions