Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows API to map an application as a drive

This is probably an odd question, but are there any Windows APIs that allow an application to behave like a mapped drive or physical drive? For example when you navigate to the "drive" in Windows Explorer the application returns what looks like a list of say image files. Then when you click on the image file the application serves up the image from a database.

like image 707
Dib Avatar asked Feb 06 '12 17:02

Dib


2 Answers

There are at least three ways to do this:

  1. Write a CIFS server, then you can use the "Client for Microsoft Networks" redirector to connect to it, Windows does all the hard work of intercepting file access and sending them to your application. Or write a HTTP+WebDAV server, and use the Microsoft-provided "Web Folders" redirector. However, WebDAV isn't as compatible with all applications as CIFS is.

  2. Write an Explorer namespace extension. The files won't have a drive letter, and will only be usable by programs that use Shell PIDLs for file access.

  3. Write a filesystem driver. Since this requires kernel mode, it's a more difficult development environment, and very easy to crash your computer, therefore I don't recommend this option. However, you may find some existing kernel driver that forwards to a user-mode process, like fuse does on Linux.

like image 103
Ben Voigt Avatar answered Oct 06 '22 19:10

Ben Voigt


You need to create a virtual drive.

It's not something that many people ever have do, but is essentially straightforward - see http://www.acc.umu.se/~bosse/

like image 27
Martin Beckett Avatar answered Oct 06 '22 20:10

Martin Beckett