How to repackage a NDIS driver

Several months ago I met a new challenge in shape of a device driver I’ve never seen before called…

NDIS – Network Driver Interface Specification.

I dont want to loose much time with talking about the “driver type” itself, because you can get all information from a well written wikipedia article.

Such a driver usually consists of the very typical driver files:

Inf File, Cat File & Sys File. Everything signed as you might expect of course.

My first attempt was to install the driver the “Ontrex Best Practices” way which usually means either to use the difxapp merge module or the dpinst.exe executable (custom action).

Unfortunately, none of them led to to same result as the original package had behave.

After googling around a bit I finally came to the tipping point: netcfg.exe

This executable is present on every windows at least since windows 2000 and basically helps you to automate any “Network Card” related installation tasks like

– Installing/servicing/uninstalling Network Protocols (e.g. Internet Protocol Version 4 (TCP/IPv4)

– Installing/servicing/uninstalling Network services (e.g. QoS Packet Scheduler)

– Installing/servicing/uninstalling Network Clients (e.g. Client for Microsoft Networks)

Kindly asked the program offers me the following command line parameters:

So the last missing information in the puzzle is how do I know the component id for my driver?

Solution was simple: I had installed the original package and searched through the registry  using the INF Filename and this offered me the following result:

 

Now I had all required information to schedule a custom action in my package to install the driver.

Because netcfg.exe is already on every windows installation I used the type “Execute Program From Destination” (MSI SDK: Custom Action Type 34)

[System64Folder]netcfg.exe -l “[#netlwf.inf]” -c s -i BNNS_NdisLwf

In our case the target operating system  was a x64 OS and therefore we needed to specify the [System64Folder].

Because the action changes the system state it logicaly belongs to the “deferred” installation sequence.

 

 

Post Navigation