SetupDiSetDeviceProperty is a function that defines a device instance property. A device instance is a device identification string that is unique and helps identify the device in the system. The SetupDiSetDeviceProperty function is important because it sets the display name and other parameters of your computer’s devices.
SetupDiSetDeviceProperty is part of a unified device property model that is supported by Windows operating systems. This device property model defines how your devices are represented, describes their functions, and sets up their configuration in the Windows operating system. This process applies to all hardware attached to your computer, including sound, display, network, and other devices.
Here is the syntax used for the SetupDiSetDeviceProperty process:
WINSETUPAPI BOOL SetupDiSetDeviceInterfacePropertyW(
Pro Tip: Run a dedicated PC optimization tool to get rid of incorrect settings, junk files, harmful apps, and security threats that can cause system issues or slow performance.
const DEVPROPKEY *PropertyKey,
const PBYTE PropertyBuffer,
The SetupDiSetDeviceProperty is successful if it returns TRUE. When an error occurs somewhere in the process, it returns FALSE with a specific return code.
One of the return codes that Windows users encounter is the ERROR_ACCESS_DENIED error on Windows 10/11. When this error happens, the SetupDiSetDeviceProperty process fails and cannot continue. The root cause of the error has to be resolved first before trying again.
What Is the Cause of ERROR_ACCESS_DENIED Error?
The return code ERROR_ACCESS_DENIED happens because “the caller does not have Administrator privileges.” In case you are wondering why SetupDiSetDeviceProperty returned ERROR_ACCESS_DENIED, it just means that you don’t have full writing permission to the device you are trying to modify. It is either you are using a non-admin account or you are using an admin account with limited privileges.
To resolve this error, you must check your account privileges and whether the device you are trying to edit requires specific permissions.
Another cause of ERROR_ACCESS_DENIED is a compatibility issue. If the program you are trying to modify was designed for an earlier version of Windows OS, it might not be compatible with Windows 10/11, hence the error. This error could also appear if the affected program is outdated or corrupted.
How to Fix ERROR_ACCESS_DENIED
The ERROR_ACCESS_DENIED error on Windows 10/11 might seem complicated, but the fixes are actually simple. But before you try any of the methods below, get rid of junk files first using Outbyte PC Repair and scan your computer for viruses and malware.
These steps will help clean up your computer and optimize your system for the troubleshooting process. Once done, restart your computer and work your way down through the items below.
Fix #1: Repair Damaged System Files.
One of the possible reasons why SetupDiSetDeviceProperty returns ERROR_ACCESS_DENIED is because some system files associated with the program you want to modify have been damaged or corrupted. To check the integrity of your system files, you can use the System File Checker or SFC tool, which is built into the Windows system.
To run a scan using SFC, follow the steps below:
- Click Command + X to open the Power menu, then choose Command Prompt (Admin) from the options.
- Enter sfc /scannow in the Command Prompt window, then hit Enter.
- Wait for the scan to be completed. SFC will automatically attempt to replace damaged system files with good copies from the Windows recovery image file.
Restart your computer for the new changes to be applied and check if the ERROR_ACCESS_DENIED error still persists.
Fix #2: Run in Compatibility Mode.
Running a program that was designed for an earlier Windows operating system, such as Windows 7, Windows 8, or Windows 8.1, can lead to compatibility issues. However, it doesn’t mean that these old programs are obsolete. You can run them in compatibility mode so that they work correctly and smoothly.
To run your program in compatibility mode:
- Right-click your program’s shortcut on the Desktop, then click Properties from the right-click menu.
- Click on the Compatibility tab.
- Under Compatibility Mode, choose which Windows version you want to use, then click OK.
- Tick off Run this program as an administrator as well.
Once you’ve set your program to run in compatibility mode with the Windows version you are using, try the SetupDiSetDeviceProperty function again and see if it still returns ERROR_ACCESS_DENIED. If it does, proceed to the next step.
Fix #3: Update Your Program.
Sometimes errors happen just because you failed to update your program. Check Windows Update under Settings > System & Security and see if there are any pending software or system updates. Install all available updates under Windows Update.
If you don’t see any, check the software developer’s website – there might be new patches or updates that need to be downloaded. Download them manually and install them on your computer to update your program. After updating, reboot your system and see if the ERROR_ACCESS_DENIED error has been fixed.
Fix #4: Undo Recent System Changes.
If you installed or deleted something before the ERROR_ACCESS_DENIED error appeared, this action might have affected your system and caused the error. Think back to what you did and undo it if possible.
If you recently installed an update, you can roll your system back to when everything was working fine by following the steps below:
- Click Start, then go to Settings.
- Click on Update & Security, then click on Windows Update > Update History.
- Click the View installed update history link.
- You’ll be presented with a list of all the recently installed updates. Click on the most recent and hit the Uninstall Update button.
- You will need to restart your computer for the changes to take effect, then check if the ERROR_ACCESS_DENIED error still appears.
Fix #5: Uninstall, then Reinstall the Affected Program.
If you still encounter the ERROR_ACCESS_DENIED error on Windows 10/11 even after trying the methods above, your last option will be to uninstall the program.
To uninstall a program on Windows 10/11:
- Go to Start > Settings > System, then click on Apps & features from the left menu.
- Choose the program you want to uninstall.
- Click on the Uninstall button.
- Restart your computer.
To reinstall the program, download a copy of the installer from the developer’s website or via Microsoft Store. Click on the downloaded file and install the program according to the instructions.
SetupDiSetDeviceProperty is an important function because it defines how a program should run. If you encountered the ERROR_ACCESS_DENIED error on Windows 10/11, simply follow the troubleshooting guide above to resolve it.