how to hydrate a projected file system file (Projfs)

Pribele, Joe 0 Reputation points
2026-08-20T23:42:38.4766667+00:00

I have a implementation of a projfs provider but i am trying to implement a hydrate function that converts a placeholder to the a Hydrated placeholder.
https://learn.microsoft.com/en-us/windows/win32/projfs/projfs-functions

There does not appear to be any api to do this. Best I can come up with is to open the file and perform a read, which round trips through the system to retrieve the data from the projfs provider.

Windows development | Windows API - Win32
0 comments No comments

2 answers

Sort by: Newest
  1. Taki Ly (WICLOUD CORPORATION) 4,615 Reputation points Microsoft External Staff Moderator
    2026-08-21T03:30:21.29+00:00

    Hello @Pribele, Joe ,

    ProjFS does not expose a dedicated "hydrate" API that converts a placeholder into a hydrated placeholder. Opening the file and reading its content is the documented path to trigger hydration, so the approach you described is consistent with how ProjFS is designed to work.

    The flow is:

    1. An app opens the projected file and reads the requested byte range.
    2. ProjFS invokes the provider's PRJ_GET_FILE_DATA_CB callback.
    3. The provider returns the data by calling PrjWriteFileData.
    4. ProjFS writes that data to disk and converts the file into a hydrated placeholder.

    This is stated in the callback reference. The Remarks for PRJ_GET_FILE_DATA_CB say: "When ProjFS receives the data it will write it to the file to convert it into a hydrated placeholder." The cache-state documentation walks through the same sequence, where the step "the app reads the content of the file" is what turns it into a hydrated placeholder:

    A few additional points:

    • There is no explicit hydrate function in the ProjFS function list, so causing a read is the intended way to force the content to be cached. In practice, opening the file and reading at least one byte (or the full range) will drive the callback.
    • A hydrated placeholder does not automatically become a full file when it is read. Based on the documented state model, it becomes a full file only when the primary data stream is modified locally, for example when it is opened for write access.

    If an explicit hydrate call is a hard requirement, it may be worth evaluating the Cloud Files API instead of ProjFS. The trade-offs are roughly:

    • ProjFS: simpler to implement, but no explicit hydrate API, no progress reporting, and no online/offline state indication. Hydration is driven by reading the file.
    • Cloud Files API: provides an explicit hydrate call (CfHydratePlaceholder) along with hydration policies, progress reporting, and online/offline indication in File Explorer, at the cost of a more complex implementation. The ProjFS documentation itself points to the Cloud Files API for scenarios that need these features.

    So if reading the file to hydrate is sufficient for the scenario, staying on ProjFS is reasonable. If explicit hydration control and richer sync/UI behavior are needed, the Cloud Files API is the better fit.

    Let me know if it would help to go deeper on either option. If you found my response helpful or informative, I would greatly appreciate it if you could follow this guide for your confirmation.Thank you.

    Was this answer helpful?


  2. AI answer

    2026-08-20T23:42:52.9+00:00

    ProjFS does not expose a separate hydrate API like the Cloud Files API does.

    In ProjFS, a file becomes a hydrated placeholder when its data is requested through the provider callback flow:

    1. An app opens the projected file.
    2. ProjFS invokes PRJ_GET_FILE_DATA_CB for the requested byte range.
    3. The provider returns the data by calling PrjWriteFileData.
    4. After ProjFS receives the data, it writes it to disk and converts the file into a hydrated placeholder.

    So for ProjFS, reading the file is the documented way to cause hydration. The callback documentation explicitly states that when ProjFS receives the data, it writes it to the file to convert it into a hydrated placeholder.

    Also note the distinction between a hydrated placeholder and a full file:

    • Hydrated placeholder: file content has been cached locally, but it is still a placeholder.
    • Full file: the file’s primary data stream has been modified locally, or the file was created locally and does not exist in the provider store.

    A hydrated placeholder does not become a full file just because it was recalled. Based on the documented state model, it becomes a full file when local modification occurs, such as opening it for write access.

    If the requirement is an explicit hydrate API, that exists in the Cloud Files API as CfHydratePlaceholder, not in ProjFS. The ProjFS documentation also says that for scenarios needing features such as progress reporting or online/offline indication, the Cloud Files API should be considered instead.


    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.