Skip to content

Commit

Permalink
Merge pull request microsoft#834 - Update WDF samples to use DIRID=13…
Browse files Browse the repository at this point in the history
… (Driver Store)

## Why is this change being made?
[Driver package isolation](https://learn.microsoft.com/en-us/windows-hardware/drivers/develop/driver-isolation) is a requirement for Windows Drivers that makes driver packages more resilient to external changes, easier to update, and more straightforward to install.

One of such requirements is to for driver to [run from the driver store](https://learn.microsoft.com/en-us/windows-hardware/drivers/develop/run-from-driver-store), which means to use `DIRID = 13` in INF file, `DestinationDirs` section and `ServiceBinary` directive.

## What changed?
Update generic WDF samples to use DIRID = 13. Specifically, it touches the following sample folders:
 - general, toaster, usb, hid, input, serial, pofx, spb, wmi

Note it does not touch areas that are owned by individual driver classes, e.g., network, storage, file system.

This change does mean that the sample **won't work on older OS** (prior to Win10 version 1809) where DIRID 13 is not fully supported. To find the original sample, please look at https://github.com/microsoft/Windows-driver-samples/tree/win11-22h2.
  • Loading branch information
wm1 authored Jan 15, 2023
2 parents 8ff2c86 + 217e46c commit 13092c6
Show file tree
Hide file tree
Showing 44 changed files with 50 additions and 39 deletions.
Binary file modified general/PLX9x5x/sys/pci9x5x.inx
Binary file not shown.
Binary file modified general/echo/kmdf/driver/AutoSync/echo.inx
Binary file not shown.
Binary file modified general/echo/kmdf/driver/DriverSync/echo_2.inx
Binary file not shown.
Binary file modified general/echo/umdf2/driver/AutoSync/echoum.inx
Binary file not shown.
Binary file modified general/pcidrv/kmdf/genpci.inx
Binary file not shown.
Binary file modified general/toaster/toastDrv/kmdf/bus/dynamic/dynambus.inx
Binary file not shown.
Binary file modified general/toaster/toastDrv/kmdf/bus/static/statbus.inx
Binary file not shown.
Binary file modified general/toaster/toastDrv/kmdf/filter/filter.inx
Binary file not shown.
Binary file modified general/toaster/toastDrv/kmdf/func/featured/wdffeatured.inx
Binary file not shown.
Binary file modified general/toaster/toastDrv/kmdf/func/simple/wdfsimple.inx
Binary file not shown.
Binary file modified general/toaster/toastDrv/kmdf/toastmon/wdftoastmon.inx
Binary file not shown.
38 changes: 21 additions & 17 deletions general/toaster/toastpkg/inf/toastpkg.inf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
; This is a mutlios INF file. Same INF file cab be used on
; x86, ia64 and amd64 platforms.
;
; Important:
; This INF depends on features for the Driver Store DIRIDs which are available starting Windows 10 1809
;
;--*/
[Version]
Signature="$WINDOWS NT$"
Expand All @@ -28,15 +31,29 @@ DriverVer=09/21/2006,6.0.5736.1
CatalogFile.NTx86 = tostx86.cat
CatalogFile.NTIA64 = tostia64.cat
CatalogFile.NTAMD64 = tstamd64.cat
PnpLockdown = 1

[DestinationDirs]
DefaultDestDir = 12
DefaultDestDir = 13
CoInstaller_CopyFiles = 11

[SourceDisksNames.x86]
1 = %DiskId1%, toastpkg.tag,,\i386

[SourceDisksNames.ia64]
1 = %DiskId1%, toastpkg.tag,,\ia64

[SourceDisksNames.amd64]
1 = %DiskId1%, toastpkg.tag,,\amd64

[SourceDisksFiles]
toaster.sys = 1,,
tostrco2.dll = 1,,

; ================= Class section =====================

[ClassInstall32]
Addreg=ToasterClassReg
Addreg=ToasterClassReg
CopyFiles=ToasterClassInstallerCopyFiles

[ToasterClassReg]
Expand Down Expand Up @@ -82,9 +99,9 @@ AddService = toaster, %SPSVCINST_ASSOCSERVICE%, toaster_Service_Inst
[toaster_Service_Inst]
DisplayName = %toaster.SVCDESC%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\toaster.sys
ServiceBinary = %13%\toaster.sys

;-------------- Coinstaller installation

Expand All @@ -103,19 +120,6 @@ HKR,,CoInstallers32,0x00010000,"tostrco2.dll,ToasterCoInstaller"
; located (so it can launch value-added setup programs).
OriginalInfSourcePath = %1%

[SourceDisksNames.x86]
1 = %DiskId1%, toastpkg.tag,,\i386

[SourceDisksNames.ia64]
1 = %DiskId1%, toastpkg.tag,,\ia64

[SourceDisksNames.amd64]
1 = %DiskId1%, toastpkg.tag,,\amd64

[SourceDisksFiles]
toaster.sys = 1,,
tostrco2.dll = 1,,

[Strings]
SPSVCINST_ASSOCSERVICE= 0x00000002
ProviderName = "TODO-Set-Provider"
Expand Down
38 changes: 21 additions & 17 deletions general/toaster/toastpkg/toastcd/toastpkg.inf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
; This is a mutlios INF file. Same INF file cab be used on
; x86, ia64 and amd64 platforms.
;
; Important:
; This INF depends on features for the Driver Store DIRIDs which are available starting Windows 10 1809
;
;--*/
[Version]
Signature="$WINDOWS NT$"
Expand All @@ -28,15 +31,29 @@ DriverVer=09/21/2006,6.0.5736.1
CatalogFile.NTx86 = tostx86.cat
CatalogFile.NTIA64 = tostia64.cat
CatalogFile.NTAMD64 = tstamd64.cat
PnpLockdown = 1

[DestinationDirs]
DefaultDestDir = 12
DefaultDestDir = 13
CoInstaller_CopyFiles = 11

[SourceDisksNames.x86]
1 = %DiskId1%, toastpkg.tag,,\i386

[SourceDisksNames.ia64]
1 = %DiskId1%, toastpkg.tag,,\ia64

[SourceDisksNames.amd64]
1 = %DiskId1%, toastpkg.tag,,\amd64

[SourceDisksFiles]
toaster.sys = 1,,
tostrco2.dll = 1,,

; ================= Class section =====================

[ClassInstall32]
Addreg=ToasterClassReg
Addreg=ToasterClassReg
CopyFiles=ToasterClassInstallerCopyFiles

[ToasterClassReg]
Expand Down Expand Up @@ -82,9 +99,9 @@ AddService = toaster, %SPSVCINST_ASSOCSERVICE%, toaster_Service_Inst
[toaster_Service_Inst]
DisplayName = %toaster.SVCDESC%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\toaster.sys
ServiceBinary = %13%\toaster.sys

;-------------- Coinstaller installation

Expand All @@ -103,19 +120,6 @@ HKR,,CoInstallers32,0x00010000,"tostrco2.dll,ToasterCoInstaller"
; located (so it can launch value-added setup programs).
OriginalInfSourcePath = %1%

[SourceDisksNames.x86]
1 = %DiskId1%, toastpkg.tag,,\i386

[SourceDisksNames.ia64]
1 = %DiskId1%, toastpkg.tag,,\ia64

[SourceDisksNames.amd64]
1 = %DiskId1%, toastpkg.tag,,\amd64

[SourceDisksFiles]
toaster.sys = 1,,
tostrco2.dll = 1,,

[Strings]
SPSVCINST_ASSOCSERVICE= 0x00000002
ProviderName = "TODO-Set-Provider"
Expand Down
Binary file modified general/toaster/umdf2/filter/generic/filterum.inx
Binary file not shown.
Binary file modified general/toaster/umdf2/func/featured/wdffeaturedum.inx
Binary file not shown.
Binary file modified general/toaster/umdf2/func/simple/wdfsimpleum.inx
Binary file not shown.
Binary file modified hid/firefly/driver/firefly.inx
Binary file not shown.
Binary file modified hid/hidusbfx2/sys/hidusbfx2.inx
Binary file not shown.
Binary file modified hid/vhidmini2/driver/kmdf/vhidmini.inx
Binary file not shown.
Binary file modified hid/vhidmini2/driver/umdf2/VhidminiUm.inx
Binary file not shown.
Binary file modified input/kbfiltr/sys/kbfiltr.inx
Binary file not shown.
Binary file modified input/moufiltr/moufiltr.inx
Binary file not shown.
Binary file modified pofx/UMDF2/Driver/SingleComp/SingleComponentSingleStateUm.inx
Binary file not shown.
Binary file modified pofx/WDF/Driver/MultiComp/driver/WdfMultiComp.inx
Binary file not shown.
Binary file modified pofx/WDF/Driver/SingleComp/SingleComponentFStateSample.inx
Binary file not shown.
Binary file modified serial/VirtualSerial2/ComPort/virtualserial2um.inx
Binary file not shown.
Binary file modified serial/VirtualSerial2/FakeModem/fakemodem2um.inx
Binary file not shown.
Binary file modified serial/serial/serial.inx
Binary file not shown.
Binary file modified spb/SkeletonI2C/skeletoni2c.inx
Binary file not shown.
Binary file modified spb/SpbTestTool/sys/spbtesttool.inx
Binary file not shown.
Binary file modified usb/UcmCxUcsi/UcmCxUcsi.inf
Binary file not shown.
Binary file modified usb/UcmTcpciCxClientSample/UcmTcpciCxClientSample.inf
Binary file not shown.
13 changes: 8 additions & 5 deletions usb/UcmUcsiAcpiSample/UcmUcsiAcpiSample/UcmUcsiAcpiSample.inf
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,28 @@
;
; INF for installing the UCM-UCSI ACPI client driver.
;
; Important:
; This INF depends on features for the Driver Store DIRIDs which are available starting Windows 10 1809
;

[Version]
Signature = "$WINDOWS NT$"
Class = UCM
ClassGuid = {e6f1aa1c-7f3b-4473-b2e8-c97d8ac71d53}
Provider = %ProviderName%
PnpLockdown = 1
DriverVer = 06/21/2006,10.0.17741.1000
CatalogFile = UcmUcsiAcpiSample.cat
PnpLockdown = 1

[DestinationDirs]
DefaultDestDir = 13

[SourceDisksNames]
3426 = windows cd

[SourceDisksFiles]
UcmUcsiAcpiSample.sys = 3426

[DestinationDirs]
DefaultDestDir = 12

[Manufacturer]
%ProviderName% = UcmUcsiAcpiSample, NT$ARCH$

Expand All @@ -49,7 +52,7 @@ DisplayName = %UcmUcsiAcpiSample.ServiceName%
ServiceType = 1
StartType = 3
ErrorControl = 1
ServiceBinary = %12%\UcmUcsiAcpiSample.sys
ServiceBinary = %13%\UcmUcsiAcpiSample.sys
Dependencies = UcmUcsiCx

[Strings]
Expand Down
Binary file modified usb/kmdf_enumswitches/sys/kmdf_enumswitches.inx
Binary file not shown.
Binary file modified usb/kmdf_fx2/driver/osrusbfx2.inx
Binary file not shown.
Binary file modified usb/ufxclientsample/UfxClientSample.inx
Binary file not shown.
Binary file modified usb/umdf2_fx2/driver/osrusbfx2um.inx
Binary file not shown.
Binary file modified usb/usbsamp/sys/driver/usbsamp.inx
Binary file not shown.
Binary file modified usb/wdf_osrfx2_lab/kmdf/step1/osrusbfx2.inx
Binary file not shown.
Binary file modified usb/wdf_osrfx2_lab/kmdf/step2/osrusbfx2.inx
Binary file not shown.
Binary file modified usb/wdf_osrfx2_lab/kmdf/step3/osrusbfx2.inx
Binary file not shown.
Binary file modified usb/wdf_osrfx2_lab/kmdf/step4/osrusbfx2.inx
Binary file not shown.
Binary file modified usb/wdf_osrfx2_lab/kmdf/step5/osrusbfx2.inx
Binary file not shown.
Binary file modified wmi/wmisamp/wmisamp.inx
Binary file not shown.

0 comments on commit 13092c6

Please sign in to comment.