Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results
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/
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?
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 |
Comments
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.
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.
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