Instant control over file and folder operations in Windows and .NET applications

CallbackFilter.InstallDriverEx method


Pascal    C++ (Lib)    C++ (VCL)    C++ (.NET)    C#    VB.NET   

CallbackFilter     See also    


Installs the driver into the system in legacy or minifilter mode.


    class procedure InstallDriverEx(DriverFileName : TCBString; ProductName : AnsiString; Mode : LongWord {TCbFltFilterMode}; Altitude : LongWord; var RebootNeeded : boolean);
    type TCBString = {$ifdef UNICODE}UnicodeString{$else}WideString{$endif};

[C++ (Lib)]
    static void InstallDriverEx(LPCWSTR DriverFileName, LPCSTR ProductName, CbFltFilterMode Mode, unsigned long Altitude, LPBOOL RebootNeeded);

[C++ (VCL)]
    static void __fastcall InstallDriverEx(__classid(TCallbackFilter), WideString DriverFileName, AnsiString ProductName, unsigned long /*TCbFltFilterMode*/ Mode, unsigned long Altitude, bool &RebootNeeded);

[C++ (.NET)]
    static void InstallDriverEx(String^ DriverFileName, String^ ProductName, CbFltFilterMode Mode, unsigned long Altitude, bool% RebootNeeded);

    static void InstallDriverEx(string DriverFileName, string ProductName, CbFltFilterMode Mode, UInt32 Altitude, ref bool RebootNeeded)

    Shared Sub InstallDriverEx(ByVal DriverFileName As String, ByVal ProductName As String, ByVal Mode As CbFltFilterMode, ByVal Altitude As UInt32, ByRef RebootNeeded As Boolean)


  • DriverFileName - the fully qualified name of the driver (cbflt.sys)
  • ProductName - the ProductName string that identifies installation of the driver by your application
  • Mode - specifies in which mode (legacy or minifilter) the driver will work
  • Altitude - specifies the Altitude of the driver in mini-filter mode
  • RebootNeeded - on return this parameter specifies if system restart is necessary for driver installation to be successful

Values of CbFltFilterMode


Use this function to install the driver to the system in legacy or minifilter mode. Once installed, the driver is loaded using user-mode API. ProductName is used to distinguish between installations of the driver made by different applications and to prevent the situation when the driver is installed by two applications and further deinstallation of one of them removes the driver.

Read more about installing and uninstalling the drivers.

You can change the driver mode from legacy to minifilter and vice versa using FilterMode property. Read more about Legacy and MiniFilter modes.

Read more about Mini-filter driver altitudes.

Install the correct drivers:
On 64-bit systems you must install 64-bit drivers. 32-bit drivers won't work there. If your application is 32-bit, you need to determine what driver set to install. To do this you can use one of the listed methods:

  • Use IsWow64Process() WinAPI function. Note, that this function appeared only in Windows XP so you need to use GetProcAddress() WinAPI function to dynamically obtain the function pointer.
  • Check existence of %WINDIR%\SysWOW64 folder
  • Check ProgramW6432 environment variable

See also

FilterMode     GetDriverStatus     InstallDriver     UninstallDriver

Back to top