Add wdi_sign_driver_inf() by spiro-trikaliotis · Pull Request #234 · pbatard/libwdi (original) (raw)
This PR add wdi_sign_driver_inf() to the libwdi API. It lets you supply an own INF file which is processed the same way like the built-in winusb.inf, libusb.inf and so on. It can also include "tokenization macros" like #CAT_FILENAME# or #WDF_VERSION#.
This allows to use a more customized INF than the automatically generated ones. For example, the INF can handle multiple devices, or the DFU mode of some devices.
Thanks. I'm usually reluctant to add code that people submit to solve what is looks like a custom workflow issue they have, but this looks generic enough, so I don't really mind.
I would however like an example of a custom driver (with a .inf containing the relevant tokens) so that I can test this patch, noting that I don't really care about the driver binary files, so you can just reuse the libusb0.sys binary if you are using proprietary stuff.
Okay, I'm going to alter your patch so that we don't have to add a new wdi_sign_driver_inf() API, but instead, just add a new external_inf flag to the options of wdi_install_driver(). Then if you just want to sign a driver, just call wdi_install_driver() with the external_inf flag set and supply a path for the .inf parameter, and this is what'll be used instead of the embedded .inf (with the extracted signed driver also using that filename, without the directory part) as the name of the generated .inf).
I'm also going to modify wdi-simple so that it takes a new -e option to specify and external inf.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})