microsoft / ProjFS-Managed-API

A managed-code API for the Windows Projected File System
Other
142 stars 34 forks source link

Bypass File hydration based on the operation #44

Closed amenon21 closed 4 years ago

amenon21 commented 4 years ago

Hi, Would it be possible to bypass file hydration based on the file operation? Eg. on right click to view properties invokes getFileDataCallBack() and hydrates the file. The process name is explorer.exe for all operations and hence cant block based on that. Any recommendations?

cgallred commented 4 years ago

@amenon21, repeating the reply I gave where you asked this question on the closed issue:

There's no way for ProjFS to tell that the high-level operation is a right click in Explorer. The file system operations generated by invoking the properties tab in Explorer are operations that require the file's data to be present. In this case getFileDataCallBack() is invoked because the ProjFS file system filter saw a data read (IRP_MJ_READ). In order to satisfy the read, the data has to be present, so the file has to be hydrated. It isn't possible to distinguish one read from another. At the file system filter level they all look the same.

amenon21 commented 4 years ago

thanks @cgallred