Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Home NTDEV

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

Why is my PCI driver's enumerator is “ROOT”?

EladMEladM Member Posts: 2
edited March 2020 in NTDEV

Hi all,

I am trying to write my first driver for a PCI device using WDF.

I took the basic kmdf project template from Visual Studio, added a few relevant empty PNP callbacks, debug tracing and edited the .inf file to include the hardware id for the connected PCI device.

From the .inf file:

[Standard.NT$ARCH$]
%cvbkmd.DeviceDesc%=cvbkmd_Device, PCI\VEN_1172&DEV_424F; hw-id

Once I install the driver via the devcon tool, I can see something weird happening:

After a few hiccups in device manager, I can see 2 device instances under the same device class. one is a software driver (sits under ROOT) and the other is a proper PCI device.

Watching the driver debug traces in TraceView, I can see that all device event callbacks are called twice. once for each enumerator. when they are called with by the PCI enumerator, I get the parameters I expect from the PCI device. For example EVT_WDF_DEVICE_PREPARE_HARDWARE callback is called once with an empty TranlatedResources list and once with the PCI device resources as I would expect.

I tried to perform a windows restore and re-install the driver, but the problem still exists.

So what can cause my device being installed under ROOT?

Comments

  • Doron_HolanDoron_Holan Member - All Emails Posts: 10,589

    "devcon install" will create a root enumerated device. you should only use "devcon update" to install your driver on the PCI enumerated device. You can safely delete the root enumerated device via device manager.

    d
  • Tim_RobertsTim_Roberts Member - All Emails Posts: 13,939

    "devcon install" is perhaps the most deceiving command ever invented. The oh-so-inviting name fools people into believing it does things that it doesn't really do. In retrospect, maybe "devcon create" would have been a better choice.

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

  • EladMEladM Member Posts: 2

    Thanks!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Developing Minifilters 24 May 2021 Live, Online
Writing WDF Drivers 14 June 2021 Live, Online
Internals & Software Drivers 27 September 2021 Live, Online
Kernel Debugging TBD 2021 Live, Online