Commit 9561d6e2 authored by Vitaliy Margolen's avatar Vitaliy Margolen Committed by Alexandre Julliard

gdi: Device name returned from EnumDisplayDevices is valid for CreateDC.

parent e74bda9d
...@@ -263,11 +263,13 @@ const DC_FUNCTIONS *DRIVER_load_driver( LPCWSTR name ) ...@@ -263,11 +263,13 @@ const DC_FUNCTIONS *DRIVER_load_driver( LPCWSTR name )
HMODULE module; HMODULE module;
struct graphics_driver *driver; struct graphics_driver *driver;
static const WCHAR displayW[] = { 'd','i','s','p','l','a','y',0 }; static const WCHAR displayW[] = { 'd','i','s','p','l','a','y',0 };
static const WCHAR display1W[] = {'\\','\\','.','\\','D','I','S','P','L','A','Y','1',0};
EnterCriticalSection( &driver_section ); EnterCriticalSection( &driver_section );
/* display driver is a special case */ /* display driver is a special case */
if (!strcmpiW( name, displayW )) if (!strcmpiW( name, displayW ) ||
!strcmpiW( name, display1W ))
{ {
driver = load_display_driver(); driver = load_display_driver();
LeaveCriticalSection( &driver_section ); LeaveCriticalSection( &driver_section );
......
...@@ -67,6 +67,7 @@ static void test_enumdisplaydevices(void) ...@@ -67,6 +67,7 @@ static void test_enumdisplaydevices(void)
while(1) while(1)
{ {
BOOL ret; BOOL ret;
HDC dc;
ret = pEnumDisplayDevicesA(NULL, num, &dd, 0); ret = pEnumDisplayDevicesA(NULL, num, &dd, 0);
ok(ret || num != 0, "EnumDisplayDevices fails with num == 0\n"); ok(ret || num != 0, "EnumDisplayDevices fails with num == 0\n");
if(!ret) break; if(!ret) break;
...@@ -75,6 +76,13 @@ static void test_enumdisplaydevices(void) ...@@ -75,6 +76,13 @@ static void test_enumdisplaydevices(void)
strcpy(primary_device_name, dd.DeviceName); strcpy(primary_device_name, dd.DeviceName);
primary_num = num; primary_num = num;
} }
if(dd.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP)
{
/* test creating DC */
dc = CreateDCA(dd.DeviceName, NULL, NULL, NULL);
ok(dc != NULL, "Failed to CreateDC(\"%s\") err=%ld\n", dd.DeviceName, GetLastError());
DeleteDC(dc);
}
num++; num++;
} }
ok(primary_num != -1, "Didn't get the primary device\n"); ok(primary_num != -1, "Didn't get the primary device\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment