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: 63

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,558

    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,558

    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: 63
    edited June 2022

    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!
Internals & Software Drivers 19-23 June 2023 Live, Online
Writing WDF Drivers 10-14 July 2023 Live, Online
Kernel Debugging 16-20 October 2023 Live, Online
Developing Minifilters 13-17 November 2023 Live, Online