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/


Write access failed for LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\ROOT\PORTS\0000\Device Parameter

remyavu10remyavu10 Member Posts: 60

The below function call failed with error code : c000000d811 from DeviceConfigure in UMDF driver.

status=WdfDeviceOpenRegistryKey(device,
PLUGPLAY_REGKEY_DEVICE,
KEY_WRITE|KEY_QUERY_VALUE,
WDF_NO_OBJECT_ATTRIBUTES,
&key);

When look-up for Win32 error code not found(even in https://www.osr.com/wp-content/uploads/NTtoDos.pdf).

Any idea what would have caused it fail?

If third parameter value is changed from KEY_WRITE|KEY_QUERY_VALUE to KEY_QUERY_VALUE, It shall succeeded. Seems to be access permission issue.

Can we create or write to this device registry area from within UMDF?

Comments

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 14,317

    c000000d811 is not a valid error number. Errors are only 32 bits. If you really meant 0xC000000D, that's STATUS_INVALID_PARAMETER.

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

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 14,317

    The table in the documentation implies that a UMDF driver only gets read access to that key. https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/wdfdevice/nf-wdfdevice-wdfdeviceopenregistrykey

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

  • remyavu10remyavu10 Member Posts: 60
    edited June 7

    Thank you very much Tim for the reply!

    When reg key is opened (using WdfDeviceOpenRegistryKey) with access ( PLUGPLAY_REGKEY_DEVICE|WDF_REGKEY_DEVICE_SUBKEY,
    KEY_READ|KEY_SET_VALUE) , the key values were able to be written (using WdfRegistryAssignULong ) under nested folder with named as driver under the "Device Parameters" folder.

    Reg Key Open API:
    WdfDeviceOpenRegistryKey(pQueueContext->DeviceContext->Device,
    PLUGPLAY_REGKEY_DEVICE|WDF_REGKEY_DEVICE_SUBKEY,
    KEY_READ|KEY_SET_VALUE,
    WDF_NO_OBJECT_ATTRIBUTES,
    &key);

    I had to specify WDF_REGKEY_DEVICE_SUBKEY; otherwise write shall succeeded but value shall not be reflected in the actual registry.

    Thanks,
    Remya

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

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!
Writing WDF Drivers 12 September 2022 Live, Online
Internals & Software Drivers 23 October 2022 Live, Online
Kernel Debugging 14 November 2022 Live, Online
Developing Minifilters 5 December 2022 Live, Online