I am creating a UMDF driver that should change the brightness of the LCD backlight.
The following line of code works in the console application and successfully returns the device descriptor:
HANDLE hDevice = CreateFile(L"\\\\.\\LCD", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0);
However, when I use the same code snippet in my driver, it returns INVALID_HANDLE_VALUE, and GetLastError () gives code 5, which is "Access denied"
The driver is debugged remotely on an x64 Windows 7 machine using the standard WDKRemoteUser profile.
Does anyone know what the problem is? Do I need to set permissions and, if so, how?
Simon source share