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

Home NTDEV
Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

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/


WHQL fails with "Failed to get primary INF, error 0x00000490" on driver PDO device

harikvpyharikvpy Member Posts: 7

I get this peculiar error from WHQL tests on a kernel mode driver.

The driver creates a PDO for user mode programs to communicate with it. The code to create this PDO follows that in kbfiltr from the sample code save creating a SpinLock & a ring buffer.

The driver is a mouse class driver, PnP driver. (Mouse drivers are typically not necessary, but we need it as there are some bugs in the HID reports sent by the device firmware that need to be addressed).

Research on the Net did not yield anything specific regarding this message.

Anyone else encountered this error? What could be the root cause?

TIA

Hari

Comments

  • CymonCymon Member Posts: 7

    What test is returning this error and for what devices?
    This error could mean the element being requested is missing.

  • harikvpyharikvpy Member Posts: 7
    edited September 2019

    It's a mouse class drive driver. It's a function driver rather than a filter driver as in the 'kbfiltr' sample in DDK.

    The PDO is used by the user mode agent to customize the behavior of the driver as necessary. The PDO code follows the rawpdo.c in that sample very closed, save for creating an extra spin lock and a WDF queue for posting events to the user mode agent.

  • Doron_HolanDoron_Holan Member - All Emails Posts: 10,499
    Did you create another INF (not in the mouse or hid device class) that installs the “null” driver on the raw PDO?
    d
  • harikvpyharikvpy Member Posts: 7
    edited September 2019

    @Doron_Holan said:
    Did you create another INF (not in the mouse or hid device class) that installs the “null” driver on the raw PDO?

    No I didn't. From what I can see, the sample code kbfiltr doesn't do that either. Or did I miss something?

    Does that mean that raw PDO needs its own INF? Can this be combined with the device INF file?

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 13,446

    A raw PDO does not need an INF file. No FDO will be loaded. However, the PDO has to be marked as "raw". You're still calling WdfPdoInitAssignRawDevice?

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

  • harikvpyharikvpy Member Posts: 7
    edited September 2019

    @Tim_Roberts said:
    A raw PDO does not need an INF file. No FDO will be loaded. However, the PDO has to be marked as "raw". You're still calling WdfPdoInitAssignRawDevice?

    Yes. But the DeviceClassGuid set to GUID_DEVCLASS_UNKNOWN (unlike kbfiltr which passes GUID_DEVCLASS_KEYBOARD). This is following the Note for this parameter in the doc:
    "You should always specify a custom class GUID. You should not specify an existing class GUID. If you specify an existing class GUID, other drivers that attempt to specify that existing class GUID might fail to install or might install with incorrect security settings."

    However, in the Remarks there is this:
    " The DeviceClassGuid parameter only identifies a section of the registry and does not actually set the device setup class for the device. The INF Version section in your device and driver's INF file sets the device setup class. Typically, the DeviceClassGuid parameter's GUID should match the GUID that the INF Version section specifies."

    And in the Examples at the bottom of the doc, WdfPdoINitAssignRawDevice is called with a custom GUID.

    So what is the correct argument for this?

    Could this be the problem why the WHQL test fails?

    Thanks a lot, both Doron & Tim for responding. Appreciate it.

  • harikvpyharikvpy Member Posts: 7

    Going through the various samples, I also notice that the usb/kmdf_enum_switches/sys sample also creates a PDO.

    But this samples supplies a custom GUID as the deviceclass and its INF has the following entries where the custom GUID is specified:

    [OSR.NT$ARCH$]
    %USB\VID_045E&PID_930A.DeviceDesc%=kmdf_enumswitches.Dev, USB\VID_0547&PID_1002
    %Switch.DeviceDesc%=Switch.Dev, {6FDE7521-1B65-48ae-B628-80BE62016026}\OsrUsbFxRawPdo
    
    
    [kmdf_enumswitches.Dev.NT]
    CopyFiles=kmdf_enumswitches.Files.Ext
    
    [Switch.Dev.NT]
    ;dummy section
    
    [Switch.Dev.NT.Services]
    AddService = , %SPSVCINST_ASSOCSERVICE%, 
    

    {6FDE7521-1B65-48ae-B628-80BE62016026} is the custom deviceclass GUID value supplied to WdfPdoInitAssignRawDevice.

  • harikvpyharikvpy Member Posts: 7

    Update:

    I ran the WHQL tests using GUID_DEVCLASS_MOUSE & custom GUID with the necessary modifiers as per the kmdf_enum_switches/sys sample. In both cases I get the same error.

  • Zac_LockardZac_Lockard Member - All Emails Posts: 25

    Can you ignore this test? This test shouldn't be running on your PDO. I've checked in a change on my end to not throw an error in the future.

  • harikvpyharikvpy Member Posts: 7

    @Zac_Lockard said:
    Can you ignore this test? This test shouldn't be running on your PDO. I've checked in a change on my end to not throw an error in the future.

    Thanks Zac.

    Just to clarify -- so we can ignore the "DF - InfVerif INF Verification" test on the PDO? All tests pass except for this particular one.

    As for your comment on checking in a change -- does it mean that if we submit the drivers for formal verification, it'll pass?

  • Zac_LockardZac_Lockard Member - All Emails Posts: 25
    edited October 2019

    Yes, you can ignore the test. And yes I believe it will pass a formal submission, but if there are any issues I will waive this test for a device that has no driver

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!
Kernel Debugging 30 Mar 2020 OSR Seminar Space
Developing Minifilters 15 Jun 2020 LIVE ONLINE
Writing WDF Drivers 22 June 2020 LIVE ONLINE
Internals & Software Drivers 28 Sept 2020 Dulles, VA