Lower Filter Driver - windows

How can I install a filter driver as lower filter driver? All samples of DDK are upper filter driver.
Is there any method except using INF file for doing this work?
I know that lower filter drivers sit under FDO and top of BDO, but if there are more that one lower filter driver, how they are ordered? Can I put my driver at a specific location of this stack?

How can I install a filter driver as lower filter driver?
Upper and lower filter drivers are installed in much the same way - you don't actually require an INF - you can just set values in the Registry.
Of course, it depends upon which type of Filter Driver you want install, but as an example, if I want to set a lower disk class filter driver, I open up Regedit and navigate to the following key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E967-E325-11CE-BFC1-08002BE10318}
In here, you should see a string value called UpperFilters containing PartMgr. If you want to add a Lower Filter, simply create a LowerFilters value and set the name of your driver key to it. The GUID in the keyname is horrible, but if you scan through the Class key, you'll see lots of GUID-named keys - the default value of each one contains a brief description of what device the key represents.
Like PartMgr and all the other drivers, you will need to create your driver key under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services with all the appropriate configuration values. If you're not sure of the values for your driver, dump the entire HKLM\SYSTEM key to a file, install your driver normally, take a second dump of the entire HKLM\SYSTEM key and diff the dumps to see what values were put where.
Can I put my driver at a specific location of this stack?
Contrary to what anyone tells you otherwise, the answer is no. People sometimes believe that when multiple drivers are listed in the UpperFilters and LowerFilters registry values, the first one in this list gets loaded first. I've even witnessed this turn into "registry wars" where drivers are constantly fighting over their position in the list. It's nonsense and you should design your driver to cope with any other driver appearing above or below you.

you can a osr.com provided utility driverloader which will load you driver either upper/lower filter driver.basically it is a gui based utility in which you will all the options requiring to load the driver.
1. you can set your driver load order.
2. you can select your driver what kind you wrote.
3. no need for inf to set the registry key's it will do it for you automatically but if you want to modify these key value you can do it manually.
4. for more information go for www.osr.com.
Enjoy :-)

Related

How do I get the DeviceName ("\\.\DISPLAY1") that corresponds to a PNPDeviceID ("SWD\MyEnumerator\MyInstance")?

To manage display adapters and display properties, my code uses APIs from two different Windows DLLs:
CfgMgr32.dll
I use functions in CfgMgr32 (successor to SetupApi) to:
enumerate adapters (get ids & properties)
determine whether a specific adapter exists
determine whether an adapter is enabled/disabled
enabled/disabled an adapter
register a callback to receive PnP device events
APIs in CfgMgr32 (and SetupApi) use an adapter id (called DeviceInstanceId or PNPDeviceID) of the form: "SWD\MyEnumerator\MyInstance"
User32.dll
I use functions in User32 to:
enumerate adapters (get ids & properties)
query an adapter's supported resolutions
query an adapter's current display mode
change an adapter's current orientation
change an adapter's current resolution
APIs in User32 uses use a completely different adapter id (called DeviceName) of the form: "\\.\DISPLAY23"
The (Astonishing) Problem:
There appears to be no documented way of mapping between these two forms of unique identifiers. I can enable an adapter, but when I want to change its orientation or resolution, I have no way of knowing which of the identifiers returned by EnumDisplayDevices(...) refers to the same adapter I just enabled.
The APIs I need are split across two libraries; neither library provides a complete set of display adapter management functions.
Both libraries have functions that let you get information about a particular adapter, and there is some minor overlap, but critically: nothing that's unique to a single adapter. Maybe there's some way to unambiguously relate properties from one side to the other, but I've dumped out everything that's available (including SystemInformation, Screen.AllScreens, Wmi queries like Win32_VideoController, DISPLAY_DEVICE...) and in all that information I can't find anything mappable.
Has anyone solved this, or know of some open source project that might be worth looking over?

How to get exact feature vector from adafruit fingerprint sensor using arduino

I am trying to get the exact feature vector to save each fingerprint values in to the database. By according to the Adafruit library it display only the fingerprint template .But template is different for the same finger and I cannot identify the exact finger by matching from my client software.
Any help for this ? Any algorithm to convert this fingerprint template into feature vector or match each other.
Any method to get the character file (feature vector) from the fingerprint sensor ?
The algorithm for matching templates is unknown; the manufacturers did not release it probably because it's IP. You can't compare byte-by-byte because as you've discovered the generated template isn't always the same for the same finger. If you notice, there's a confidence value as well as different security levels implying there are different criteria for matching prints depending on the system parameters. The best you can probably do is store the templates on your database but use it as a second factor to authenticate users. What I mean is,
you can have a user enter some unique ID at a terminal and place their finger as well,
your Arduino queries your server with that ID as a key,
the server replies with the fingerprint template associated with that ID,
the Arduino forwards this template to the module and sends a command to perform a 1:1 match between the template just gotten from your database and the template just generated from the user's finger.
If they match, then you know you have the right user. Else, he's an impostor.
Or you can just make do with the local storage on the module and use your server only for assigning IDs during enrollment. If you still want to go ahead to get the character file from the module, you can try the UpChar command in the module's datasheet and see if you have any luck with it.
You can get the fingerprint templates using this library https://github.com/hmxmghl/Modified_AdafruitFingerprintSensor_Library

Trying to uniquely ID a USB device from WMI query using DeviceID field

When WMI is queried and returns a list of devices, I've noted some information at the END of the DeviceID string that isn't documented anywhere I've looked so far. Here's an example of a DeviceID string returned from a WMI query looking at Win32_PnPEntity:
USB\VID_046D&PID_082D&MI_00\7&3538A2BF&0&0000
Now, the first two parts - both the 'USB' and the VID and PID are really well documented, as is the 'interface number' - the &MI_XX. However, the last part of the string (shown below) isn't documented anywhere I've looked. I don't even know what to call this part of the DeviceID string:
\7&3538A2BF&0&0000
Curiously, it comes in several flavors. I've noted that if I have two identical devices plugged into the PC, I'll get different values, which I've defaulted to calling 'instance id's' for lack of better documented reference info. Here's what I see when I have two identical USB Web cameras plugged into my PC:
USB\VID_046D&PID_082D&MI_00\6&DB509D0&0&0000
USB\VID_046D&PID_082D&MI_00\7&3538A2BF&0&0000
So far, so good. I can pick out that I have two identical devices plugged into the PC and can parse against these unique values. But wait! When the OS sees these devices, it also loads anything the drivers offers for different 'interfaces' or modes of operation, so along with the above entries when I make a WMI query against Win32_PnPEntity, I also get these nice entries in the DeviceID field as well:
USB\VID_046D&PID_082D\195825EF
USB\VID_046D&PID_082D\36149BBF
So the problem is that without documentation that describes what this last part of the DeviceID is, I don't know to expect, and can't associate or separate these 'duplicate' entries from their brethren in the query results.
The goal is to be able to scan through the WMI result, identify ONE 'primary' entry for a given device and discard anything else. I could likely HACK the filtering by looking for "USB Composite Device" in the Description field, but this is rather ugly and would discard some devices that do not have an appropriate or vendor-specified 'description.'
MSDN only provides that the DeviceID is a "Unique identifier of the USB controller. This property is inherited from CIM_LogicalDevice." -- and CIM_LogicalDevice doesn't detail the makeup of this field either.
Anyone been down this path or know which hole to look in? Similar questions in here and in other forums remain unanswered. (Hey M$, Why is this so %$##! mystical???)
It looks like this webcam is a composite device.
I think the node with the ID of USB\VID_046D&PID_082D\36149BBF is the parent device. The part after the second slash in this case is most likely the serial number of the device. (I have made Windows software for composite devices for years and we always get the serial number by parsing that part). This node probably uses usbccgp.sys as the driver, which allows it to parse the interface descriptors of the device and produce child nodes.
The node with ID USB\VID_046D&PID_082D&MI_00\6&DB509D0&0&0000 is the child node corresponding to USB interface 0. From my experience, I believe that the part after the second slash is some kind of unique identifier that depends on what USB port the device is plugged in to.
For the WMI query, you should probably just ignore the child nodes altogether. Just discard anything with MI_ in it before the second slash. The parent node tells you everything you need to know about the identity of the device.

How to know SQL Server connection string?

Hello,
I have a VB6 program which I only have the compiled executable file and not the source code. This program connects to a SQL Server 2000 database. I get the,
[Microsoft][ODBC Driver Manager] Data source name not found and no
default driver specified
error. Is there a way to know what is the connection string coded inside the VB6 program? VB6 De-compilers did not work.
You can do a weird try, might be a help that is using Cheat Engine, generally used for cheatings Facebook games. This is a nice tool that helps you reading the changing values in the memory.
What we do is :
We execute the game in FF or Chrome. Open CheatEngine and from there we select the FF or Chrome from its proces windows. Now in its home screen, you can have search option in the memory registers. What we generally do is we search for a value on screen that changes on every step. So we place the value and set the search type as exact search and clicks on new search. In the left list box , it will give you 10000's of memory addresses, but dont worry. In your next turn, check the value after chnage, now put that value and click on next scan. Now you will have lesser address, repeat it until you exactly two register, generally comes in 3-4 clicks and 4-5 retries , so it will take around 15-20 mins of your time.
I am not sure that this will work. In your case, you have to find a unique keyword like ODBC Driver Manager , why because this register or its nearby register might contain the value.
If it seems a hectic and failure process, still you can explore the CheatEngine as it is full of options and nice small small utilities. Check that out, it might be a help. Or send me its exe, i will give a try for you, if you wish.
I know this is not an appropriate answer , but this might be a help , as he is totally stucked, kindly do not downvote. As its solely his decision whether to try or not

retrieving the serial number of a USB keyboard under Windows

Many USB devices contain a unique serial number (which is actually a Unicode string) which the host can use in conjunction with the 16-bit vendor and product ID numbers to uniquely identify the device.
I'm trying to figure out how to write a Windows application that would be able to display a list of all USB human interface devices attached to the system. The list would have one row for each HID, including system keyboards. There would be columns in the list for the vendor ID, product ID, and serial number.
I can get a list of USB HIDs by calling SetupDiGetClassDevs with the GUID returned by HidD_GetHidGuid and looping through the result by repeatedly calling SetupDiEnumDeviceInterfaces. I can then call SetupDiGetDeviceInterfaceDetail to get the path to each device, which I can open with CreateFile, so long as I am careful to request neither read nor write permission, which would be denied for a system keyboard. From there I can get the vendor and product ID numbers by invoking HidD_GetAttributes.
What I'm having trouble figuring out is how to retrieve the serial number string. When I search for solutions to this problem, I find a lot of information about how to get serial numbers for USB mass storage devices, but nothing that looks like it might apply to any other type of USB device. I would be happy to discover either a generic method or a HID-specific method of retrieving the serial number string.
I have a feeling that the Win32 port of libusb could manage this without too much trouble, but unfortunately I need a solution that depends only on libraries that come with Windows, such as the setupapi and hid DLLs that contain the functions mentioned above.
Any suggestions would be very much appreciated!
It turns out that HID.dll defines a function called HidD_GetSerialNumberString that does exactly what I want, given the handle I got from CreateFile as described above. Just tried it out and it works great. There are also HidD_GetManufacturerString and HidD_GetProductString functions to retrieve the other string descriptors referred to in the device descriptor, and even a HidD_GetIndexedString to get an arbitrary string descriptor given its index (presumably because the HID descriptor is allowed to contain string descriptor indices). I feel pretty silly now -- the answer was right there under my nose this whole time.
Thank you all for taking the time to read and answer my question! I'm going to go ahead and accept Alphaneo's answer since it sounds quite promising, and in fact I was waiting for the DDK to download when I stumbled across this answer.
Have you tried the USBVIew source code that comes along with the DDK. The USBView tool displays serial number for any USB device, and the source is shipped with the DDK.
Have you tried searching for the documentation of the HID definition of input records, output records and features records for Hid keyboards. This should show you the list of "things" you can get out/in of a keyboard through HID.
Also, I know it is possible to enumerate the HID record definition by software. I did something similar about 1 year ago, but I cannot remember the details at the top of my head. Doing so would allow you to see what the keyboard USB class is publishing as a standard interface.
I hope it can get you a few pointers to find out what you are looking for. Sorry I could not be more precise!
I recommend this book USB Complete. Chapter 4 Enumeration: How the Host Learns about Devices has the information you need.
This page has many links to information and for you links to libraries and utilities you can use.
you can use GetVolumeInformation for getting the serial number of any hardware attached.

Resources