The Strange DeviceIoControl result with IOCTL_VIDEO_QUERY_DISPLAY_BRIGHTNESS

On the Windows XP x64 running on the MacBook, the DeviceIoControl with IOCTL_VIDEO_QUERY_DISPLAY_BRIGHTNESS returns strange result.

HANDLE display = CreateFile(L"\\\\.\\LCD", FILE_ANY_ACCESS, 
                                       0, NULL, OPEN_EXISTING, 0, NULL);

if( display != INVALID_HANDLE_VALUE )
{
     DISPLAY_BRIGHTNESS bright;
     DWORD bytesReturned;
     if( DeviceIoControl(display, 
         IOCTL_VIDEO_QUERY_DISPLAY_BRIGHTNESS, 
         NULL, 0, &bright,
        sizeof(bright), &bytesReturned, NULL) )
     ...

The DeviceIoControl returns non-null. So, it means there is no error, but, the bytesReturned is 0.

I checked the device names using WinObj from the sysinternals. There was no “LCD” device there. Probably it is the reason, but then, the CreateFile should fail.

One response to this post.

  1. […] Programming, Win32, Windows. Tagged: C/C++, Win32, Windows. Leave a Comment In my previous post, The Strange DeviceIoControl result with IOCTL_VIDEO_QUERY_DISPLAY_BRIGHTNESS, I said that query LCD screen as described in MSDN document didn’t work. Today I found out […]

    Reply

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: