How to install upper driver for class? - windows

I created a filter driver and I just want to install it for the Serial port. I know that the existing driver class is "Ports" so I changed inf file as follows:
[Version]
Signature="$Windows NT$"
Class=Ports
ClassGUID={4D36E978-E325-11CE-BFC1-08002BE10318}
Provider=%Provider%
DriverVer=03/17/2001,1.0.0.1
CatalogFile=KmdfSamples.cat
Note that the classguid is the same as in system for serial port. So I does not know how to install it for specyfic class, I have to manally edit "UpperFilter" field in registry?
I also can not find out from the microsoft documentation if I have to specyfi device in such a way (I do not know the device name, but i know whole class id).
So the questions are:
How to install upper filter for existing class?
Have I specyfi the device hardware id that I do not know?
Any repsonses will be greatly appreciated ;)

Related

What is the difference between file system filter drivers and file system minifilter drivers? (windows)

Is there a difference between file system filter drivers and file system minifilter drivers? maybe I'm confusing with filesystem legacy filter driver?
I know it's a very big question to ask but any help would be appreciated
Filesystem filters are just legacy filters and use the WDM model where you have your DeviceObject and attach to the FS stack while the minifilters use the Filter Manager infrastructure to filter filesystem requests.
Filter Manager itself is a legacy filter or as you call it a filesystem filter driver.

How does PnP manager determine the appropriate function driver?

I am learing the loading process of Windows Driver.
But I cannot understand a part of the following article.
https://learn.microsoft.com/ja-jp/windows-hardware/drivers/install/step-3--the-driver-for-the-device-is-installed
In this article, there is the following description.
"4. The PnP manager loads the appropriate function driver and any optional filter drivers for the device."
I have a question about above description.
How does the PnP manager determine the appropriate function driver?
For example,
when a USB memory is plugged into a Windows PC then PnP manager will load disk.sys after loading a driver relating USB.
In this case, I want to know why PnP manager could judge that the device corresponds to disk.sys.
(seeing somewhere in registry? sending some requests to bus driver? and so on.. )
when bus driver detect and report PDO device PnP manager send several IRP_MJ_PNP to PDO device. including IRP_MN_QUERY_ID for get Device Identification Strings
then formated registry key path in form
\REGISTRY\MACHINE\SYSTEM\CurrentControlSet\Enum\<BusQueryDeviceID>\<BusQueryInstanceID>
in place <BusQueryDeviceID> string returned by device for BusQueryDeviceID and in place <BusQueryInstanceID> string returned by device for BusQueryInstanceID (Parameters.QueryId.IdType)
this key opened or created. then was query for BusQueryHardwareIDs and BusQueryCompatibleIDs. result of this query saved in HardwareID and CompatibleIDs REG_MULTI_SZ values.
and then PnP manager look for Service REG_SZ value under this key - if it already exist - the driver ( \REGISTRY\MACHINE\SYSTEM\CurrentControlSet\Services\<Service>) loaded and it AddDevice called with this PDO. if this value yet not set - was search via installed inf files in system - for best match HardwareID and CompatibleIDs. if found driver - result saved under Service REG_SZ value, for not search next time

Windows file system filter driver on mapped network drive

Is it possible to attach an FS filter driver on a mapped network drive?
I'm really new to this filter driver work and currently testing a demo version of an SDK. It works fine on my local drive and I was able monitor and even deny file creation. But it doesn't seem to work on a mapped network drive.
So my question is: Is it even possible to do that?
Of course.
You simply need to check in you instance attach if your filesystem type is a network filesystem.
Read more here, especially the VolumeDeviceType and VolumeFilesystemType parameters.
Good luck,
Gabriel

NDIS6 LWF installation problems via DPInst and DIFxAPI

We have a NDIS6 LWF driver which installs fine if installed from the adapter's property sheet, but does not install neither via DPInst, nor via DriverPackageInstall function from DIFxAPI.dll
Apart from vendor info and descriptions, it differs from the NDIS6 LWF Passthru sample in the following ways:
binds only to WLAN medium:
HKR, Ndi\Interfaces, FilterMediaTypes,,"wlan"
specifies DriverPackageType=Network (a requirement of DIFxAPI)
passthru sample says "compression" here, we say "custom"
HKR, Ndi,FilterClass,, custom
The current full version of the INF is stored at https://docs.google.com/file/d/0By4TPkL7aR-RelRSZC1PZmdQYnc/edit?pli=1 because it's too big to quote it here.
So, the question is: what else does this INF require in order to be installed via DIFxAPI? (It currently installs fine via the adapter's property sheet)
You will need to update NetCfgInstanceId in inf file and have same id as UniqueName in registration attributes at driver entry.
You can use following site to have a new id generated and replace your present:
www.uuidgen.com

How to configure spi in the driver file insted of giving configuration in the application

I want to write a test driver for mcspi and want to give all configuration in my driver file (instead of using user space application I want to use driver as a test driver and want to create .ko) and want to pass all configuration to the mcspi controller.
The configurations like chip_select, mode, speed, bits etc., Basically all these configurations I want to use for my test driver to check functionality of FIFO mode in the mcspi. I have already enabled FIFO in the mcspi but I want to check its functionality.
Can anyone please give me some suggestions?
I don't really know why cant you do something you want. I think you can pass the configuration by set up parameters using module_param
Adding on what #sunnyleevip suggested: another "standard" way to configure your driver would be to expose the params of interest via the /proc or the /sys filesystems.
You can find all the details in Linux Device Driver
Expanding on #sergico and #sunnyleevip, you could also use device tree to pass configuration data to the driver. The SPI bus master driver (since the 2.6.30s and all of the 3.x kernels) already are pretty devicetree supportive, so there might not be much more to do to get it to work.

Resources