WDK Mini Filter Example
README.md
Go to the documentation of this file.
1 NameChanger File System Minifilter Driver
2 =========================================
3 
4 The *NameChanger* minifilter grafts a directory from one part of a volume's namespace to another part using a mapping. The minifilter maintains this illusion by acting as a name provider, injecting entries into directory enumerations and forwarding directory change notifications.
5 
6 
7 Build the sample
8 ----------------
9 
10 You can build the sample in two ways: using Microsoft Visual Studio or the command line (*MSBuild*).
11 
12 Building a Driver Using Visual Studio
13 -------------------------------------
14 
15 You build a driver the same way you build any project or solution in Visual Studio. When you create a new driver project using a Windows driver template, the template defines a default (active) project configuration and a default (active) solution build configuration. When you create a project from existing driver sources or convert existing driver code that was built with previous versions of the WDK, the conversion process preserves the target version information (operating systems and platform).
16 
17 The default Solution build configuration is Debug and Win32.
18 
19 ### To select a configuration and build a driver
20 
21 1. Open the driver project or solution in Visual Studio (find *filtername*.sln or *filtername*.vcxproj).
22 2. Right-click the solution in the **Solutions Explorer** and select **Configuration Manager**.
23 3. From the **Configuration Manager**, select the **Active Solution Configuration** (for example, Debug or Release) and the **Active Solution Platform** (for example, Win32) that correspond to the type of build you are interested in.
24 4. From the Build menu, click **Build Solution** (Ctrl+Shift+B).
25 
26 Building a Driver Using the Command Line (MSBuild)
27 --------------------------------------------------
28 
29 You can build a driver from the command line using the Visual Studio Command Prompt window and the Microsoft Build Engine (MSBuild.exe) Previous versions of the WDK used the Windows Build utility (Build.exe) and provided separate build environment windows for each of the supported build configurations. You can now use the Visual Studio Command Prompt window for all build configurations.
30 
31 ### To select a configuration and build a driver
32 
33 1. Open a Visual Studio Command Prompt window at the **Start** screen. From this window you can use MsBuild.exe to build any Visual Studio project by specifying the project (.VcxProj) or solutions (.Sln) file.
34 2. Navigate to the project directory and enter the **MSbuild** command for your target. For example, to perform a clean build of a Visual Studio driver project called *filtername*.vcxproj, navigate to the project directory and enter the following MSBuild command: **msbuild /t:clean /t:build .\\***filtername***.vcxproj**.
35 
36 Run the sample
37 --------------
38 
39 Installation
40 ------------
41 
42 The minifilter samples come with an INF file that will install the minifilter. To install the minifilter, do the following:
43 
44 1. Make sure that *filtername*.sys and *filtername*.inf are in the same directory.
45 
46  **Note** This installation will make the necessary registry updates to register the minifilter service and place *filtername*.sys in the %SystemRoot%\\system32\\drivers directory.
47 
48 2. In Windows Explorer, right-click *filtername*.inf, and click **Install**.
49 
50 3. To load the minifilter, run **fltmc load** *filtername* or **net start** *filtername*.
51 
52 Design and Operation
53 --------------------
54 
55 The *NameChanger* minifilter illustrates how to make one part of a volume's namespace appear as though it belongs to part of another namespace. It accomplishes this by altering the names of files that reside beneath a particular path (called the "real mapping") to appear as though they actually reside beneath a different path (called the "user mapping"). The .inf file supplied with the sample defines the real and user mappings in the *[Strings]* section. The three strings used for the mappings are:
56 
57 String | Description
58 -------|-------------
59 UserMapping | The location where files will appear to be in when the filter is attached
60 UserMappingFinalComponentShort | The "short" (DOS-compliant 8.3-format) name for the final component of the UserMapping path.
61 RealMapping | The actual location where the files reside.
62 
63 Before attaching the minifilter to a volume, you must set up the user and real paths. By default the .inf defines the mapping paths like in the following manner:
64 
65 String | Mapping
66 -------|--------
67 UserMapping | "\X\Y"
68 UserMappingFinalComponentShort | "Y"
69 RealMapping | "\A\B"
70 
71 To successfully attach the filter to a volume you must first create a couple of directories. For example, to attach the *NameChanger* minifilter to the F: volume, first create the RealMapping directory (the F:\\A\\B directory). Next, create the parent of the UserMapping path (the F:\\X directory). The following directories are be created:
72 
73 F:\\A\\B
74 
75 F:\\X
76 
77 Once this is done the *NameChanger* filter should successfully attach to F:. It will change the directories you created to appear like the following:
78 
79 F:\\A
80 
81 F:\\X\\Y
82 
83 After the minifilter attaches, the "B" subdirectory of F:\\A is no longer visible. Its contents now appear under the "Y" subdirectory of F:\\X.
84 
85 For more information on file system minifilter design, start with the [File System Minifilter Drivers](http://msdn.microsoft.com/en-us/library/windows/hardware/ff540402) section in the Installable File Systems Design Guide.
86 

Social Network


Services Overview

Architect, implement and test file system filter drivers for a wide range of functionality. We can offer several levels of assistance to meet your specific.

Contact Us

You are welcome to contact us for salse or partnership.

Sales: sales@easefilter.com
Support: support@easefilter.com
Info: info@easefilter.com