Restricting the loading location of UMDF drivers

The UMDF platform will fail to load the main UMDF driver binaries from any location other than the %SystemRoot%\System32\Drivers\Umdf directory or, in Windows 10 1803 and later, a run from Driver Store location. Therefore, a UMDF INF file must restrict the location where it installs UMDF drivers to those directories. Installing in these directories also ensures that unprivileged users cannot tamper with the UMDF drivers.

To have a UMDF driver binary be a run from Driver Store binary (Windows 10 1803 and later), the UMDF driver INF file must include an INF DestinationDirs Section that is similar to the following code example.

[DestinationDirs]
UMDriverCopy=13 ; makes the file 'run from Driver Store'

"UMDriverCopy" represents an INF-writer-determined name of a section that lists the UMDF driver binaries as shown in the following example.

[UMDriverCopy]
WUDFOsrUsbDriver.dll

The CopyFiles directive must also reference the UMDriverCopy section to indicate the list of UMDF driver binaries for the operating system to copy from the source media to the destination as shown in the following example.

[OsrUsb_Install.NT]
CopyFiles=UMDriverCopy

To install UMDF driver binaries to %SystemRoot%\System32\Drivers\Umdf instead of being 'run from Driver Store', the INF DestinationDirs Section should instead look like the following code example.

[DestinationDirs]
UMDriverCopy=12,UMDF ; copies to drivers\umdf