gpt4 book ai didi

windows - 创建第三方应用程序所需的虚拟化文件系统目录

转载 作者:行者123 更新时间:2023-12-02 01:39:48 24 4
gpt4 key购买 nike

我有一个关于 Windows 中内存虚拟化可能性的问题。场景如下:

  1. 我有第 3 方应用程序(无法访问其代码或修改代码),该应用程序要求在 C:\PathToApp\AwesomeApp\DataDir

    中提供数据文件
  2. 我想制作一个打开此应用程序的加载程序,当应用程序尝试访问 DataDir 时,它会从加载程序内存加载(不保存到驱动器),因此所有请求DataDir 被拦截,所有操作仅在内存中完成。

是否有 Windows API 允许我执行此操作?实际上,我想在加载程序中创建一个虚拟化目录,该目录将欺骗第三方应用程序,使其认为真实的文件系统目录存在于硬编码位置。

最佳答案

Windows Projected Filesystem (ProjFS)正是允许这样做。

The Windows Projected File System (ProjFS) allows a user-mode application called a "provider" to project hierarchical data from a backing data store into the file system, making it appear as files and directories in the file system. For example, a simple provider could project the Windows registry into the file system, making registry keys and values appear as files and directories, respectively. An example of a more complex provider is VFS for Git, which is used to virtualize very large git repos.

这里是a sample project on GitHub实现只读“注册表文件系统(RegFS)”。它使用 ProjFS 将注册表项映射到文件夹,并将注册表值映射到文件。

请注意,ProjFS 是可选组件,仅受 Windows 10 October 2018 Update(版本 1809)及更高版本支持。

关于windows - 创建第三方应用程序所需的虚拟化文件系统目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71800354/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com