Setting the MofImagePath Registry Value

A driver's schema can be published by including a compiled MOF resource in a separate file, such as a DLL, and setting MofImagePath in the registry to the path of that file. A schema published in this way can be updated without recompiling the driver.

To publish a driver's schema in a separate file:

  1. Compile the MOF file as described in Compiling a Driver's MOF File.

  2. Include the compiled MOF file as a resource in a file such as a DLL.

  3. Add the MofImagePath registry value under the driver's Services key. For example, the following shows the registry value for a driver named DriverName:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
        \DriverName
            MofImagePath    "\SystemRoot\System32\Drivers\DriverNameMof.dll"
    

You can set this key in the driver's INF file, as follows:

; This is the Services section for the driver
[Driver_service_install_section]
AddReg=Driver_AddReg

; This is the Services AddReg section declared above.
[Driver_AddReg]
HKR,,MofImagePath,,DriverMof.dll 

See INF DDInstall.Services Section and INF AddReg Directive for details.