aleksk / LazyCopy

NTFS minifilter driver that can download file content from a remote location, when it is opened for the first time.
https://git.io/voDg5
MIT License
103 stars 37 forks source link
driver filesystem minifilter-driver

Note 10/10/2022: I'll be updating this driver for vs2022 and win11. ETA 1mo.

This minifilter driver (MSDN) intercepts operations on the special reparse point files (MSDN). If such file is opened for the first time, driver downloads its content from the remote location.

It's similar to the Git Virtual File System project from Microsoft. And lacks official support.

Content can be downloaded from:

You can easily extend the user-mode service to support more types.

Short demo

img

Prerequisites

  1. Windows 7+
  2. Visual Studio 2015 & WDK 10
  3. WiX toolset

Folder structure

Compilation

  1. Make sure you have the latest WDK installed.
  2. Open the LazyCopyDriver project properties, and make sure the General > Target Platform Version value corresponds to the WDK version you installed.
  3. (Optionally) Configure driver test signing in the Properties > Driver Signing > General.
  4. Make sure the solution is compiled for your architecture (Main menu > Build > Configuration Manager).

Driver signing

Installation

Trying it out

Create an empty file that will be fetched on the first access (admin permissions are required):

bin\SampleClient\CreateLcFile.exe < original file >  < new empty file >

.\CreateLcFile.exe "\\build\latest\contoso.dll"  "c:\temp\contoso.dll"
.\CreateLcFile.exe "http://www.contoso.org/"     "c:\temp\index.html"
.\CreateLcFile.exe "d:\data\file_with_data.txt"  "c:\temp\yet_empty_file.txt"

Want to reuse project files?